fix(chat): correct native tool event correlation - #1114
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
@clawsweeper re-review |
|
🦞👀 Command router queued. I will update this comment with the next step. |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Codex review: found issues before merge. Reviewed August 7, 2026, 2:38 PM ET / 18:38 UTC. ClawSweeper reviewWhat this changesThe PR changes native chat correlation so tool, command, patch, output, and error events update one safely projected activity row. Merge readiness⛔ Blocked by patch quality or review findings - 5 items remain Keep open. The branch still drops the current legacy parent-item correlation path, and its supplied proof is synthetic and predates the current PR head. Priority: P2 Review scores
Verification
How this fits togetherGateway agent events enter the tray chat provider, which extracts safe tool data and sends normalized events to the timeline reducer. The reducer correlates them into native chat activity rows. flowchart LR
A[Gateway agent events] --> B[Chat event provider]
B --> C[Safe tool projection]
C --> D[Timeline correlation]
D --> E[Native chat activity rows]
Before merge
Findings
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Preserve toolCallId precedence, retain the legacy parent aliases before itemId fallback, restore regression coverage for the supported parent-child shape, then provide a redacted current-head live Gateway trace or UI proof. Do we have a high-confidence way to reproduce the issue? Yes, from source. Replay the current-main parent tool and parentItemId-only command-child fixture: the PR resolves the child as command-1 rather than tool-1, so its presentation and output cannot update the existing parent row. Is this the best way to solve the issue? No. The new normalized route is useful, but removing the legacy parent fallback is not safe while current main documents and tests that envelope shape. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 2439d4371096. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles) |
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Summary
Follow-up to #1078, related to #894. This corrects native-tool identity, correlation, output, and error convergence without broadening into persisted-history, reconnect, renderer ownership, or storage redesign.
The final fixes preserve three abort/replay invariants:
InterruptedtoSuccess.Interrupted.Scope
The PR remains limited to:
src/OpenClaw.Chat/ChatModels.cssrc/OpenClaw.Chat/ChatTimelineReducer.cssrc/OpenClaw.Tray.WinUI/Chat/NativeToolProjector.cssrc/OpenClaw.Tray.WinUI/Chat/OpenClawChatDataProvider.cstests/OpenClaw.Tray.Tests/ChatTimelineReducerTests.cstests/OpenClaw.Tray.Tests/NativeToolProjectorTests.cstests/OpenClaw.Tray.Tests/OpenClawChatDataProviderTests.csThe branch was updated from current
mainwithout rewriting history. Remote headf58fd68154c2d2c972dc4d55645b8d1ff2dad85chas tree5f1637a722da0127f572eca2ebab2b087dc01bf4, exactly matching validated integration31319859.Validation
./build.ps1testrerunThe local Axe category repeatedly passed 19/20 cases but reported host-sensitive
ClickablePointOnScreengeometry failures on different Chat page controls. The exact-head GitHubtestrerun, which includes the clean-run Axe gate, passed. The first CI attempt had one unrelatedSystemRun_Where_ReturnsExpectedOutputtimeout (-1); that test passed locally and the full exact-head rerun passed.Real behavior proof
This is source-derived synthetic parser/provider/reducer and production-renderer UIA proof, not a real Gateway capture. Exact validated tree output:
A current-head screenshot was not retained because capture on this host was blank or near-uniform. Semantic UIA assertions and the exact-head CI UI suite passed.
Real Gateway proof: Not verified. This validation intentionally used source-derived Core envelopes and the production rendering path.
Review
Final rubber-duck review verified all three abort/replay invariants and reported no blocking findings.