Repository navigation
test(interactive): a sealed session refuses input on the control endpoint (#6074) - #6077
Draft
code-yeongyu wants to merge 1 commit into
Draft
code-yeongyu wants to merge 1 commit into
code-yeongyu wants to merge 1 commit into
Conversation
…oint (#6074) A session file that was moved away, or a copy sealed by move_session revoke, is read-only here. The interactive control endpoint admits prompt, steer and follow_up into it with no ownership check, answers started, and only the write guard refuses the message later, once the turn tries to persist it. This is the RED test for the fix: the endpoint must answer the same typed session_moved_away refusal the RPC host sends since #5906, before any turn starts, and must leave the file byte-identical. RED at main: 3 of 4 failed, each on the refusal assertion (success was true, errorCode absent). The open-session case passes, so the failure is the seal, not the fixture.
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.
Part of #6074. This PR carries the RED test only; the fix lands after the security design gate on #6074 is approved by a non-author reviewer.
What
prompt,steerandfollow_upsent to a TUI session's control endpoint whose session file is sealed (moved away, or a copy revoked withmove_session revoke, #4004) must answer the same typed refusal the RPC host sends since #5906, before any turn starts:{"type":"response","command":"prompt","success":false,"error":"This session was moved to ...","errorCode":"session_moved_away","errorData":{"state":"moved"}}The test pins both halves of that contract: the typed refusal, and that no turn starts (
agent_startstays empty) while the session file stays byte-identical.Why
packages/coding-agent/src/modes/interactive/session-control-rpc-commands.tsadmits input through the session's external admission with no ownership check, so the endpoint answeredstartedand the write guard refused the message only later, when the turn tried to persist it. Three consequences:transcript_write_failed.Tests
packages/coding-agent/test/suite/regressions/6074-interactive-sealed-session-refusal.test.tsRED on main (
9613617994^): 3 of 4 failed, each on the refusal assertion:The fourth case (a session this process still owns admits a prompt and starts its turn) passes, so the failure is the seal, not the fixture.
Summary by cubic
Adds a RED test proving the interactive control endpoint must refuse input into a sealed session before any turn starts.
A session whose file was moved away (or revoked via
move_session revoke) is read-only, but the endpoint currently admitsprompt,steer, andfollow_up, answersstarted, and only the write guard refuses the message later when the turn tries to persist it. The test pins the typedsession_moved_awayrefusal and that noagent_startevent fires and the session file stays byte-identical.successistrue,errorCodeabsent); the owned-session case passes, so the fixture is sound.Written for commit 9613617. Summary will update on new commits.