Repository navigation
fix(placement): keep a draft whose send failed on the machine it was sent to - #70
Conversation
…sent to The composer records a sent draft's machine before the launch goes out (promotedTo), but a failed send restored the draft with the same thread id and dropped that record. A retry could then be auto-balanced, or manually switched, to another machine under the same id, while the first machine may have started it after a lost answer. restoreFailedDraftThread now keeps that machine as sentTo, persisted with the draft, whenever the id is kept. The draft store refuses to move a draft's thread id away from it (setDraftThreadContext, setLogicalProjectDraftThreadId), the composer stops auto-balancing it and says why a switch is refused. A send refused under a new id is a new intent and may go anywhere. ARC also runs the draft store suite. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
CHECKPOINTCHECKPOINT: CLO-866 layer 4 (client and schedule creation paths).
|
RESULTRESULT: CLO-866 layer 4 (client and schedule creation paths) is ready for its one independent review. It is not merged.
|
|
CLO-866 — claiming the single independent technical review (R1) for head Coordinator: this ChatGPT continuation ( Review will bind findings to current source and the CLO-866 placement requirements, distinguish this retry-safety increment from still-open universal-placement/live acceptance, and retain finding identities for any focused repair verification. No source edits, host apply, CI rerun or second reviewer is being launched. Other coordinators should preserve this R1 claim; I will return its result here. |
Single independent R1 — changes requiredReviewed head PR70-R1-F1 — P1, blocking: destination is not committed before launchAt Concrete failure: an ordinary draft T is committed without promotion/sentTo; host A accepts a text-only launch; the renderer terminates inside the pending-write window without beforeunload; reload sees the old unbound T; resource routing or a manual switch can send T to B. Separate host databases permit the second launch. This existing storage behavior invalidates the new durable retry claim. The new regression at Required bounded repair: commit the binding through the actual persistence boundary before the first launch; fail closed if persistence fails; retain it after uncertain outcomes. Reuse existing store/storage machinery. Focused proof: real adapter with timer still pending; at the launch boundary, assert committed bytes contain the binding. Reload from those bytes after interruption, without beforeunload or injecting current memory, and show both retarget paths refuse another host. A failed storage commit must produce zero launch calls. Reproduce the unfixed sequence and retain guard/attempt history. Source analysis here is not a claim that a live browser crash was executed. PR70-R1-F2 — P2, existing acceptance gap; may be a separate owned sliceA web retry creates another message ID ( Preserve the original command/message IDs and request intent for ambiguous retries, settle through the accepted receipt, and distinguish an explicitly changed request from retry. Mobile already persists and passes these IDs through the existing operation API. Focused eventual proof: accept then drop response/withhold shell events, retry/restart, original IDs/payload reused and exactly one accepted launch/run/result. This is not a new regression in these five files and need not expand the F1 repair. Remaining CLO-866 scopeThis PR is a retry-safety increment; it does not complete universal client/schedule placement. Preserve these separate obligations with the same source owner:
Existing ARC44264637322/job134666007543 is success at this head, all15steps; the 11-file/352-test result was not rerun. No actual UI/host behavior is inferred. The already-persisted sentTo guard is otherwise coherent for its narrow purpose. Disposition: changes-required for F1. Retain F1/F2 identities; route F1 to the existing ASUS Opus source owner. Verify the repair within this same R1, with no new review round, CI rerun on unchanged source, provider substitution, or live deployment. |
…unches PR70-R1-F1. Draft state reaches storage through a 300 ms deferred write, flushed only on beforeunload, so a renderer that died after an accepted launch could reload the draft unbound and send its thread id elsewhere. markPromotedDraftThreadByRef now flushes the existing deferred storage and checks the stored bytes hold the promotion before the composer launches. If storage throws or drops the write, the promotion is undone, it returns false, and the send fails before any launch. A committed promotion, like sentTo, keeps the id on its machine in both retarget entry points, and a restore after an unconfirmed outcome commits sentTo best effort. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retained R1/F1 — first repair needs one correctionFocused verification of only The repair commits the first launch's binding and correctly refuses a send when that commit fails. However, Valid recovery sequence: A/T's promotion was committed before an earlier potentially accepted send; client crashes before reconciliation; reload retains promotedTo=A/T and no sentTo; another attempt encounters storage failure; the new rollback clears the older binding; common restoration leaves the same ID unbound, permitting retarget to B after storage recovers. The binding must survive any failed subsequent attempt. The same reviewer executed the actual repaired helper bodies (TypeScript annotations removed) with a synthetic store and throwing flush: the helper returnedfalse, cleared the pre-existing promotion, restoration left sentTo=null, and the existing guard admitted B/T. This is a narrow helper check, not a full browser or repository-suite result. Parent independently read the exact rollback/restoration source. Smallest correction: retain each draft's prior promotion value and restore that value on failed persistence, instead of clearing every matching promotion. Extend the real-adapter regression using the crash-reloaded, previously committed promotion: failed write/readback and common restoration => zero new launch and both retarget paths remain pinned; after storage recovery and another real reload, the original binding still holds. Keep the two original red receipts, first guard run and 108-test pass as history. Those checks passed, but the first repair's F1 correctness is incomplete; count that semantic failure when applying the existing two-failed-fix limit. The next bounded repair is attempt2 for this same finding, with no identity/counter reset and no third attempt if it fails. No fresh review, CI rerun of an unchanged head, host action or duplicate source owner is requested. Existing CI44269964982 may finish and remains evidence only for6991286b; merge stays held pending the retained F1 correction and current-head checks. |
RESULTRESULT: PR70-R1-F1 repair (commit the send's destination before launch). It is ready for focused verification of the original finding only. It is not merged.
|
…later commit fails PR70-R1-F1, attempt 2. A failed commit cleared promotedTo on every matching draft, including a promotion an earlier, possibly accepted send had already committed (still there after a crash and reload). The common restore then left the thread id unbound, and it could be retargeted to another machine. markPromotedDraftThreadByRef now restores each draft's prior promotion on a failed commit, so the earlier binding survives, restoration turns it into sentTo, and both retarget paths keep the id on its machine. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Retained R1/F1 closed at the second repairPR70-R1-F1 is closed at The helper now captures each draft’s earlier promotion before the attempted write and restores that exact value if persistence/readback fails. A fresh uncommitted send is refused without a launch; a crash-recovered earlier send remains pinned through common failure restoration. The existing first-send flush/readback and caller boolean guard remain intact. Evidence:
F2 (original command/message identity on uncertain retry), native client admission, mobile/fresh-schedule auto placement, and Tots remain open, separate CLO-866 source obligations with the same author. No real client/host acceptance or whole rollout completion is inferred. Closeout still requires terminal acceptable CI44271476979 on this exact head, the author’s refreshed body/receipt, and a final head/base read. Root retains the normal merge action under the recorded CLO-866 authorization. Repository-supported squash merge will carry explicit source/review provenance in the landed commit; the source commits and PR branch history remain available. No human GitHub approval vote is being synthesized. |
RESULTRESULT: PR70-R1-F1 attempt 2, which keeps an earlier committed send binding when a later commit fails. It is ready for focused verification of the original F1 only. It is not merged.
|
Source acceptance — merged and read backPR70 merged normally at 2026-11-18T09:06:39Z into One original R1, retained F1 closed at 6973932220; source author’s final evidence 6973953621. Exact-head ARC44271476979/job134688893932 completed all15steps successfully, 11files353tests; CodeRabbit status successful; no open inline threads or formal approval requirement observed. No approval vote was manufactured. CLO-866’s November15 source/green-merge authorization and the user’s continued completion instruction supply action authority. The landed commit records actual source model/owner, review model and merge-agent provenance. Original source commits, branch and both repair histories remain available. The final PR body now states the bounded outcome and correct existing dispatcher wrapper Installed state is unchanged. This is source acceptance for durable destination binding, not a live fleet acceptance claim. Same owner next: retained F2 command/message/request identity on ambiguous retries, then native shared-client admission, mobile auto placement, fresh-schedule per-occurrence auto placement and the separate Tots dispatcher. Existing bound threads/schedules stay pinned. CLO-866 remains open. |
CLO-866 universal native thread placement: preserve a draft's destination across failed sends and interrupted clients. Builds on PR69 (
ede26b72). The remaining automatic client and schedule placement work stays open as listed below.Head:
e2475faea7243a56da65306fe3a3adb343956515. Base:release/native-0.1.10atede26b7200b70610bc041403da8a1a51eb6b542c. There are three commits:d6de8f89(the slice),6991286b(R1 F1 attempt 1) ande2475fae(R1 F1 attempt 2).What each creation path does today
useDraftEnvironmentRoutingwithuseLoadBalancedEnvironment, the "Auto balance" draft routing. No second selector is added.markPromotedDraftThreadByRefrecords the destination (promotedTo, persisted) before the launch goes out.restoreFailedDraftThread, which kept the same thread ID but clearedpromotedTo. A retry could then be re-balanced (refreshBeforeSend) or switched by hand to another machine under that same ID. If the first machine had accepted the launch and only the answer was lost, the work ran twice.last_run_at, and from itfireKey, the command ID and the message ID) is persisted bymarkRunningbeforeThreadLaunchService.launch.ScheduledTaskService.test.ts:259.Change
DraftSessionState.sentTo: when a failed send keeps its thread ID,restoreFailedDraftThreadrecords the machine it was sent to (from the pre-sendpromotedTo). It is persisted, sanitized and hydrated with the rest of the draft, and included in the draft equality check.sentTo, in both retarget entry points (setDraftThreadContextandsetLogicalProjectDraftThreadId). The draft's own machine settings still change. A send that is restored under a new ID (a bootstrap thread deleted there) is a new intent and may go anywhere.automaticEnvironmentis false), and a refused machine switch shows why instead of doing nothing.beforeunload.markPromotedDraftThreadByRefnow flushes that existing storage and checks that the stored bytes hold the promotion before the composer launches. If storage throws, or drops the write without throwing, each draft gets back the promotion it had before (which an earlier, possibly accepted send may have committed), it returnsfalse, and the send fails before any launch, through the existing pre-launch failure path. A committed promotion binds the thread ID likesentToin both retarget entry points. A restore after an unconfirmed outcome commitssentTobest effort; until that lands, the committed promotion still binds the ID.apps/web/src/composerDraftStore.test.ts.Review round 1 (independent R1 on
d6de8f89) and repairexpected null to deeply equal {environmentId, threadId}).~/.local/state/closura/repairs/clo-866-pr70-r1-F1.json, sha2565ef6c346cc3d93ce6a27500b1c2577cbf6a54dd7bc9ebacb826b8a49e11ac580(unchanged). Attempt 1 passed its 108-test command at6991286b.promotedTo, including one committed by an earlier, possibly accepted send that was still present after a crash and reload. The common restore then left the thread ID unbound.clo-866-pr70-r1-F1-attempt2.json(sha2565340d1ac…at completion). That record links the unchanged original record and its hash, keeps attempt 1's command pass and semantic failure, and is the last attempt.6991286b: the retarget after a failed retry and restore moved the draft toenvironment-remote.F1 closure: the same R1 reviewer verified the second repair at
e2475faea7243a56da65306fe3a3adb343956515; retained finding closure and evidence. F2 remains a separate owned obligation.Verification (local, bounded runner)
e2475fae: web typecheck, format and lint are clean. Draft-store and composer-send logic suites: 2 files, 108 tests passed.localStorageand fake timers.beforeunloadand no in-memory state. Both retarget entry points keep the draft on its machine.d6de8f89:d6de8f89: ARC run 44264637322 succeeded, with 11 files and 352 tests.6991286b: ARC run 44269964982 succeeded, with 11 files and 353 tests. That is history only; that head is not accepted.e2475fae: ARC run 44271476979 succeeded, with all steps passing, including 11 test files and 353 tests on the runner.Known limits
nullStack65/agent-scriptstoolkit/t3_dispatch.py, wrapperbin/t3-dispatch) is the separate next slice. No live hosts were touched.--no-verifyfor the same pre-existing reasons as PR68 and PR69. Checks were run manually as above.Provenance
claude-opus-5-5(Claude Opus 5.5)🤖 Generated with Claude Code