fix(server): preserve tool lifecycle identity - #7151
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Thread transfer impact✅ Thread transfer remains within every enforced ceiling.
Baseline: unavailable · PR result: Scenario and decoded snapshot size10 historical turns, 5 command tools per turn, 878.9 KiB retained MCP result per historical turn, and a 1.05 MiB retained result in the measured turn.
Updated in place by a trusted workflow. PR artifacts are strictly validated and never executed. |
ApprovabilityVerdict: Approved a21dd5a This is a self-contained bug fix that improves how tool lifecycle identity is extracted and preserved in the orchestration layer. Changes are well-tested and limited to internal activity projection logic with no external API or schema impact. You can customize Macroscope's approvability policy. Learn more. |
41b012a to
2032446
Compare
2032446 to
4ee0341
Compare
68825d8 to
e1a4e26
Compare
e1a4e26 to
4565c3e
Compare
6fcc75e to
46c389f
Compare
46c389f to
cf5bf33
Compare
d25f98f to
56adc28
Compare
64ad44b to
2b5942c
Compare
2b5942c to
ce306d2
Compare
ce306d2 to
404a007
Compare
3777cdf to
9fb61a0
Compare
9fb61a0 to
c95612a
Compare
58b7d7a to
514525d
Compare
514525d to
b0e62c1
Compare
b0e62c1 to
b29dc55
Compare
What changed
toolCallIdlifecycle identity for started, updated, and completed tool events.Screenshots
Not applicable. This is a server-only lifecycle projection change; its visible web consumer is demonstrated in #7152.
Why
This is the sensitive server layer that was hard to approve inside the original UI PR. It is intentionally above every independent UI layer. The stack can merge through #7150 without taking this change.
Review notes
tool.started; the new web behavior is implemented in feat(web): group live tool activity #7152.Validation
Stack order
Built with GPT-5.6-sol in the Codex harness.
Note
Medium Risk
Changes orchestration activity shape and snapshot collapsing for tool lifecycle rows; grouping can shift for existing threads when runtime item ids are present, but scope is server projection/ingestion with tests covering the new paths.
Overview
Provider runtime ingestion now maps provider
itemIdto top-leveltoolCallIdonitem.started,item.updated, anditem.completedactivities. Started and completed payloads also carry status and provider data where they were missing before (started events now persist command input, not just title/detail).Activity payload projection adds
projectCommandValueso slimmed command rows get a singledata.commandfrom top-levelcommand, Claudeinput.command, or OpenCodestate.input.command.toolLifecycleIdentitypreferspayload.toolCallId(then legacydata.toolCallId) before falling back to type/title/detail, so snapshot deduping and client folding align on the same id when the runtime supplies one.Behavioral note: streams that only matched on title/detail may group differently once
toolCallIdis present.Reviewed by Cursor Bugbot for commit a21dd5a. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Preserve tool lifecycle identity by propagating top-level
toolCallIdin activity payloadsProviderRuntimeIngestion.tsnow includes a top-leveltoolCallIdonitem.started,item.updated, anditem.completedactivity payloads whenevent.itemIdis present;startedandcompletedevents also carrystatusanddata.ActivityPayloadProjection.tsintroducesprojectCommandValueto normalize the command string fromdata.command,data.input.command, ordata.state.input.command, replacing a direct field check.toolLifecycleIdentitynow prefers a top-levelpayload.toolCallIdover the nestedpayload.data.toolCallIdwhen computing which rows to retain per tool call.toolCallIdwhen present, which may change which activity rows are retained as the newest per tool call.Macroscope summarized a21dd5a.