Repository navigation
improve: reduce repeated chat message identity work - #147210
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 2:00 PM ET / 18:00 UTC (Revision 2). ClawSweeper reviewWhat this changesThe shared chat identity reader skips run-ID work for messages without stream items and removes redundant metadata enumeration. Merge readiness✅ Ready for maintainer review This remains a useful, bounded optimization absent from the fetched main and latest release. No actionable correctness or security findings remain; the refreshed source matches the earlier reviewed version. Priority: P3 Review scores
Verification
How this fits togetherGateway clients combine persisted transcript rows with live chat events. The shared identity reader supplies the message, run, and stream-item identities used to reconcile those inputs for terminal and browser displays. flowchart LR
A[Persisted transcript rows] --> C[Shared identity reader]
B[Live chat events] --> C
C --> D{Stream item present?}
D -->|Yes| E[Resolve stream identity]
D -->|No| F[Skip stream identity work]
E --> G[Reconcile chat messages]
F --> G
G --> H[Terminal and browser displays]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource -2. Total -2 across 1 file. View PR surface stats
Review metricsNone. Root-cause clusterRelationship: Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Technical reviewBest possible solution: Preserve one shared identity owner and existing reconciliation semantics while eliminating unnecessary per-message work without adding cache state. Do we have a high-confidence way to reproduce the issue? Not applicable as a functional bug reproduction: source confirms redundant work, and the PR reports bounded before/after measurements; this review did not execute benchmarks. Is this the best way to solve the issue? Yes. Removing redundant work at the shared reader is a narrow solution that preserves existing callers, identity precedence, and storage contracts. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 201f11afefdb. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (1 earlier review cycle)
|
e1ad1ab to
ff4668f
Compare
|
Merged via squash.
|
* commit '2d87daf04b78992382299d552f15ac84a86a23ed': (1815 commits) fix(ui): distinguish tool activity with semantic icons (#147207) fix(linux): recover completed Quick Chat replies without resending (#146048) feat(desktop): unify Tauri title bar and window controls (#147097) refactor(test): share plugin fixture server shims (#147225) perf(gateway): defer worker workspace execution imports (#143496) fix(gateway): post-ack webhook work fails with "Async work scope is closed" (#144801) refactor(scripts): centralize upgrade survivor version floors (#146975) fix(ci): check publication registries before FRV fanout (#147184) fix(qa): align system-agent delegation with channel contracts (#145905) improve: reduce repeated chat message identity work (#147210) fix(channels): remove stale pre-tool previews from Slack and Telegram (#147106) fix: keep catalog discovery scoped and execution lazy (#147159) fix: serialize reclamation worker shutdown with foreground writes (#147178) test(sessions): cover abrupt committed transcript recovery (#143984) fix: stop transcript storms during context overflow recovery (#147202) fix: reduce CPU overhead for small history and usage reads (#147205) fix: resume tasks after tools finish and the model times out (#147203) refactor(scripts): share SQLite reliability message waits (#146900) feat(exec): configure approval reviewer thinking and fastMode (#147192) test: remove redundant Bonjour module headers (#146981) ...
Closes #147208
What Problem This Solves
Persisted chat messages repeatedly resolve identity information that ordinary transcript rows do not need.
User Impact
Terminal clients spend less time reconciling durable assistant messages and mixed history. Message contents, ordering, run ownership, and commentary behavior stay the same; no configuration or migration is required. The measured absolute savings are small, and this does not establish faster whole-UI rendering.
Why This Change Was Made
Return immediately when an assistant has no stream item ID, and remove a metadata-enumerating fallback already covered by the preceding run-identity branches for Gateway/transcript JSON. Both changes belong in the shared identity reader. There is no new cache or invalidation lifecycle.
Evidence
Ordinary 200-row user batches were mixed on Node 26 (0.62 → 0.68 ms; the two comparisons moved in opposite directions), and improved on Node 24 (0.65 → 0.52 ms). Empty, first-message, one-row, duplicate, and wrong-session controls remain in the evidence; sub-millisecond measurements do not establish broad application speedups. Process CPU counters were too coarse for these batches and are not used for claims.
Real-browser synthetic-Gateway flows matched all 61 state/render snapshots per variant in both orders. The first timing comparison was mixed; another task's tests invalidated the reverse timing run. Both versions emitted existing native ResizeObserver notifications, so this is parity evidence, not clean-browser-diagnostic or UI-speed evidence.
All 27 other selected changed-code checks passed. The dead-export scan failed on two untouched script exports (
canonicalProviderNameandlistPackagedStaticExtensionAssetOutputs); running the same scan on untouched base2700b9e34e6f79afba980dac67508af4c6eb707ereproduced both findings. No baseline, ignore, or skip exception was added.The branch was refreshed onto the upstream CI integration repair in #147203 after the first run caught an unrelated Workboard test cleanup error. The final diff remains the same one-file identity optimization, with identical measured source bytes. Renewed independent P0–P2 review was clean; required CI passed for refreshed head ff4668f (run 34772765411).