test(gateway): empty turns are classified failed since #270 - #294
Merged
Conversation
#270 made the turn-outcome classifier the owner of message.complete's status. _derive_turn_outcome() treats a turn with no visible response as terminal status "failed" ("turn ended without a visible response"), and _freeze_turn_outcome() overrides the locally computed status with it, so the payload ships status="error". That is the deliberate contract, not a regression: #270's own tests/tui_gateway/test_turn_outcomes.py parametrizes {"completed": True, "final_response": ""} -> "failed" / "without a visible response". #270 added that file but never updated this one, so the pre-#270 expectation stayed red. The half of this test that still guards real behavior is the payload text: classifying the turn must not fabricate an "Error:" string. That assertion is unchanged and still passes. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This was referenced Aug 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes
test_prompt_submit_preserves_empty_response_without_error, which failson
mainwithassert 'error' == 'complete'.This is a stale expectation, not a regression — and #270 says so in its own
tests, which is how I confirmed it rather than guessing.
#270 ("guarantee terminal turn outcomes") made the turn-outcome classifier the
owner of
message.complete'sstatus._derive_turn_outcome()classifies aturn that ends with no visible response as
failed:and
_freeze_turn_outcome()then overrides the locally computed status(
tui_gateway/server.py:10930), mappingfailedontostatus: "error". So theold
result.get("error")-based computation no longer decides the outcome.That this is deliberate is settled by #270's own test file:
#270 added
tests/tui_gateway/test_turn_outcomes.py(800 lines) but nevertouched
tests/test_tui_gateway_server.py, so this pre-#270 expectation stayedred — invisible in CI because the
uv sync --lockedinstall step had beenfailing since 2026-07-10 (see #286).
The half of this test that still guards real behavior is the payload text:
classifying a turn as failed must not fabricate an
"Error: ..."string. Thatassertion is unchanged and still passes.
Related Issue
No filed issue — surfaced once #286 unblocked the Python test slices.
Type of Change
Changes Made
tests/test_tui_gateway_server.py— expectstatus == "error"for a turn with no visible response, and document in the docstring that fix(runtime): guarantee terminal turn outcomes #270's classifier owns this, with a pointer to the authoritative parametrized case.How to Test
Before:
assert 'error' == 'complete'. After:1 passed.HERMES_HOME. The suite reads the developer's real~/.hermes/config.yaml; a localfallback_policy: 'off'reds 5 unrelatedtests in this same file that pass on CI.
Checklist
Code
Documentation & Housekeeping
cli-config.yaml.example— N/ACONTRIBUTING.mdorAGENTS.md— N/A