Repository navigation
fix(placement): retry a new thread's uncertain launch as its original operation - #71
Conversation
… operation (held) PR70-R1-F2, HELD after two failed fixes; not for merge. The included regression "retries an unconfirmed launch as its original operation..." fails on purpose: when commitPendingLaunchPayload cannot commit, it leaves the attachment references in memory, and a later retry treats them as committed and launches with references never stored before the effect. What this carries: a new-thread draft launch records its command id, message id, request (text, attachment content identity by SHA-256 or upload id, model, modes, project, workspace) and the exact attachment references it sent, and commits them before launching. Any launch error keeps that operation (a typed error can follow an accepted launch); a retry resends exactly it, a changed request is refused while it is pending, and settlement drops only an unedited restored copy. A post-claim launch failure seam proves the same command recovers the accepted launch. Model: claude-opus-5-5 Task: CLO-866 universal native thread placement, PR70-R1-F2 original operation identity for web/desktop composer retries Agent: Claude Code in T3 Code, existing CLO-866 source owner thread (Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PR70-R1-F2, caller-authorized continuation C1 (global attempt 3) on the held b8da745. A renderer that died after binding a launch, before preparing its attachments, left the operation stored without references. A retry whose reference commit failed then kept those unsaved references in memory, and a later retry whose binding write storage dropped silently still passed the check, which compared only the bound thread and command id. It skipped the reference commit and launched with references storage never held. The binding check now compares the whole stored operation, references included, and a failed reference commit puts back what each draft had. The regression follows the composer's actual order and failure restore, and checks at every launch that storage already held the references sent. The held commit's last silent-drop assertion was not evidence of an unsafe launch: its binding write was healthy and had already stored those references, and its helper skipped the composer's failure restore. The helper now follows the composer, and that case remains as a check of a dropped reference write. ARC also runs the composer send logic tests. Model: claude-opus-5-5 Task: CLO-866 universal native thread placement, PR70-R1-F2 original operation identity for web/desktop composer retries Agent: Claude Code in T3 Code, existing CLO-866 source owner thread (Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R1 coordination — sole normal independent reviewI am claiming the single normal R1 for PR 71 at head Reviewer: GPT-6 Astra Pro, current ChatGPT subagent This review covers persistence, exact replay, hook wiring, content identity and settlement. The author’s existing CI monitor retains CI ownership. I will return an exact-head technical result with evidence and limits; this coordination comment is not human approval or merge authorization. |
RESULTRESULT: CLO-866 PR70-R1-F2 (original operation identity for web/desktop composer retries) is ready for its one normal R1. It is not merged.
|
PR71-R1 — changes requiredSole normal independent R1, exact head PR71-R1-F1 — P1: an unchanged uploaded file becomes a different request after reload
Concrete sequence: attach a file, let its upload finish, send, receive an uncertain launch error before the thread arrives, let the restored draft persist, then reload and retry unchanged. The pending request contains Keep the attachment's content identity stable through the actual persistence/hydration path, while retaining detection of different bytes with the same metadata. A focused regression should pass the same uploaded file through the real store reload and the real identity decision. PR71-R1-F2 — P1: a crash before failure restoration loses the replayable composer payloadThe hook binds the operation and then clears the composer; after attachment preparation it commits the attachment references. That commit flushes the current store, which already contains the cleared composer. A renderer crash after this flush, before the live failure handler restores its in-memory snapshot, therefore reloads a pending operation with an empty composer. The pending record is insufficient to reconstruct the original send: its request omits the message context, and inline attachment records deliberately discard their bytes. Hydration restores only the stored draft and pending fields; it does not restore/replay the pending send. With no accepted thread yet available, the ordinary send path exits for an empty composer. Even manually recovering its text cannot reconstruct the missing context or inline bytes. This is a production crash-recovery gap, not just missing browser coverage. The added store test supplies retry text as an external argument and manually restores the crash draft and prompt, so it does not establish that the actual reload path can perform those steps. Persist enough of the original request to replay it independently of the cleared/editable composer, and wire recovery through the existing owners. Verify a reload from the actual bytes committed at this point without injecting the lost snapshot or text from the test. PR71-R1-F3 — P1: edits made during the new attachment hash wait are cleared without being sentThe outgoing snapshot is captured at lines 794–806, then the new code awaits attachment reads and SHA-256. The baseline used to detect preparation edits is captured only after that await. The composer remains editable during send. If the user edits the text or attachments while a large file is being read/hashed, the earlier outgoing snapshot still contains the original content, but Capture the comparison baseline before the first asynchronous attachment read and check it before clearing/dispatching. A bounded hook regression can hold the attachment read pending, edit the live composer, then release it and verify the edit is retained or the send is stopped. Verification and limits
Technical disposition: changes required. This is neither human approval nor merge authorization. Focused continuation of the same R1 at
|
BLOCKERBLOCKER: PR71 review findings, repair attempt 4 failed (stopped, no attempt 5)Scope: the three P1 findings from the PR71 independent review (#71 (comment)). They are retained under the original composer-retry identity bug (CLO-866 / PR70-R1-F2).
This was the single authorized global attempt 4 (caller disposition C2). PR71 head is unchanged: Held code, not for merge: branch Reproduction on the held PR71 head (red twice)
What attempt 4 changed
Verification: FAILED
Root cause of the failure: hydration ( Possible fix, NOT applied: compute the signature on the hydration-normalized draft, both when marking the restored copy and when deciding. For example, sign Repair records (machine-local)
Needed: caller dispositionPer C2, nothing further runs automatically. There is no attempt 5, the bug is not reset or renamed, and the scope is not widened. The options:
What remains waits on PR71 acceptance: native admission, mobile, schedule placement and the dispatcher. Limits: source-only. No browser run, no host deployment, no provider or model calls, and no Crown access. The secret scan was not performed. The body contains no secrets. Model: claude-opus-5-5 🤖 Generated with Claude Code |
STARTSTART: global attempt 5 under caller disposition C3 (stable intent Model: claude-opus-5-5 |
BLOCKERBLOCKER: PR71 review findings, repair attempt 5 verification failed (stopped, no attempt 6)Scope: caller disposition C3 ( PR71 head is unchanged:
Baseline reproduction (before any production edit; held tree, red twice)
What attempt 5 changed
Checks before verification: the first two lint runs failed (an overlong comment, then an accumulating spread; both fixed); the final lint run is clean. Format and the web typecheck passed. Verification
|
STARTSTART: global attempt 6 under caller disposition C4 (parent-relayed; source https://linear.app/closura/issue/CLO-866#comment-07ee9337-75fc-4aa7-b024-8241199cbb61). Same PR71 findings F1/F2/F3 under CLO-866/PR70-R1-F2. PR head Model: claude-opus-5-5 |
A draft's pending launch could not always be resent after a reload or an uncertain failure: the restored-copy signature drifted when hydration added inline file links, a just-attached image depended on background saving that may not have finished, a file whose first upload failed came back without the upload its send made (so Send stayed blocked on "attach again"), the composer was cleared before the turn was stored, and a launch bound but not yet sent lost its identity. The launch is now bound with the whole composer it was sent from, image bytes read at send time, and its turn is committed together with the uploads its files went out as (matched by attachment id, in preparation order), verified as one stored operation before the composer clears or the launch goes out; a failed or dropped write restores the prior operation. The signature reads the prompt as a reload shows it; recovery and a failure restore give the draft the sent attachments it lacks. An unchanged resend keeps the original operation, turn or not; a change waits while the launch may have gone out, and otherwise starts afresh on the same machine and thread. ARC CI now also runs chatViewSend and composerImagePersistence. Model: claude-opus-5-5 Task: CLO-866 universal native thread placement, PR70-R1-F2 / PR71-R1-F1..F3 original operation identity for web/desktop composer retries (caller disposition C4, global attempt 6) Agent: Claude Code in T3 Code, existing CLO-866 source owner thread (Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RESULTRESULT: PR71 review findings F1/F2/F3, attempt 6 (caller disposition C4) verified and publishedPR71 head:
Baseline (held attempt-5 tree, before any production edit; red twice)Repro file (not committed): sha256
Change
Verification
Records (machine-local)
Not verified: no browser or desktop run, and no runtime rollout. Source acceptance is separate from installed builds and hosts. The secret scan was not performed; the body contains no secrets. Next: the same R1 reviewer closes only F1/F2/F3 at this exact head, and CI is verified, before any ordinary merge against the expected head. Model: claude-opus-5-5 🤖 Generated with Claude Code |
STARTSTART: global attempt 7 under caller disposition C5 (parent-relayed; source https://linear.app/closura/issue/CLO-866#comment-fadb9761-b74d-4d5a-b3a5-42d817a6daf9). Scope: only the remaining PR71-R1-F2 residual, where pre-launch failure cleanup drops a successfully bound first operation. F1 and F3 stay closed. PR head Model: claude-opus-5-5 |
BLOCKERBLOCKER: PR71-R1-F2 residual, attempt 7 (caller disposition C5) verification failed; stopped, no attempt 8Scope: only the F2 residual, where pre-launch failure cleanup drops a successfully bound first operation. F1 and F3 stay closed at PR71 head is unchanged:
Baseline (exact
|
STARTSTART: global attempt 8 under caller disposition C6 (stable intent Model: claude-opus-5-5 |
… failed send A first send whose binding was stored but whose turn could not be stored lost its operation in the failure cleanup, which restored the launch pending before (none), and a composer the send never cleared was not marked as that launch's copy; sent again unchanged, it became a new operation. Separately, a draft write storage dropped without saying so still became the tab's cross-tab merge baseline, so its next write kept the stale stored text over the user's edit. The cleanup now keeps the launch whose binding storage held, and marks the uncleared composer as its copy only when this send's own binding committed and the composer still equals what that launch sent; the hook and tests share these helpers. Draft publication advances the merge baseline only when the exact bytes are read back; a write that was not read back is kept unconfirmed, and serialization treats storage holding exactly those bytes as this tab's own write before choosing its next baseline. Model: claude-opus-5-5 Task: CLO-866 universal native thread placement, PR70-R1-F2 / PR71-R1-F2 residual (caller disposition C6, global attempt 8) Agent: Claude Code in T3 Code, existing CLO-866 source owner thread (Opus 5.5) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RESULTRESULT: PR71-R1-F2 residual, attempt 8 (caller disposition C6) verified and publishedPR71 head:
Baseline (exact held
|
STARTSTART: CLO-866 post-PR71 increment, client intent Model: claude-opus-5-5 |
BLOCKERCHECKPOINT: shared native web/desktop admission — source incompatibilities before implementationClient intent 1. The web launch never goes through the origin's peer links (decision needed)
2. Crown has no identity in source (decision needed)
3. No verified stable client identity (resolved within the contract; no decision needed)
Unaffected by the choice
Mobile, schedules and the agent-scripts dispatcher remain later slices. Limits: source reading only. No tests run, no hosts touched, no Crown contact, no provider calls. Model: claude-opus-5-5 🤖 Generated with Claude Code |
CLO-866, PR70 review finding F2: a web/desktop composer retry of a new thread's uncertain launch now resends its original operation, instead of starting a new one.
Head:
ed9075cc3dd15a62306730187a4eff33497f4c1b. Base:release/native-0.1.10at2d4987ee27619bbb1fd1d6e3a9e824f283132384(the PR70 merge). There are two commits:b8da7459(the F2 implementation, held after two failed fixes) anded9075cc(caller-authorized continuation C1).Problem
A new thread's launch from a draft used a fresh message ID and no command ID. If the host accepted it but the answer was lost, or the call failed after acceptance, a retry was a new operation. The host refused it (the thread already exists), so the retry never recovered the launch the host had accepted.
Change (web/desktop composer, new-thread launches from a draft)
composerSend.logic.test.ts.startTurncommand already accepts a caller command ID, and the server already replays an accepted command from its receipt.Verification
2d4987ee, run twice: the reload retry sent a new operation, the host refused it, and the accepted result was never recovered. The restored draft kept no record of its operation.b8da7459, run twice: this follows the composer's real order and failure restore. The renderer dies after binding and before its references are prepared. A retry's reference commit then fails, and the next retry's binding write is silently dropped. That retry launchedpending-upload-4while storage held no references for its operation (expected null to deeply equal ['pending-upload-4']).ed9075cc:Repair history and continuation accounting
~/.local/state/closura/repairs/clo-866-pr70-r1-F2.json(sha2566cbb5f6d…, unchanged): attempt 1 failed, because restoring a failed send replaced the stored operation with the in-memory copy. Attempt 2 passed its command.clo-866-pr70-r1-F2-stop.json(sha25600004545…, unchanged): attempt 2 was judged a semantic failure.clo-866-pr70-r1-F2-stop-correction.json(sha25688a55bbe…): the stop report's silent-drop evidence did not show an unsafe launch. Its binding write was healthy and had already stored those references, and the test helper skipped the composer's failure restore. The narrower route the caller traced was real and is the red above.clo-866-pr70-r1-F2-attempt3.json(sha256636b09f3…at completion): global attempt 3, authorized by caller disposition C1 (CLO-866). It was reserved before any production change and passed with exit 0. It was recorded by hand; the canonical guard closes a passed bug and did not enforce it.Known limits
evals/were run, because they need paid model runs.--no-verifyfor the same pre-existing knip/host-Node reasons as earlier PRs. Checks were run manually as above.agent-scriptstoolkit/t3_dispatch.py,bin/t3-dispatchat0c6ecea5).Provenance
claude-opus-5-5(Claude Opus 5.5)🤖 Generated with Claude Code