Repository navigation
fix(app)/test(evals): attachment upload shows its uploading state and the composer recovers (attachment-upload-loading-state) - #4811
Conversation
…immediately A freshly created session had no cached snapshot, so deriveSessionRenderModel reported "switching" while the first snapshot round trip ran and the composer disabled Run task. On Daytona that window is ~0.9 s and a click or Enter inside it was silently dropped with the draft intact. Seed the snapshot cache from the create response (stale, so the real fetch still runs as a background refresh).
…ad of wedging A prompt_async answered with 5xx/408 is an uncertain admission (#4635), but the hold it created could never end: the acceptance check treated absence as no evidence, Stop refused while the admission was unknown, and the failure body was dropped, so the person saw a paused composer with no explanation. - Keep the settled response body on PromptAdmissionUnknownError and show it as the session error card right away; the hold still prevents any resend. - readPromptAdmission: after the exact-message GET misses, list the idle conversation; when native lists it without the message the POST is settled and did not admit, so the drain receives admission_rejected and halts like any definite failure (explicit retry only, never an automatic resend). - On release the pending row is removed and the submitted composer is kept as an unsent message to restore; on confirmed acceptance the stale failure card is cleared.
Lexical keeps one empty paragraph in an empty editor, which innerText reports
as "\n". readComposerState now drops that trailing line break so draftText
matches what the person sees; user.see("composer", { text }) already trimmed.
…o e2e/new-session-route-after-reload
…ace-engine-upgrade Since #4577 the sidebar New session controls open the workspace's empty New task composer at once and the session is created by the first send, so waiting for a ses_ route on click never resolves. Re-express the three sidebar steps: the click lands on the empty New task route without a session surface and a prompt-ready composer; the send must land in a session no earlier turn used (same claim shape as bench-openwork-app-v1 in #4738). Palette steps still create their session up front.
The empty New task composer creates its session on submit and hands the prompt over through a scoped auto-send mark. The mark was keyed with the workspace's default endpoint URL (always /opencode), while the session surface under OpenCode v2 routing owns the session as /opencode2, so the lookup missed and the prompt silently vanished: the person landed on an empty new session. Key the mark with the endpoint that created the session (createRouteSessionWithEndpoint), which is the URL the surface will own it under.
The surface mounts under the v1 URL before chat routing resolves; the owned read 404s, parks for its retry, and the routing flip changes the owner while it is in flight. The read rejects with 'Session snapshot owner changed' and the (workspace, session) query never refetches, so the transcript stays empty.
The snapshot query is keyed on (workspace, session) with retry off on the desktop loopback path. When chat routing resolves to /opencode2 after boot (or the draft scope resolves once identity verifies) while the owned read is in flight, the read rejects with 'Session snapshot owner changed' and nothing refetched, leaving the error card over an empty transcript. Cancel the doomed read and refetch under the new owner; a bare invalidate would only join the in-flight promise because the first load has no data yet.
…ad' into e2e/v2-reload-owner-change-race
… into e2e/attachment-upload-loading-state
|
The latest updates on your projects. Learn more about Vercel for GitHub.
3 Skipped Deployments
|
Warden review summary — ClearNative findings: 0. Blocking policy matches before consolidation: 0. Full finding text remains in Warden's native checks and review threads. This comment retains only native IDs, severity, skill attribution, and safe locations. Analysis run Reported trigger coverage (not proof of complete repository or context coverage): diff-security-review (20985 ms), confidentiality-review (7973 ms), desktop-den-sync-review (15091 ms). Blockers
Advisories
Needs recheck
Observed review-thread metrics
Thread states are read-only collection snapshots. These metrics are neither lifetime totals nor exact resolution times, and this summary is not clearance authority. |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (2d1209665b93248491f1f5cb1951806aa88de878). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
|
Passed · 12/12 tests · 18/18 assertions · 8 images Commit |
Deploying openwork with
|
| Latest commit: |
7ee5951
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://2267ffc3.openwork.pages.dev |
| Branch Preview URL: | https://e2e-attachment-upload-loadin.openwork.pages.dev |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (7ee59513f6e69d91867cd31e77bafbd17001ce35). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Resync onto
|
| test | result |
|---|---|
sending an image in existing chat immediately moves it into the thread while upload is pending |
✓ passed (293.5 s) — including the post-reload() transcript read; no "owner changed" text |
sending an image in new task immediately moves it into the thread while upload is pending |
× failed at spec line 125: Timed out waiting for one decoded thread preview and cleared composer while upload is held after 30000ms |
"passed":1,"failed":1,"skipped":0. The failure screenshot shows the New task composer still holding Describe the attached image. + the image chip after Run task — the send never left the composer. This is the New-task (fresh session) send path, which on this stack is broken by dev's #4838 (sendDraft awaits ensureFullSnapshot() → ensureQueryData(snapshotKey), cancelled on the new ses_… route → CancelledError) — the same failure AI reproduced 2/2 on #4781 752240264 and I reproduced on #4797 152974edb plus a control at 752240264 in workspace-engine-upgrade step 2. The existing-chat test passes because the snapshot is already cached there. Attribution for this spec is a strong hypothesis, not yet a clean control: the previous green (this PR's 2d1209665) predates #4838, and the dev nightly cited in the body (88b1eec4a) also predates it. I will run this spec on 752240264 (no #4797 fix) as a control and append the result here.
Control result (appended): OPENWORK_EVAL_REF=7522402647a1715c7bc693ed6baa218beb2f84f7 pnpm evals:e2e attachment-upload-loading-state --daytona on origin/e2e/new-session-route-after-reload (dev + #4757 + #4781, without #4797's fix; source verified 752240264…) → identical "passed":1,"failed":1: existing-chat ✓ (260.5 s), new task × at the same spec line 125 (Timed out waiting for one decoded thread preview and cleared composer while upload is held after 30000ms). So the red New-task case is pre-existing on the #4781 stack and not introduced by #4797's owner-flip effect; attribute to dev #4838's sendDraft → ensureFullSnapshot() on the fresh-session send path (see #4781 / #4797 comments). All four control sandboxes deleted by the runner.
|
Status: CONFLICTING again after dev A fresh |
Resynced — merge commit
|
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (b1fe66fdd34a0afaf80c897e816ecde13a7d40ad). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
TL;DR
No code of its own. This branch is
origin/dev+origin/e2e/v2-reload-owner-change-race(#4797, which carries #4781 and #4757) via merge commit2d1209665. With that stack merged,attachment-upload-loading-stateis green on Daytona (2/2). Merge #4797's stack; then this PR has an empty diff and should be closed, not merged. It exists to record the Cluster 10 verdict for this spec.Root cause (triage:
reports/e2e-red-2026-09-09/triage.md§Cluster 10, bulletattachment-upload-loading-state)The triage bullet conflated three things; after re-reading the evidence against the current spec they resolve as:
"attachment uploading state observed: false" +
New tasknot found — already fixed ondev, stale evidence. Those messages come from the pre-fix(chat): show sent attachments immediately and preserve reading position #4687 spec (attaching an image in … retains the draft until the upload is ready,label: "attachment uploading state observed",{ role: "button", label: /^New task$/ }). The nightly that produced them (daytona-e2e.ymlrun 34387590503, Sep 9 18:12Z at52a028817) ran 24 min before10d589b43(fix(chat): show sent attachments immediately and preserve reading position #4687) landed, and the triage runner's worktree (ea1e9546e) still had that old spec. fix(chat): show sent attachments immediately and preserve reading position #4687 changed the product (send moves attachments into the thread immediately) and rewrote the spec's claim; feat(composer): click a draft image attachment to view it full-size #4690 (df3b1670b) updated the button to"New session". On currentdevthe "new task" test — which clicksNew sessionand asserts__attachmentUploadingSeen === true— passes (nightly 34444536682 at88b1eec4a: 1 passed / 1 failed). So the uploading indicator neither moved nor regressed; the claim was already re-expressed upstream. No bisect between fix(composer): wait for image readiness before showing sent text #4652/fix(chat): show sent attachments immediately and preserve reading position #4687 was needed.The live failure on
devis the reload owner-flip race, owned by fix(app): keep a v2 session's snapshot query alive across the routing-status flip on reload #4797. Nightly 34444536682 (88b1eec4a, spec = current): the "existing chat" test times out at spec line 165user.see({ text: "pasted-recording.mp4" })right afteruser.reload(); on-screen dump showsSession snapshot owner changed before the local read completed.over an empty transcript with the draftContinue after upload.correctly retained. That is exactly fix(app): keep a v2 session's snapshot query alive across the routing-status flip on reload #4797's root cause (readOwnedSnapshotTargetrejects whensessionOwnerflips under an unchanged query key and nothing refetches). It is intermittent (only one of the two tests hit it in that nightly; fix(app): keep a v2 session's snapshot query alive across the routing-status flip on reload #4797 measured ~1 in 3), which is why the "new task" test passed. Not the Cluster 1 send gate (fix(app): keep a brand-new session sendable while its first snapshot loads #4757 B): both tests get past the send and pastattachment upload loading proof; the failure is post-reload.Local 2 ms 403 (triage author's Mac) — runner environment, not chased, as briefed.
startManualApprovalServer(evals/worlds/chat.ts:516) spawns the standalone server withenv: { ...process.env, OPENWORK_RUNTIME_DB: <fresh tmp> }. The runtime DB override is complete (apps/server/src/runtime-db.ts:36returns the override before consulting any config dir), so the persisted-managed-policy403 policy_unavailablepath is isolated, and a Den session can only arrive via host-tokenPUT /den-session, not env. Remaining inherited env that can still produce an instant 403 onPOST /workspace/:id/files/contentbeforerequireApprovalruns:OPENWORK_TOKEN_STORE/XDG_CONFIG_HOME(token store →requireClientScope→403 forbiddenif the host'stokens.jsongivesowt_spec_tokena viewer scope). AlsoOPENWORK_DEV_MODEis inherited. Noted only; the world could additionally pinOPENWORK_TOKEN_STOREto the same tmp dir. In this run the write gate behaved (writeElapsedMs ≥ 2900assertion passed in both tests).What changed
Nothing besides the stack merge (
2d1209665). Cross-check on the merged tree:bun test --isolate tests/session-snapshot-owner-flip.test.tsx tests/opencode-session-native.test.ts→ 28 pass / 0 fail;pnpm --filter app typecheckclean.Proof
OPENWORK_EVAL_REF=2d1209665b93248491f1f5cb1951806aa88de878 pnpm evals:e2e attachment-upload-loading-state --daytona(single spec, sandbox printedsource verified 2d1209665b93248491f1f5cb1951806aa88de878for both tests):Passed — 2 passed / 0 failed / 0 skipped, placement
daytona. Noowner changedtext anywhere in the run log. Clean control = nightly 34444536682 onorigin/dev@88b1eec4a(1 failed / 1 passed, "owner changed" on screen). All four sandboxes from this run (…-46948-…) were removed by the runner; verified withdaytona sandbox list.Verdict is stacked: it is only valid together with #4797 → #4781 → #4757.
Noticed, not touched
evals/worlds/chat.tsstartManualApprovalServercould isolateOPENWORK_TOKEN_STOREalongsideOPENWORK_RUNTIME_DB(see 3 above) — cheap hardening, out of this brief's scope.CLI v0.210.0vsAPI v0.213.0); harmless for the run.