Repository navigation
Conversation
Author
|
@ashwin-ant @qing-ant, could you take a look when you have a chance? This addresses #1270 by preserving input attribution and exposing command lifecycle events. Thanks! |
sigley
approved these changes
Oct 7, 2026
sigley
left a comment
There was a problem hiding this comment.
Validated exact head bfb99e6. The focused parser/query/client slice passes 227 tests, compileall is clean, and the current main drift is limited to release/CI/version files. I also checked the older #1271 overlap: this PR carries that attribution subset forward while adding the previously dropped command_lifecycle frames and preserving existing positional constructors. I do not see a blocking correctness or mergeability issue.
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.
The CLI emits input-attribution metadata and top-level
command_lifecycleframes, but Python currently discards both. Hosts that queue multiple prompts cannot reliably correlate replies with submitted inputs or observe each input's lifecycle through the public message iterators.This preserves
user_message_uuidanduser_message_uuidson assistant messages, stream events, and results, plusqueued_turn_counton results. The fields are optional and appended to the existing dataclasses so older CLI output and positional constructors remain compatible.It also adds a public
CommandLifecycleMessagefor the CLI'scommand_uuid,state,uuid, andsession_idfields. States remain open strings so future lifecycle states pass through. Both public streaming APIs deliver these messages, including completion after a result.receive_response()still stops atResultMessage; the docs explain when callers should continuously consumereceive_messages()instead.The attribution portion overlaps #1271. This PR also addresses the dropped lifecycle frames reported in the newer comment on #1270. Regression tests cover exact message types, absent and merged attribution, zero queue counts, all existing constructor positions, caller UUID serialization, future lifecycle states, and delivery before and after results. The docs explain that the producer's 64-entry attribution list can be incomplete and that queued sends do not correspond one-to-one with results.
Closes #1270.
Validation
/helpprobe deliveredqueued,started, andcompletedwith matching wire fields, including completion afterResultMessage. The same probe against upstream delivered no lifecycle messages. This required no model API calls.git diff --checkpassed. The separate real Claude API test suite was not run because API credentials were unavailable.