From 369afc60be83cc8af279042242268d2e4ffc717a Mon Sep 17 00:00:00 2001 From: Teknium <127238744+teknium1@users.noreply.github.com> Date: Mon, 20 Jul 2026 03:46:09 -0700 Subject: [PATCH] fix: migrate CLI kanban gate + remaining mocks to 5-value judge contract MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Follow-up to the salvaged transport-failure auto-pause (#54387): the PR branch predates the CLI completion gate merged in #67985, so that new judge_goal consumer (hermes_cli/kanban.py) needed the 5-value unpack too — otherwise it would fail open again via the swallowed ValueError. Also migrates the two remaining 4-value mocks in tests/cli/test_cli_goal_interrupt.py flagged on the earlier PR #27760. --- hermes_cli/kanban.py | 9 +++++---- tests/cli/test_cli_goal_interrupt.py | 4 ++-- tests/hermes_cli/test_kanban_goal_mode.py | 4 ++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/hermes_cli/kanban.py b/hermes_cli/kanban.py index a8b4a543c396..c6f9688ffe5e 100644 --- a/hermes_cli/kanban.py +++ b/hermes_cli/kanban.py @@ -2016,10 +2016,11 @@ def _cmd_complete(args: argparse.Namespace) -> int: reason = "" try: # judge_goal returns (verdict, reason, parse_failed, - # wait_directive) — see hermes_cli/goals.py. Unpacking - # fewer raises ValueError into the fail-open handler - # below, silently disabling the gate. - verdict, reason, _, _ = judge_goal( + # wait_directive, transport_failed) — see + # hermes_cli/goals.py. Unpacking fewer raises + # ValueError into the fail-open handler below, + # silently disabling the gate. + verdict, reason, _, _, _ = judge_goal( goal=f"{task.title}\n\n{task.body or ''}".strip(), last_response=(summary or args.result or "").strip(), ) diff --git a/tests/cli/test_cli_goal_interrupt.py b/tests/cli/test_cli_goal_interrupt.py index 6ab4ce89d2cb..7e6c05e6ebd0 100644 --- a/tests/cli/test_cli_goal_interrupt.py +++ b/tests/cli/test_cli_goal_interrupt.py @@ -169,7 +169,7 @@ class TestHealthyTurnStillRuns: # Force the judge to say "continue" without touching the network. with patch( "hermes_cli.goals.judge_goal", - return_value=("continue", "needs more steps", False, None), + return_value=("continue", "needs more steps", False, None, False), ): cli._maybe_continue_goal_after_turn() @@ -189,7 +189,7 @@ class TestHealthyTurnStillRuns: with patch( "hermes_cli.goals.judge_goal", - return_value=("done", "goal satisfied", False, None), + return_value=("done", "goal satisfied", False, None, False), ): cli._maybe_continue_goal_after_turn() diff --git a/tests/hermes_cli/test_kanban_goal_mode.py b/tests/hermes_cli/test_kanban_goal_mode.py index 08ddb174541c..8f201341da69 100644 --- a/tests/hermes_cli/test_kanban_goal_mode.py +++ b/tests/hermes_cli/test_kanban_goal_mode.py @@ -347,10 +347,10 @@ class TestCLIJudgeGate: lambda name: _aux_client, ) # Match the real judge_goal contract: - # (verdict, reason, parse_failed, wait_directive) + # (verdict, reason, parse_failed, wait_directive, transport_failed) monkeypatch.setattr( "hermes_cli.goals.judge_goal", - lambda **kw: (verdict, reason, False, None), + lambda **kw: (verdict, reason, False, None, False), ) args = argparse.Namespace(task_ids=["t1"], summary=summary, result=None, metadata=None)