feat(ai): add bounded model-aware decision fallback
Some checks failed
CD Pipeline / deploy (push) Has been cancelled

This commit is contained in:
ogt
2026-07-22 22:57:07 +08:00
parent 283c8c80c6
commit a5a7af6e95
20 changed files with 3306 additions and 257 deletions

View File

@@ -7,6 +7,7 @@ ROOT = Path(__file__).resolve().parents[1]
def test_qwen3_is_active_runtime_model_not_unused_ollama_weight():
openclaw_source = (ROOT / "services" / "openclaw_strategist_service.py").read_text(encoding="utf-8")
nemotron_source = (ROOT / "services" / "nemoton_dispatcher_service.py").read_text(encoding="utf-8")
candidate_source = (ROOT / "services" / "nemotron_runtime_candidate_service.py").read_text(encoding="utf-8")
router_source = (ROOT / "services" / "llm_model_router.py").read_text(encoding="utf-8")
assert "OPENCLAW_QA_OLLAMA_MODEL = os.getenv('OPENCLAW_QA_OLLAMA_MODEL', 'qwen3:14b')" in openclaw_source
@@ -16,7 +17,11 @@ def test_qwen3_is_active_runtime_model_not_unused_ollama_weight():
assert "OPENCLAW_STRATEGY_OLLAMA_KEEP_ALIVE = os.getenv('OPENCLAW_STRATEGY_OLLAMA_KEEP_ALIVE', '5m')" in openclaw_source
assert "keep_alive=OPENCLAW_STRATEGY_OLLAMA_KEEP_ALIVE" in openclaw_source
assert 'keep_alive="24h"' not in openclaw_source
assert 'NEMOTRON_OLLAMA_MODEL = os.getenv("NEMOTRON_OLLAMA_MODEL", "qwen3:14b")' in nemotron_source
assert "NEMOTRON_OLLAMA_MODEL = PRIMARY_MODEL" in nemotron_source
assert "def _call_qwen3_dispatch(" in nemotron_source
assert "for _attempt in range(3):" in nemotron_source
assert "for candidate in build_nemotron_runtime_candidates(" in nemotron_source
assert "inspect_nemotron_model_identity(" in nemotron_source
assert '"qwen3:14b"' in candidate_source
assert '"qwen3:8b"' in candidate_source
assert 'label="ollama_111_fallback"' in candidate_source
assert "'qwen3:14b'" in router_source