Repository navigation
feat(threads): archive owned work across projects at wrap-up - #764
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79700290d3
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
|
No description provided. |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! 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". |
1b0909a to
f926144
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f926144cde
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
f926144 to
a05fbbd
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a05fbbdb14
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
f6f7849 to
305b06c
Compare
|
@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". |
Use the recorded owner to find local archive participants across project boundaries. Preview the exact selection and keep threads with human messages open unless explicitly included. Restore the recorded archive cohort. Carry-Group: incubator Carry-Fix: #751 Carry-Observation: Archive preview and consent travel with the fork-owned family planner and client lifecycle. Model: GPT-6.2 Sol (Codex)
Check every group affected by a widened archive before adding it to the selected set. Preserve legacy restore cohorts when a family also has newly discovered owned threads. Honor explicitly selected children in bulk archive after applying the parent selection. Carry-Group: incubator Carry-Fix: #751 Model: GPT-6.2 Sol (Codex)
Keep live descendants of an archived owned thread open when the user wrote in that thread. Verify that the archive RPC waits for its durable result before a bulk client proceeds to separately selected children. Carry-Group: incubator Carry-Fix: #751 Model: GPT-6.2 Sol (Codex)
Keep a reachable legacy intermediate's restore cohort beneath a cross-project owner and retain groups with an Action record. Recheck the exact archive targets during shutdown. Preserve Review in the mobile archive preview and retain typed-in branches there by default. Carry-Group: incubator Carry-Fix: #751 Model: GPT-6.2 Sol (Codex)
Stub project lookup in the isolated mobile and saved-workspace tests. Assert that the archive dialog omits typed-in consent on default submissions. GPT-6.2 via Codex Carry-Group: incubator
Use the same thread IDs to preview and commit saved-copy disposal. Keep shared copies available while any owner stays open, and show the matching saved-copy inventory when the user opts to archive conversations they wrote in. GPT-6.2 via Codex Carry-Group: incubator
The archive confirmation now uses the shared schema, which owns the project ID field. GPT-6.2 via Codex Carry-Group: incubator
Refresh a later archive preview when an earlier entry archived shared work. Run the later command only if its selection still matches the previously confirmed threads after removing the completed work. GPT-6.2 via Codex Carry-Group: incubator
Seek recorded owner edges from the current family or group instead of materializing them for every thread. Keep owner qualification in the archive planner and skip the cohort scan when the root has no saved cohort. GPT-6.2 via Codex Carry-Group: incubator
305b06c to
6cd12b3
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 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". |
Use guarded JSON extraction in both expression indexes and the matching candidate queries. A malformed legacy row can still reach recovery without entering either index. GPT-6.2 via Codex Carry-Group: incubator
|
@codex review |
|
Codex Review: Didn't find any major issues. More of your lovely PRs please. 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". |
Keep the authority migration test checking the complete ordered upgrade through the new archive index migration. GPT-6.2 via Codex Carry-Group: incubator
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! 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
Problem
Agents launch threads in other projects, and #753 now records who owns them. Archiving the parent at wrap-up still left that owned work open, so it had to be archived thread by thread. This PR makes wrap-up follow ownership across projects, and keeps threads the user has written in open by default.
What gets archived
Within the current environment, archiving uses the existing placement and delegated family and follows
getThreadOwnertransitively across projects. Historical threads whose creator record has no ownership keep their existing archive behavior. Threads released from ownership stay outside the added cascade.Unarchive uses the persisted
archivedWithcohort. An already-archived intermediate keeps its prior restore cohort for legacy placement and lineage. A descendant reached only through recorded ownership restores with the operation that archived it.Human-message rule
A child stays open by default when its stored shell records a message with user role and user authorship. The
latestUserAuthoredMessageAtsignal excludes agent relays and idle compaction. Renames and other actions that adopt the workspace do not set this message signal.The child and its downstream family stay owned. If the child is already archived, its messages still protect the live branch. Web and desktop can include the branch with separate confirmation. Mobile previews the default selection and offers Review so the user can open and archive a conversation directly.
Preview and protections
Groups
In an archive that uses the new ownership preview, a marked group is eligible when it has no conversations, runs, recorded Project Actions, user adoption, or protection, and every live member is in the same confirmed archive.
It then archives with the family and can be restored from the archive.
Scope and follow-ups
Archive performance
Measured on the same 4,866 real thread projections. The dev migration preserved complete histories for 191 visible, stopped threads. The benchmark added the remaining projection rows from a read-only snapshot and archived only the migrated threads.
Across five alternating pairs per comparison, the original query added a median 10.70 seconds to the 50-thread batch. The guarded indexed query added 108 ms (range +66 to +139 ms). The traced statements account for a median 76 ms of this difference.
The 11-thread command runs the candidate query three times at dispatch and four times at completion. Preview adds one. The bulk ran 284 statements, including 50 previews.
SQLite's original plan materialized
recorded_owner_candidatesand scanned the thread table twice. The new plan seeks both partial expression indexes from the recursive family and group lookups. The expressions guard malformed JSON so legacy recovery can keep running. The recorded restore-cohort lookup runs only when the root has both cohort fields. Ownership qualification stays ingetThreadOwner.Verification
Browser evidence
The existing archive menu on the synthetic fixture.
The cross-project preview with the typed-in conversation kept open.
Opting in to archive the typed-in child now updates the saved-copy list to match the selection. Both captures use the same Chromium fixture.
Upstream-owned files
apps/mobile/src/features/home/useThreadListActions.test.tsapps/server/src/mcp/toolkits/thread/handlers.tsapps/server/src/mcp/toolkits/thread/tools.tsapps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ProjectionStore.tsapps/server/src/orchestration-v2/ThreadManagementService.tsapps/server/src/provider/agentContextBudget.jsonpackages/client-runtime/src/operations/commands.tspackages/contracts/src/orchestrationV2.tsapps/mobile/src/i18n/translations/{de,en,es,fr,ja,ko,pt-BR,ru,sv,zh}.jsonapps/web/src/i18n/translations/{de,en,es,fr,ja,ko,pt-BR,ru,sv,zh}.json🤖 Generated with Claude Code
Local review: 4 rounds with GPT-6.1 Terra (xhigh), approved. The fourth round reviewed the final safety changes after churn-gate. A separate scoped source review approved the archive query and index migration.