Repository navigation
Preserve native tool identity in chat - #1078
Conversation
Co-authored-by: Copilot App <[email protected]>
|
Codex review: needs maintainer review before merge. Reviewed August 5, 2026, 8:27 PM ET / August 6, 2026, 00:27 UTC. ClawSweeper reviewWhat this changesThis PR preserves trusted native tool names and bounded safe argument previews when gateway tool events are correlated, cached, restored, and rendered in the Windows native chat timeline. Regression provenancePossible regression — probable (reviewed change; reproduction). No predecessor PR is attributed. Merge readinessKeep open. Current main still ignores command-child events and derives generic tool names from parent titles; this PR supplies the missing projection, correlation, and native rendering. The patch appears correct with direct current-head UI proof, but a maintainer should explicitly accept the legacy cache restoration tradeoff before merge. Priority: P2 Review scores
Verification
How this fits togetherNative chat receives gateway event streams, reduces them into per-thread timeline state, and renders tool-call rows through the Reactor native UI. This change sits at the event-correlation and history-cache boundary, affecting what users see for live and restored tool calls. flowchart LR
A[Gateway tool events] --> B[Chat data provider]
B --> C[Timeline reducer]
C --> D[Tool metadata cache]
C --> E[Native tool projector]
E --> F[Reactor chat timeline]
D --> B
F --> G[Native chat rows]
Decision needed
Why: The code keeps old cache records readable, but their historic rows cannot be exactly correlated after restart, so accepting that compatibility behavior is a product and upgrade judgment. Before merge
Agent review detailsSecurityNone. Review metrics
Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Land the pure projector and reducer ownership split only after accepting the backward-compatible chronological fallback for old cached tool metadata, with its upgrade behavior retained as an explicit tested contract. Do we have a high-confidence way to reproduce the issue? Yes. Current main source ignores command-child item events and reduces parent titles to generic tool identities, which directly explains the reported native-chat behavior. Is this the best way to solve the issue? Yes, subject to the cache-compatibility decision. Moving pure identity and safe-argument projection into a dedicated projector is the narrowest maintainable repair while the provider retains stateful correlation and persistence. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against e9d571a9b395. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (13 earlier review cycles; latest 8 shown)
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Related to #894
Root cause
The issue screenshot reflects three losses in the native chat projection:
kind=toolitems were reduced to the first token of a generic parent title.kind=commandchildren were ignored, so concrete identities such as Bash and Apply Patch never reached the native row.command_outputalso appended output without preserving the richer child identity or safe command preview.Behavior
command,path,file_path,query,url, andpattern.Security boundaries
Architecture
The chat event/model/reducer boundary owns correlation, deterministic outcome ordering, identity strength, and bounded replay state.
NativeToolProjectoris the authoritative pure owner for canonical identity, safe display arguments, payload extraction, and flattened-history classification.OpenClawChatDataProviderretains stateful live/history application, run/session/legacy-generation correlation, and metadata cache persistence and migration. Reactor remains the native presentation owner.Synthetic screenshot orchestration is outside
ChatPage. The genericVisualTestCapturehelper responds only to explicit visual-test environment configuration after the ReactorChatHostmounts.This does not change browser routing, MCP routing, Gateway protocols, timeline virtualization, or follow behavior.
Validation
Current
upstream/mainate9d571a9b39562d06d92e8212bfce0df31c2f7c1was merged without rewriting history. The complete closeout matrix was rerun at current PR head0b810b2f8dca801cabd996342f600a6c10cf8f19:git diff --check.\build.ps1dotnet test .\tests\OpenClaw.Shared.Tests\OpenClaw.Shared.Tests.csproj --no-restoredotnet test .\tests\OpenClaw.Tray.Tests\OpenClaw.Tray.Tests.csproj --no-restoredotnet build .\tests\OpenClaw.Tray.UITests\OpenClaw.Tray.UITests.csproj -c Debug -r win-x64 --no-restoreCategory!=AccessibilityCategory=AccessibilityNativeToolIdentityScreenshotProofTestswith composed PNG captureReal behavior proof
Current-head native screenshot
The image was captured at exact PR head
0b810b2f8dca801cabd996342f600a6c10cf8f19from the actual isolatedOpenClaw.Tray.WinUI.exeand ReactorChatHost. The fixture uses synthetic Chat data only. It does not access real chats, browser/profile data, credentials, or the desktop.The screenshot shows:
Bash, with localizedDone, localizedTool input, boundedpowershell -NoProfile -Command Get-ChildItem .\src, and synthetic output.Apply Patchwith localized status/input and safefile_path.Tool; its non-authoritative description is bounded and its command value is[redacted].Reproduction:
UI Automation proof manifest records the exact head, expanded row names, safe visible inputs, absent run ID/secret markers, and passing result. The PNG SHA-256 is
6FF9AB89F080024E93ED2099CCA228271EFD5988BDFD6FD7C8268303AE8DD4DD; the manifest SHA-256 is822611984CDEE2D38D33E7A39A98F83345323A01F6A3BBBB88160F7B037117AE. Both downloaded GitHub assets matched their local files byte-for-byte.The prior standalone
FunctionalHostControlcapture path crashed in Microsoft.UI.Xaml/combase. The final proof instead uses the actual isolated app plus the repository's existing in-processRenderTargetBitmapvisual-test capture after UI Automation expands the changed rows. No product behavior, virtualization, or safety boundary was weakened.Review
Independent adversarial review findings were fixed for title spoofing, terminal precedence, command-end activation, deterministic child ordering, run ID collisions, retained child state, hard user boundaries, cache generation, late child output, reconnect teardown, terminal metadata reuse, and cap-evicted running rows.
The unchanged tool-identity core retains its 92% clean independent assessment. The proof fixture and capture changes received a 99%-confidence independent review. The final combined architecture closeout received a separate high-confidence read-only review with no significant issues. It confirmed pure projection moved to
NativeToolProjector, provider state ownership stayed intact, screenshot orchestration leftChatPage, and both prior ClawSweeper architecture findings are addressed.The two final LOW findings were fixed: unusable item IDs now enter the ID-less fallback, and Reactor consumes the projector's canonical display-argument key order. Focused tests passed 5/5, and an independent read-only review found no significant issue.
Structured autoreview bundled commit
0b810b2f8dca801cabd996342f600a6c10cf8f19, but the isolated Codex engine exited with failure and returned no finding. No reviewer engine or model substitution was used.Residual proof gap
The bounded cap and chronological history behavior have deterministic unit coverage, but there is no practical runtime proof that exhaustively combines pathological maximum-cap churn with arbitrarily reordered flattened history from a real Gateway. The reducer and cache fail boundedly and preserve the newest retained state under tested cap and replay scenarios.