Repository navigation
feat(threads): archive and restore owned work on linked machines - #786
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Can't wait for the next one! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Part of #751. Store source and destination archive state by qualified owner and generation. Reserve a missing generation with an insert and use revision-checked updates to keep stale writers from replacing committed state. Implemented with GPT-6.2 Sol in Codex via T3 Code. Carry-Group: incubator
Part of #751 (D4, part 2). Recheck recorded ownership and reviewed human-message evidence under the destination archive locks. Persist the exact shutdown cohort and restore only rows matching its committed archive transitions. Implemented by GPT-6.2 Sol in Codex. Carry-Group: incubator
Persist each environment's selected archive cohorts and their receipts. Confirm exact work in the clients and tools, then allow explicit retries after the local archive or restore has finished. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Direct responsibility and availability checks during wrap-up to the family preview. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Keep unfinished restore generations reachable after a later archive. Bind renewed peer consent to ordered revisions and retain the destination's admitted work and receipts. Move the client control and MCP policy behind fork-owned seams. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Expose the current archived generation and pending earlier restores to the clients and archive tools. Let users pick a dated operation and pass its exact generation back on retry. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Release only the exact failed attempt authorized by the destination before applying a newly reviewed subset or empty selection. Retain dismissal receipts so retries recover after interruption. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Use Effect DateTime for the local date in the linked operation picker so shared-runtime typechecking passes. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Reuse exact destination-authorized dismissal during fenced restore. Cover both a failed cohort and a hold left by an interrupted replacement, and verify real local shutdown completion starts peer work while preserving the local journal proof. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Report linked failures through the source journal and clear the exact in-progress hold on the destination when shutdown fails. Remove the later dismissal protocol and preserve committed cohorts and restore fencing. Implemented with GPT-6 Sol in LastCode. Carry-Group: incubator
Include migration 24 in the five existing upgrade assertions that check the full LastCode migration sequence. These assertions now cover the archive journal alongside the earlier migrations. Implemented with GPT-6 in LastCode. Carry-Group: incubator
04097b6 to
3ef779c
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Move linked archive and restore choices into tool replies while continuing to validate the full selection. Restore the childless archive guidance and require fresh stop consent for a saved MCP retry that can stop linked work. Implemented with GPT-6.2 Sol in LastCode. Carry-Group: incubator
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep them coming! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Part of #751
What changed
Archiving an orchestrator now reaches the threads it owns on directly linked machines. The confirmation shows the exact threads to archive and the ones that stay open. Including a thread you wrote in or stopping active linked work requires your consent.
Each machine authorizes its own archive, records what it archived, and returns a receipt. The local archive and restore finish before any request goes to another machine. A peer that fails to stop releases its temporary hold, and the source keeps the failure visible for review. Restore reopens only the threads recorded in the receipts, without restarting work. Once a machine receives the restore, it refuses late archive requests for the same operation.
When a machine can't finish
Open Archived threads → Linked archive status to retry. A retry reuses the saved choices for the same local archive. If the choices changed or a machine could not show them before, review them before retrying. Retries are explicit so an unavailable machine cannot archive work the user had no opportunity to review.
A restore that cannot reach a machine stays pending. Open Linked archive status on the restored thread to retry it. The dialog lists the current operation and earlier pending restores by archive date, so each can be retried separately.
Scope
Coverage follows recorded ownership on each directly linked machine. Ownership chains that pass through a second linked machine are out of scope. Temporary-project cleanup remains local.
Web and desktop share the thread menu, sidebar, bulk and saved-workspace confirmations. Mobile uses its archive sheet and thread menu. Agents get the preview and commands through
t3_thread_archive_familyandt3_thread_organize.Verification
Changed-file checks passed with 542 tests, 38 affected-package typechecks and React compiler coverage. The focused MCP and peer archive suites passed 33 tests. Quick CI passed on
65a3dee7feb88a7d4300a64adc052b7fa1d00b14.In the managed Browser, two real paired development environments with separate SQLite databases archived the selected work, kept a thread with a human message open, and restored the committed cohort. Archive and restore both succeeded on explicit retry after an offline peer returned. The projection and durable journal were checked on both machines.
The recovery picker passed a browser test. Refused and older peers are covered by focused transport and client checks. Mobile coverage consists of client tests and typecheck.
Archive timing covers dispatch through local completion. It used 12 timed batches of 50 synthetic idle-root archives per row after warmup with the real service and in-memory SQLite. Wall times varied with local activity. Recording a pending peer added journal work and made zero peer calls before local completion.
lastcode/mainlocalThe updated tool preview supplies copyable default linked choices and per-operation retry arguments. Copyable choices cannot stop active work. A saved retry that can stop work requires an explicit stop disposition before the source replays it. The childless active and unread guidance is restored.
Agent context compared against
c3abd81fd3c2. Claude system append 23,198 → 23,198 bytes (0). Codex additional context 24,196 → 24,196 (0). MCP tool list 85,503 → 85,797 (+294). The checkpoint owns the snapshot.Archive and thread-read evals
GPT-6.1 Sol at xhigh with the Terra shell simulator. Three samples per case.
All final cases passed 3/3. The first run completed 28 of 30 samples without a graded failure. Two typed-in samples ended with
Responses stream ended without response.completed. A fresh three-sample typed-in run on the committed head passed 3/3. The saved-stop guard passed 3/3 in the full run.Thread-read routing passed 37/45, including 9/9 for attached, ID-only and machine-directed mentions. The five wake/recovery cases with misses passed 7/15. A control using main’s archived-tool cue on those same five cases passed 8/15. Both versions missed samples in all five cases. The broader run includes response phrasing, exact paging and recovery expectations. The published archive cue stayed because agents otherwise sometimes decided whether an owner was available without inspecting the archive family.
Archive confirmation before
Archive confirmation with pending work
Upstream-owned files touched
apps/mobile/src/App.tsxapps/mobile/src/features/archive/ArchivedThreadsScreen.tsxapps/mobile/src/features/threads/thread-list-v2-items.tsxapps/mobile/src/i18n/translations/de.jsonapps/mobile/src/i18n/translations/en.jsonapps/mobile/src/i18n/translations/es.jsonapps/mobile/src/i18n/translations/fr.jsonapps/mobile/src/i18n/translations/ja.jsonapps/mobile/src/i18n/translations/ko.jsonapps/mobile/src/i18n/translations/pt-BR.jsonapps/mobile/src/i18n/translations/ru.jsonapps/mobile/src/i18n/translations/sv.jsonapps/mobile/src/i18n/translations/zh.jsonapps/server/src/mcp/toolkits/orchestrator/tools.tsapps/server/src/mcp/toolkits/thread/handlers.tsapps/server/src/mcp/toolkits/thread/tools.tsapps/server/src/server.tsapps/server/src/ws.tsapps/web/src/components/settings/ArchivedThreadsPanel.tsxapps/web/src/hooks/useThreadActionMenu.test.tsapps/web/src/hooks/useThreadActionMenu.tsapps/web/src/i18n/translations/de.jsonapps/web/src/i18n/translations/en.jsonapps/web/src/i18n/translations/es.jsonapps/web/src/i18n/translations/fr.jsonapps/web/src/i18n/translations/ja.jsonapps/web/src/i18n/translations/ko.jsonapps/web/src/i18n/translations/pt-BR.jsonapps/web/src/i18n/translations/ru.jsonapps/web/src/i18n/translations/sv.jsonapps/web/src/i18n/translations/zh.jsondocs/user/thread-sidebar.mdpackages/client-runtime/src/operations/commands.test.tspackages/client-runtime/src/operations/commands.tspackages/contracts/src/orchestrationV2.tsLocal review: 4 rounds with Codex Terra (xhigh), approved after the scope review and simplification. The owner’s tool-context revision took three additional rounds with Codex Terra (xhigh) and was approved.