fix(acp): persist session identity receipts for both runtimes - #4721
Open
PAB55 wants to merge 1 commit into
Open
fix(acp): persist session identity receipts for both runtimes#4721PAB55 wants to merge 1 commit into
PAB55 wants to merge 1 commit into
Conversation
Co-authored-by: Link <nathanclark28@gmail.com> Signed-off-by: Link <nathanclark28@gmail.com>
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.
Problem
buzz-acpdoes not persist which agent identity a session belongs to. Neither runtime carries it natively:session_metafields or 19turn_contextfields contains a pubkey, agent id, or auth tag (enumerated across 320+rollout-*.jsonlfiles).agent_nicknameappears only alongsideparent_thread_id, so it names a child, never the managed root.The practical consequence is that per-session usage records cannot be attributed to the agent that produced them. Recovering identity from persona prose is the only option today, and it is unreliable by construction.
Change
At the common post-
session/newboundary — covering both Codex and Claude — append one versioned JSONL receipt to a Desktop-provided, pair-scoped sidecar path:{"schema_version":1,"session_id":"…","agent_pubkey":"…","harness":"…","recorded_at":"…"}Five fields, nothing else. No channel id, message, prompt, credential, model, or cost content.
BUZZ_ACP_SESSION_IDENTITY_LOG; persona/agent env cannot redirect it.0600, with a re-check that repairs a pre-existing loose mode;sync_dataon write.#[serde(deny_unknown_fields)].buzz_acp::session_identitywarning telemetry and does not fail the ACP session.Purely additive: 9 files, 477 insertions, 0 deletions.
Verification
buzz-acp: 660 unit + 9 integration tests pass. Desktop library: 2,014 pass. Warning-denied Clippy, rustfmt, and clean-tree checks pass.Beyond the suites, the writer was exercised against a real runtime in an isolated harness with a throwaway identity:
0600, zero persona-marker hits.Codex joining is specified against the rollout filename UUID rather than
session_meta.id, because 2 of 323 observed rollouts were truncated before writing a header — the filename is present on all of them.Notes
The harness starts a new session after a process restart, so this does not attempt same-session continuity across restarts; that would be a separate resume feature.
🤖 Generated with Claude Code