Repository navigation
docs(unstable-v2): send a new session's non-idle state after the response - #2871
Merged
Merged
Conversation
…onse A `state_update` for a new session may arrive before the `session/new` response, and a Client may drop notifications for a `sessionId` it does not know yet. The response cannot carry the state, so a Client that drops early updates stays on the `idle` default while the Agent has reported `running`. - Require an Agent whose new session is not `idle` to send the session's `state_update` after the response. - Point to the rule from the session states section of the prompt lifecycle page. - State the rule in the `NewSessionResponse` schema description, which already carried the Client half of the paragraph.
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.
Summary
A new session defaults to
idle. An Agent that starts work when the session is created reportsrunningwith astate_update, and that update may be sent before thesession/newresponse. The same paragraph lets a Client drop notifications for asessionIdit does not know yet. A Client that drops them stays on theidledefault while the Agent has reportedrunning.The response cannot close this gap, because it has no state field. This adds one rule for the Agent, which controls the order of its own messages.
Changes
idleMUST send the session'sstate_updateafter thesession/newresponse. Changed in the stable page and itsdraft/copy.NewSessionResponsedescription already stated the Client half of this paragraph. It now states the Agent rule too. This regeneratesschema/v2/schema.json,schema/v2/schema.unstable.jsonand bothschema.mdxpages. Only the description text changes.Notes
sessionIdbefore the response names it.claude-agent-acpalready holds its post-setup work until the response is sent, andcodex-acpsends nothing for a new session before the response.Checks
cargo clippyin the three configurations fromnpm run check,cargo test --all-features, and rustdoc with-D warningspass.cargo fmt, the spellcheck script, and the link check pass.