Repository navigation
test(channels): drive a refused prompt through the bridge runner - #782
Merged
Merged
Conversation
The `Err` arm of the bridge runner — the warning logged when a turn fails after the connection is already held — had no test that reached it on purpose. `bridge/turn.rs` does test a refused prompt, but it calls `run_turn` directly, so it never enters the runner's error arm; and the two bridge tests that point at a dead endpoint fail at `client()` first, taking the "cannot reach the agent" path instead. The result was an arm whose coverage depended on the run: it read as covered in one full-suite measurement and uncovered in the next. `a_turn_that_cannot_be_dispatched_is_logged_and_leaves_the_bridge_routable` removes the ambiguity: the agent is reachable (so the bridge holds a connection) and refuses the `prompt` command, which is the only shape that makes `run_turn` return `Err` while the connection is healthy. Verified by instrumenting that single test — `bridge/mod.rs` lines 252–254 execute, `1` rather than `0`. It also pins the behaviour that arm exists for: a refused turn is explained to the user, the healthy connection is kept rather than torn down, and the conversation stays routable.
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.
test(channels): drive a refused prompt through the bridge runner
The
Errarm of the bridge runner — the warning logged when a turn failsafter the connection is already held — had no test that reached it on purpose.
bridge/turn.rsdoes test a refused prompt, but it callsrun_turndirectly,so it never enters the runner's error arm; and the two bridge tests that point
at a dead endpoint fail at
client()first, taking the "cannot reach the agent"path instead. The result was an arm whose coverage depended on the run: it read
as covered in one full-suite measurement and uncovered in the next.
a_turn_that_cannot_be_dispatched_is_logged_and_leaves_the_bridge_routableremoves the ambiguity: the agent is reachable (so the bridge holds a connection)
and refuses the
promptcommand, which is the only shape that makesrun_turnreturn
Errwhile the connection is healthy. Verified by instrumenting thatsingle test —
bridge/mod.rslines 252–254 execute,1rather than0.It also pins the behaviour that arm exists for: a refused turn is explained to
the user, the healthy connection is kept rather than torn down, and the
conversation stays routable.