Repository navigation
fix(worker): stop preparing disabled live previews - #146896
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, 5:43 AM ET / 09:43 UTC. ClawSweeper reviewWhat this changesStops cloud workers from preparing assistant and tool previews after preview delivery is disabled, while preserving final outcome delivery. Merge readiness✅ Ready for maintainer review Keep open: the optimization remains absent from current main and the latest release. The patch preserves terminal delivery, and no actionable correctness or security findings were identified. Priority: P2 Review scores
Verification
How this fits togetherCloud workers send progress previews and authoritative transcripts back to the Gateway. This event subscriber prepares previews and records the final outcome, which is delivered after transcript settlement. flowchart TD
A[Agent session events] --> B{Final outcome event?}
B -->|No| C{Previews enabled?}
C -->|Yes| D[Prepare and enqueue preview]
C -->|No| E[Skip preview work]
D -->|Enqueue declined| E
B -->|Yes| F[Record final outcome]
F --> G[Wait for transcript settlement]
G --> H[Deliver terminal event]
Before mergeNone. Agent review detailsSecurityNone. PR surfaceSource +5, Tests +118. Total +123 across 2 files. View PR surface stats
Review metricsNone. Technical reviewBest possible solution: Keep preview preparation behind the existing delivery state while retaining independent terminal collection and transcript-before-terminal ordering. Do we have a high-confidence way to reproduce the issue? Yes, from source: decline one preview enqueue, then send assistant or tool events; current main still prepares their discarded payloads. Tests were inspected but not executed during this read-only review. Is this the best way to solve the issue? Yes. The subscriber guard uses the existing permanent preview-disable state and leaves the authoritative completion path intact, without adding another owner or configuration option. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 4de88fde4de2. LabelsLabel changes:
Label justifications:
EvidenceWhat I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
|
|
Merged via squash.
|
* refs/heads/temp/pr-146883: (159 commits) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) fix(ui): let slow dashboard downloads finish before recovery (#146881) ...
* refs/heads/temp/pr-146833: (43 commits) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) improve(infra): reduce scheduling work for session notice bursts (#146818) improve: prepare Gateway skill commands asynchronously (#146812) improve(agents): skip unused assistant delivery parsing (#146858) improve(ui): reuse date formatters across timestamp lists (#146789) fix(tests): isolate installer and Docker shell snippets (#146897) test(heartbeat): share explicit channel configuration fixtures (#146853) fix: retain conversation reply claims through write admission (#146866) perf(sessions): bound history reads and stabilize cursor paging (#146770) ...
* temp/pr-146802: (51 commits) improve: reduce worktree filesystem stalls and archive syncs (#146906) fix(ui): avoid extra chat rail work while replies stream (#146883) improve(ui): speed up populated Usage timelines (#146947) test(gateway): retain auth recovery failure diagnostics (#146925) fix(tests): create private temporary home directories (#146931) fix(backup): preserve discovery under concurrent state writes (#146912) fix: keep queued deliveries in their original state directory (#146917) fix(discord): settle voice waveform work before releasing input (#146885) fix(memory): preserve newer indexes and disclose automatic rebuild costs (#146908) fix: retain route ownership while discovering conversations (#146927) refactor: reuse plugin fixture shell runner (#146920) fix(worker): stop preparing disabled live previews (#146896) fix(runtime): support Bun across tooling suite (#146807) chore(i18n): refresh native locales (#146924) perf(secrets): limit expiry metadata to transient credentials (#146882) fix(ui): preserve queued refreshes during session discovery (#146535) test(ui): wait for quiet scrolling and close named file tabs (#146836) fix(ui): prevent Usage hour filters from freezing during DST (#146919) test(ui): share browser page cleanup across layout fixtures (#146805) ci: balance complete PR runtime test groups (#146916) ...
What Problem This Solves
Fixes an issue where cloud workers keep scanning assistant snapshots and redacting tool diagnostics after live preview delivery has stopped, spending work on previews that will never reach the user.
Why This Change Was Made
Stop preview preparation at the worker event subscriber once the live client declines an enqueue. Keep the existing enqueue guard for an event that disables delivery partway through processing. Terminal events still record the final outcome and are emitted only after the authoritative transcript flush; cancellation and cleanup-failure precedence stay unchanged.
User Impact
Cloud workers avoid unnecessary preview work after a preview queue degrades. Final results and errors retain their durable delivery path. No configuration change is required.
Evidence
4d4fb99d477e58155b2930118127337590e27be1.git diff --checkpass. Production change: five added lines (three-line admission guard and its ownership comment); tests: +132/-14.