Skip to content

fix(steering): reject a missing post-echo result - #969

Open
ran411285752 wants to merge 2 commits into
agentclientprotocol:mainfrom
ran411285752:codex/fix-steering-result-boundaries
Open

fix(steering): reject a missing post-echo result#969
ran411285752 wants to merge 2 commits into
agentclientprotocol:mainfrom
ran411285752:codex/fix-steering-result-boundaries

Conversation

@ran411285752

@ran411285752 ran411285752 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Summary

Follow-up to #958. After merging current main (caf609b), #967 already covers the pre-echo diagnostic-result failure, so this PR is now limited to the remaining post-echo result-boundary bug:

  • clear the interrupted cycle's saved steeredSettle when the matching steering echo replays;
  • if the SDK then goes idle without a result for the steered cycle, reject with the existing no_result error instead of reusing the interrupted cycle's successful result.

User impact

A steered instruction that starts but never produces its own final result is no longer reported as successfully completed using the result from before the instruction ran.

Tests

Fresh RED on current main behavior:

  • does not reuse the interrupted result after the steered echo incorrectly resolved end_turn with 15-token pre-echo usage.

GREEN and adjacent verification:

  • focused Steering/ExitPlanMode tests: 6 passed;
  • npm run build: passed;
  • npm run lint: passed;
  • npx prettier --check src/acp-agent.ts src/tests/acp-agent.test.ts: passed;
  • git diff --check: passed.

Windows repo-wide baseline:

  • npm run test:run: 949 passed, 23 failed, 27 skipped. Failures are in untouched path/permission formatting tests and three 5-second timeouts; the focused Steering tests pass.
  • repo-wide Prettier reports CRLF drift in 75 untouched files; both changed files pass direct Prettier checking.

Why: agentclientprotocol#958 could reject a prompt on the interrupted cycle's diagnostic result, then reuse that pre-echo result if the steered cycle ended without its own result.

What: Treat pre-echo results as superseded outcomes, clear them when the matching steering echo arrives, and reject an idle steered cycle that has no post-echo result. Add focused regression coverage for both boundaries.

Impact: Only active injected steering settlement changes; agentclientprotocol#958's steeredEchoes/steeredSettle state machine remains authoritative.
@ran411285752

ran411285752 commented Aug 7, 2026

Copy link
Copy Markdown
Contributor Author

@Rizzen, could you please review this focused follow-up to #958 when you have a chance?

It keeps #958's steering state machine and only fixes the pre-echo diagnostic-result rejection and the post-echo stale-result reuse described above. The branch is mergeable and the focused Steering/background-subagent tests pass locally.

…sult-boundaries

# Conflicts:
#	src/acp-agent.ts
#	src/tests/acp-agent.test.ts
@ran411285752 ran411285752 changed the title fix(steering): guard interrupted result boundaries fix(steering): reject a missing post-echo result Aug 25, 2026
@ran411285752

Copy link
Copy Markdown
Contributor Author

Merged current main at caf609b and resolved the overlap with #967: this PR now contains only the post-echo stale-result fix. Fresh RED reproduced the false end_turn success; the focused Steering/ExitPlanMode suite is green (6 tests), and build/lint pass. @Rizzen, could you please approve Actions and review the narrowed diff?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant