Repository navigation
fix: coalesce redundant ACP tool updates - #442
Conversation
|
@franciscpd is attempting to deploy a commit to the Compozy Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (5)
📒 Files selected for processing (5)
Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review. WalkthroughThe ACP prompt now tracks SHA-256-based tool-call projections, suppresses redundant updates, merges meaningful metadata changes, and preserves deferred results. Tests cover burst coalescing, incremental enrichment, terminal results, failures, and calls without identifiers. ChangesTool-call update coalescing
Estimated code review effort: 3 (Moderate) | ~25 minutes Merge Risk: ⚪ Minimal · up to The change coalesces redundant nonterminal ACP tool updates while preserving meaningful state and terminal results; no actionable merge-blocking risk remains after normal checks and review. Sequence Diagram(s)sequenceDiagram
participant ToolUpdateBurst
participant ACPPrompt
participant EventBuffer
participant Client
ToolUpdateBurst->>ACPPrompt: send tool-call updates
ACPPrompt->>ACPPrompt: compare and merge projection
ACPPrompt->>EventBuffer: emit only meaningful tool-call update
ToolUpdateBurst->>ACPPrompt: send completed result
ACPPrompt->>EventBuffer: emit tool result and done events
Client->>EventBuffer: collect prompt events
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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 |
|
| Filename | Overview |
|---|---|
| internal/acp/agent_process_prompt.go | Adds prompt-scoped projection tracking and suppresses only repeated correlated nonterminal tool-call events while preserving terminal event handling. |
| internal/acp/types_test.go | Covers bounded burst delivery, canonical enrichment retention, terminal ordering, and uncorrelated empty-ID behavior. |
| internal/acp/client_prompt_contract_test.go | Verifies a real ACP subprocess prompt completes through more than 1,024 redundant updates with the expected call/result/done sequence. |
| internal/acp/client_test_support_test.go | Adds the deterministic subprocess fixture used to generate the repeated ACP update burst. |
| internal/acp/handlers_test.go | Confirms translation preserves title, kind, input, and successful or failed terminal results. |
| docs/qa/reports/2026-08-20-acp-tool-update-burst.md | Records the passing public runtime QA flow, follow-up prompt, durable event readback, and teardown evidence. |
Sequence Diagram
sequenceDiagram
participant Provider as ACP provider
participant Handler as ACP update handler
participant Prompt as Active prompt state
participant Stream as Bounded event stream
Provider->>Handler: initial tool call
Handler->>Prompt: tool_call projection
Prompt->>Stream: emit initial call
loop repeated nonterminal updates
Provider->>Handler: tool_call_update
Handler->>Prompt: projected update
Prompt-->>Prompt: merge and suppress if unchanged
end
Provider->>Handler: completed or failed update
Handler->>Prompt: tool_result
Prompt->>Stream: emit terminal result
Prompt->>Stream: emit prompt completion
Reviews (1): Last reviewed commit: "fix: coalesce redundant ACP tool updates" | Re-trigger Greptile
What & why
ACP providers can emit hundreds of state-equivalent updates for one tool call. Those duplicates could fill the active prompt's bounded event channel, stall delivery, and disconnect an otherwise healthy provider.
This change keeps one canonical projection per tool call during the active prompt. It suppresses only redundant nonterminal updates while preserving new title, name, kind, input, or prechecked state, plus terminal results and prompt completion in order.
Release notes
🐛 Bug Fixes
How you verified it
CGO_ENABLED=1 go test -race ./internal/acp -count=1passed.make gate-fullpassed with current fingerprint30cbf15585f325c8a17d58b4c427baeed5765eac. Commit and tag signing were disabled only inside the test process so temporary Git repositories did not inherit the operator's global signing settings.QA
Final status: PASS — the repeated update burst completed twice through the public session surface with no duplicate durable events or provider disconnect.
Coverage: Ada walked J-15 through the CLI, UDS, ACP subprocess, persistence, and follow-up prompt paths using a deterministic provider.
Issues: None found during the passing run.
Blocked / needs human: None.
Full report:
2026-08-20-acp-tool-update-burst.mdImpact
config.tomlkey, default, migration, OpenAPI schema, native tool descriptor, or official skill behavior changes.Compozy Impact Audit
internal/toolsnative IDs, descriptors, digests, and capability gates; no native tool contract changed.internal/hooks,internal/extension, MCP and bridge registries, and config lifecycle.ToolPrecheckedremains part of meaningful per-call state, and no hook, resource, or config surface changed.activePromptState.sendMu, keyed by the current prompt'stool_call_id, discarded at prompt end, and never enters global, workspace, or session stores or caches. Existing event correlation is unchanged.skills/compozy/; no public tool ID, CLI path, hook event, capability, extension resource, or memory, network, or task behavior changed.make gatepasses locally (make gate-fullpassed before review)Summary by CodeRabbit
Bug Fixes
Tests
Fixes #439