Repository navigation
perf: prepare worker trajectory payloads only for recorded events - #138086
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs changes before merge. Reviewed September 4, 2026, 10:38 AM ET / 14:38 UTC. ClawSweeper reviewWhat this changesThe PR prepares worker trajectory diagnostic payloads only for event phases that are recorded, while testing that live-listener mutation cannot change the stored diagnostic result. Merge readiness⛔ Needs changes before merge - 1 item remains Keep this maintainer-authored PR open. The patch correctly removes unnecessary diagnostic payload preparation while preserving live delivery, trajectory rows, terminal handling, and SQLite flush behavior; the protected maintainer label still requires human handling before merge. Priority: P3 Review scores
Verification
How this fits togetherWorker live events are delivered to runtime listeners and separately projected into trajectory diagnostics. The projection filters recordable phases, sanitizes an independent payload, and writes the resulting rows to SQLite-backed trajectory storage. flowchart LR
A[Worker live event] --> B[Live event receiver]
B --> C[Runtime listener delivery]
B --> D[Trajectory projection]
D --> E{Recordable phase?}
E -->|Yes| F[Prepared diagnostic payload]
F --> G[Trajectory recorder]
E -->|No| H[No trajectory preparation]
C --> I[Runtime consumers]
Before merge
Agent review detailsSecurityNone. PR surfaceSource 0, Tests +14. Total +14 across 2 files. View PR surface stats
Review metrics
Technical reviewBest possible solution: Land the net-neutral projection refactor after the protected maintainer review and exact-head required checks; it keeps the recorder as the sole owner of trajectory preparation without altering the live-event path. Do we have a high-confidence way to reproduce the issue? Yes, at source level: the receiver always sends a prepared live payload, then current main prepares a second payload even for phases the trajectory projection intentionally does not store. Is this the best way to solve the issue? Yes. The existing trajectory projection owns the recordability decision, so moving its existing preparation calls into record-producing branches is the narrowest maintainable fix. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 523221e3767f. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (4 earlier review cycles)
|
1641f26 to
c6b84ab
Compare
sylvesterkaczmarek
left a comment
There was a problem hiding this comment.
Good boundary cleanup. Preparing the diagnostic copy only for recorded phases removes unused work while the separate live-listener copy still prevents mutation from contaminating persisted trajectory rows.
c6b84ab to
9a93b70
Compare
|
Merged via squash.
|
…9-prep * commit '407a8f453c0f0306af1ddc0aafa8697c1d49a9e7': (312 commits) perf(ui): coalesce automation event refreshes (#138065) fix: reject incomplete Skill Workshop directory reads (#138082) test(ui): decouple rendering checks from generated wording (#138283) perf: avoid temporary entries in bounded JSON traversal (#138017) fix(irc): render complete messages before splitting (#138328) perf: prepare worker trajectory payloads only for recorded events (#138086) fix(mcp): paginated listings no longer time out after a forward clock step (#137206) fix(codex): page native transcripts and bound UI previews (#136282) feat(gateway): apply more settings without restarting (#138112) fix(docs): preserve mirrored ClawHub maturity links (#138241) fix(test): own UI animation and legacy database setup (#138296) fix(tts): preserve literal directives in Markdown code (#138319) fix: load chat widgets behind authenticated gateways (#138074) chore(ui): cover native approval finalization (#137259) fix(cron): cancel conditions before main-session handoff (#138313) fix(backup): preserve text after embedded NUL characters (#138327) fix(android): align composer control sheets (#137442) fix(ci): wait for replacement PR runs instead of stale failures (#138307) fix(sessions): keep Gateway responsive with long transcripts (#138094) fix(computer): map window inputs to delivered image coordinates (#138271) ... # Conflicts: # scripts/release-check.ts # test/release-check.test.ts
Worker live events prepared a second diagnostic payload even for phases the trajectory does not record. Move that preparation into the existing recording branches and remove the recorded flag, while retaining the separate live-delivery copy and unchanged stored rows/flush behavior.
Production LOC is unchanged (+17/−17); tests add 14 lines to protect live-listener versus stored-result independence. The fixed 18-case actual projection/SQLite corpus preserves all 16 stored rows, metadata, order and flush counts, while skipped phases remove one observed structuredClone call each. The full receiver suite passes 40 tests on both original and candidate. No timing or retained-memory claim; real deployed-worker proof is outside this local synthetic-event scope. Managed P0–P2 review is scoped-clean, and the full canonical changed-file gate passed.