hermes: widen local goal judge timeout

This commit is contained in:
jenkins 2026-08-16 13:29:10 -03:00
parent 2a103f9895
commit e8b4f0c57c
3 changed files with 7 additions and 3 deletions

View File

@ -25,7 +25,7 @@ spec:
ai.bstein.dev/execution: Hermes Kanban with durable direct Codex and Claude Code CLI workers
ai.bstein.dev/model-policy: Jetson-assisted AUTO routing, low through xhigh, cross-provider fallback
ai.bstein.dev/placement: rpi5 preferred; Jetson deferred until state storage is available
ai.bstein.dev/config-rev: "20260816-review-findings-contract-v4"
ai.bstein.dev/config-rev: "20260816-goal-judge-timeout-v5"
prometheus.io/scrape: "true"
prometheus.io/path: /metrics
prometheus.io/port: "9010"

View File

@ -19,6 +19,10 @@ GOAL_JUDGE_MODEL = os.environ.get(
"HERMES_GOAL_JUDGE_MODEL",
"qwen2.5:14b-instruct-q4_0",
)
GOAL_JUDGE_TIMEOUT_SECONDS = max(
30,
min(180, int(os.environ.get("HERMES_GOAL_JUDGE_TIMEOUT_SECONDS", "120"))),
)
RESULT_STATUSES = frozenset({"completed", "blocked", "incomplete"})
GOAL_JUDGE_SCHEMA: dict[str, Any] = {
"type": "object",
@ -129,7 +133,7 @@ def judge_goal_completion(
method="POST",
)
try:
with open_request(request, timeout=60) as response:
with open_request(request, timeout=GOAL_JUDGE_TIMEOUT_SECONDS) as response:
document = json.load(response)
content = document["choices"][0]["message"]["content"]
verdict = json.loads(content)

View File

@ -106,7 +106,7 @@ def test_goal_judge_uses_local_structured_verdict():
assert reason == "remote head evidence is missing"
assert observed["payload"]["model"] == "qwen2.5:14b-instruct-q4_0"
assert observed["payload"]["response_format"]["json_schema"]["strict"] is True
assert observed["timeout"] == 60
assert observed["timeout"] == 120
def test_goal_judge_fails_closed_on_invalid_response():