3 months ago
0b54726* fix: enforce terminal task thread locks Reject terminal task-owned turn/start and turn/steer through structured JSON-RPC task_locked errors, stop late aborted turn output before projection, document protocol v7.39, and cover restart, race, isolation, and reopen/retry flows with production JSON-RPC tests. * fix: render terminal task chats read-only Hide the normal composer for completed, cancelled, and failed task conversations, expose server-status-driven Reopen or Retry actions, preserve transcript and add-thread accessibility state, and cover completed and failed terminal task UI behavior. * test: support isolated Electron user data dirs Add a dev/test-only COWORK_ELECTRON_USER_DATA_DIR override before userData-backed desktop services and the single-instance lock, fail closed in packaged builds, document the live-verification knob, and harden desktop startup/onboarding tests. * fix: close terminal task review gaps Guard terminal Reopen and Retry actions against same-tick duplicate clicks, preserve cancelled outcomes for terminal-quiesced turns, and extend deterministic UI/JSON-RPC regressions for the reviewed paths. * fix: preserve usage for cancelled task turns Merge provider usage before suppressing post-cancellation task-turn output and extend the production JSON-RPC terminal race regression to assert exact-turn usage notification without false completion telemetry. * docs: include task locked error code Add task_locked to the shared ServerErrorCode protocol union so the structured terminal task lock contract is documented consistently. * fix: suppress late cancelled turn streams * fix: block terminal task tool races * fix: gate download side effects * fix: close remaining task mutation gates * fix: gate remaining task side effects * fix: settle task terminal lock races Close remaining terminal task lifecycle races reported on PR #177. Add effect-settlement barriers for terminal transitions, final mutation checks for queued steer drains, native Codex approval and yolo coverage, non-cooperative MCP settlement behavior, projected task_locked data, and keyed desktop lifecycle action state.\n\nRegenerate JSON-RPC protocol artifacts and add deterministic production-path plus desktop regressions for the reviewed edge cases. * test: cover task terminal quiesce timeouts * fix: close terminal quiescence races * fix: quiesce source and artifact terminal races * fix: defer terminal directive checkpoints Record self-origin terminal directive receipts and checkpoints only after the matching deferred terminal commit finalizes. Failed quiescence now leaves no receipt or success checkpoint, while retry and replay paths remain idempotent. * fix: guard terminal task admission races * fix: wait for child agents before terminal tasks * fix: close task lock race escapes Harden terminal task locking across late user-content materialization, steer delivery, partial abort handling, retry serialization, child-agent settlement, and JSON-RPC agent controls. Add deterministic production-path regressions for attachment rollback, branded task-lock aborts, abort partial suppression, live and queued steer races, task retry serialization, child spawn settlement, inherited child task locks, and direct agent route task_locked errors. * fix: harden terminal task admission races * fix: harden task locks across steers and controls * fix: close terminal task race gaps * fix: close terminal task review races * fix: serialize desktop task lifecycle actions * fix: defer task cancel terminal locks * fix: remove terminal route prelock bypass * fix: harden terminal task quiescence edges Remove the dead prepared route-lock escape hatch and keep terminal lock publication inside coordinator-owned mutation ownership/revalidation paths. Preserve completed artifact revisions when terminal quiescence fails by marking durable pending settlement and retrying safely, while keeping no-review retry state intact. Tighten live steer admission, Codex pre-ack usage identity, AgentControl fixed-point races, committed-reader coverage, task notification subscription buffering, and task cancel lock regressions. * fix: stabilize artifact settlement retries Retry only terminal quiescence and structured task-lock failures with bounded backoff, while keeping blocked and atomic settlement failures fail-closed. Add deterministic coverage for delayed locks, terminal races, non-retryable failures, rollback integrity, and scheduler overrides. * fix: align terminal lifecycle pending state Match terminal reopen and retry controls to the current task action and revision so stale requests cannot disable the wrong UI. Allow a newer lifecycle revision to supersede an older request while preventing stale responses from clearing or overwriting the current latch. Add store and dual-sidebar regressions for the status-change race. * test: isolate session provider logout Inject provider logout through the session auth manager so the unit test never launches a live Codex app-server logout. Preserve the production default while verifying the injected path directly, eliminating the exact five-second CI timeout. * fix: replace stale lifecycle actions Deduplicate terminal lifecycle requests only when both action and revision match. Let an opposite reopen or retry action supersede a stale latch, while request ownership keeps the prior result from clearing or overwriting the active request. * fix: preserve lifecycle latches across revisions Keep same-action reopen and retry requests pending across task revision drift while allowing opposite actions to supersede stale latches. Cover both store deduplication and dual-sidebar pending state after a revision-only task update. * test: await terminal lock publication Replace the fixed child-settlement delay with an explicit wait for the coordinator pending terminal lock. This keeps the interrupt-replacement regression deterministic while still proving the task remains working until quiescence completes.
Parent868f5c5