Conversation
This was referenced Sep 10, 2026
1 task done
The first-iteration drain searched all history for the newest tool row, so a /steer accepted during image preprocessing landed before the current user message whenever an earlier turn had tool output. Co-authored-by: Cursor <cursoragent@cursor.com>
KoNit-K
force-pushed
the
fix/steer-preapi-current-turn
branch
2 times, most recently
from
September 17, 2026 13:56
32929da to
42d1653
Compare
12 tasks done
Author
|
Synced to the current integration base in 4f2a0a6. Pre-API steer injection no longer attaches to a prior turn's tool result; it still attaches after an in-turn tool result and restashes when no current tool exists. Focused steer tests pass (35 tests). There are no unresolved review threads to resolve. |
This branch has not been deployed
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?
Classic CLI sets
_agent_running=Truebeforechat()image preprocessing, so/steerduring that window is acknowledged (Steer queued — arrives after the next tool call) and stored in_pending_steer.On the first API iteration,
prepare_iterationdrained that slot and_inject_steer_after_newest_tool_resultsearched the full history for the newestrole=toolrow. If the current turn had not produced a tool result yet, a prior turn's tool row was selected and the steer was inserted before the current user message — historical context, not a correction to the active turn.This PR restricts the pre-API inject floor to the current-turn user row (
current_turn_user_idx). With no in-turn tool yet, the steer is requeued via_requeue_pending_steerfor the existing post-tool drain. CLI_agent_runningtiming,_cmd_steerack text, andapply_pending_steer_to_tool_resultsare unchanged.Related Issue
Fixes #107272
Type of Change
Changes Made
agent/turn_iteration_prep.py— only accepts rows with index strictly greater than the current-turn user floor; otherwise requeues. passes .tests/agent/test_steer.py— regression for prior-turn tool + no in-turn tool (requeue, no insert before current user); CONTROL that an in-turn tool still gets a standalone steer user row after that tool, not the old one; production helper restash when there are no tools.How to Test
scripts/run_tests.shon the files in Changes Made — focused verificationHERMES_PYTHON=/path/to/venv/bin/python scripts/run_tests.sh tests/agent/test_steer.pytest_pre_api_drain_does_not_attach_to_prior_turn_tool_resultfailed (TypeError: unexpected keyword argument 'current_turn_user_idx'on the unwired helper; the new floor is the behavior the test then asserts).tests/agent/test_steer.py— 39 passed, 0 failed.scripts/run_tests.sh tests/agent/test_steer.pypytest RED→GREEN locallyEvidence
scripts/run_tests.shon the files in Changes Made — focused verification — 39 passedChecklist
Code
Documentation & Housekeeping
cli-config.yaml.example: N/ACONTRIBUTING.mdorAGENTS.md: N/A