Skip to content

Keep Images refreshing a job that reaches approval before the submit reply - #266

Merged
BunsDev merged 1 commit into
mainfrom
images-revision-queue
Oct 16, 2026
Merged

BunsDev merged 1 commit into
mainfrom
images-revision-queue

Conversation

@BunsDev

@BunsDev BunsDev commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Fixes the images-plugins.spec.ts:91 flake ("Plugins binds an offline image skill…"). It failed at line 151 in CI runs 38856460357 (#255) and 38850091541 (#263).

Cause

This is a product bug in the Images renderer. The job queue is fine.

ImagesView's live-update effect depended on jobId, and submit() sets jobId to the new job. React therefore tore down the subscription and cleared its pending 100 ms refresh. If main took the job from queued to waiting-for-approval before React committed that render, every change event had already been folded into the cleared refresh. A job waiting for approval sends no further events. The list kept the "queued" it had read right after submitting, and the open transcript kept the previous job's items, with no Approve button. Only a window focus change recovered it.

Evidence

  • Both CI snapshots show the same state: the revision job "queued", with the first job's transcript ("Decision: yes") rendered under it. That transcript can only survive if no scheduled refresh ran after jobId changed during the 15 s wait. The traces show CI was not slow: job 1 succeeded about 110 ms after Approve, and Generate revision was clicked about 250 ms later.
  • I added local probe logging in both main and the renderer. The effect re-ran 7–33 ms after the submit. Main reached approval only 90–330 ms after it, because every store write fsyncs on this busy disk.
  • I stubbed fs.fsyncSync in main to mimic a fast CI disk. Main then reached approval in 5–9 ms, ahead of React's effect at 11–16 ms. The existing spec failed in 8 of 10 runs with the exact CI snapshot. With this change it passed 10 of 10.

Change

  • The subscription now lives as long as Images is shown ([active]). When it fires, it reads the current refresh and jobId from refs.
  • Submitting points the subscription at the new job right away and clears the previous job's transcript.
  • Showing Images again reloads the open job's transcript, because events are not observed while Images is hidden.
  • New e2e test: after the renderer sends the submission, it pauses the renderer over CDP (debugger). It resumes once jobs.json says waiting-for-approval. The new job's Approve must then appear without reopening Execution details. It failed 3 of 3 runs before the fix and passes after.
  • docs/status.md: one bullet under "On main, unreleased".

Tests

  • pnpm build && pnpm test: all packages pass (desktop: 1428 pass, 16 skipped, 0 fail).
  • playwright test e2e/images-plugins.spec.ts --repeat-each 5: 35 passed.
  • Full playwright test: 312 passed, 3 skipped.

Coven-Harness: Claude Code / claude-opus-5-5

…reply

The Images live-update subscription depended on the expanded job id. Submitting a job
sets that id, so React tore the subscription down and cleared its pending 100 ms refresh.
When main took the new job from queued to waiting-for-approval before React committed
that render, every change event had already been folded into the cleared refresh. No
further event comes while a job waits for approval, so the list kept the "queued" it read
right after submitting, and the open transcript kept the previous job's items with no
Approve button, until the window regained focus.

The job queue is not involved. The two failing CI runs (38856460357 for #255 and
38850091541 for #263) show the same snapshot: the revision job "queued" with the first
job's transcript, "Decision: yes", under it. A stale transcript means no refresh fired
after the job id changed in the 15 s wait. Their traces show the first job succeeding
about 110 ms after Approve and the revision click 250 ms later, so CI was not slow.

Probe logs locally: the effect re-ran 7-33 ms after the submit, and main reached
approval 90-330 ms after it because each store write fsyncs on a busy disk. With fsync
stubbed in main, as on a fast CI disk, main reached approval in 5-9 ms, before React's
effect at 11-16 ms. The existing spec then failed 8 of 10 runs with the CI snapshot.
With this change it passed 10 of 10.

The subscription now lives for as long as Images is shown. It reads the current refresh
and job id from refs when it fires. Submitting points it at the new job immediately and
clears the old transcript. Showing Images again reloads the open job's transcript,
because events are not observed while it is hidden.

New e2e test: it pauses the renderer through CDP right after it sends the submission
and resumes once jobs.json says waiting-for-approval. The new job's Approve button must
then appear without reopening Execution details. It failed 3 of 3 runs before the
change and passes after it.

Coven-Harness: Claude Code / claude-opus-5-5
@vercel

vercel Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
modex Ready Ready Preview Oct 16, 2026 6:43am UTC

Request Review

@github-code-quality

Copy link
Copy Markdown

Code coverage overview

Languages: TypeScript

TypeScript / code-coverage-agent

main 00e1e9d images-revision-queu... 8c9e44f +/-
61% 61% 0%

ℹ️ Calculations represent line coverage. Results may change as calculations are updated.

@BunsDev
BunsDev merged commit 434a86b into main Oct 16, 2026
13 checks passed
@BunsDev
BunsDev deleted the images-revision-queue branch October 16, 2026 07:04
BunsDev added a commit that referenced this pull request Oct 19, 2026
… and the routines spec (#310)

v0.2.0 was published on 2026-10-18 (23:14Z) from the signed tag on 01b1b8a. This
follows Val's status layout (#290):

- Shipped gains a v0.2.0 row linking its release and its review.
- The 13 "On main, unreleased" items move unchanged to a new "Status summary"
  at the end of the v0.2.0 review, along with the old In flight entry. Each one
  was introduced by a commit in the tag (#248, #253, #254, #257 to #261, #263,
  #264, #266, #267, #269). The CF slices and #283's Markdown parser came after
  the tag, so they stay.
- In flight keeps a short follow-ups entry for the gates no receipt records yet:
  the independent download checks, the banner upgrade on the release Mac, and
  the Companion 0.2.0 (7) TestFlight upload.
- The routines spec and the README now say Phase 1, and most of Phase 0, ship
  from v0.2.0.

Unchanged: the website's static fallback (apps/site/release.json) and the
release evidence, which stay with the release owner. Claimed on #290.

Coven-Harness: Claude Code / claude-opus-5-5

This branch was successfully deployed

1 active deployment
Preview — 8c9e44f0 Deployed Oct 16, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant