Repository navigation
feat(threads): remove temporary projects at wrap-up - #771
Conversation
bada4ce to
66fa466
Compare
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. You're on a roll. 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". |
cf55e5b to
fc3c914
Compare
ca4002e to
e1f86cc
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e1f86cc1fa
ℹ️ 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".
|
@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". |
702fca7 to
abe4d89
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". |
abe4d89 to
7604f20
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". |
Carry-Group: incubator
Carry-Group: incubator
Carry-Group: incubator
Carry-Group: incubator
7604f20 to
c2e6d6b
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". |
Part of #751 Agent guidance still described threads in older terms. In evals on main, the model delegated requests to start a child thread and made a group thread independent. It archived the wrap-up root before asking whether to include the typed-in conversations. The revised guidance uses the sidebar and lifecycle tool vocabulary and maps each short request to its operation. ## Injected thread vocabulary > - Start work in another thread only when the user asks or a skill they invoked calls for it. "Task an agent", "have a task", and "delegate" mean a task: short-lived owned work via `delegate_task`. A named thread kind overrides the verb. > - "Child thread": an owned, interactive thread that handles its own waits. Use `t3_thread_launch` for one or `create_threads` for a batch. Launches are owned by default across projects and environments. By default, owned threads sit under their owner in the same project or in a collapsed group per owner in another project. > - "Top-level thread": an independent sidebar root. Set `topLevel:true` only when the user asks for one, as in "task a top-level thread". `groupedUnderThreadId` changes placement only. > - "Group thread": an empty thread that holds others. Launch without a message or attachments, or batch-create without a prompt. > - "Promote": `t3_thread_organize` with `action:"promote"` releases ownership; `return_to_owner` restores it. > - "Wrap up": use `t3_thread_archive_family` to preview owned work across this environment's projects. If the user hasn't decided about conversations they typed in or their owned descendants, name the kept conversations, ask whether to include them, and wait for the answer before archiving. Use `t3_thread_organize` with the default selection unless the user consents to including those branches. ## Stale guidance corrected - **Launch ownership.** Interactive launches were described as always top-level. The guidance now explains that the requesting thread owns a launch by default across projects and environments. Only an explicit top-level request sets `topLevel:true`. The eval runner’s comments now call them launches. - **Start rule:** it covered generic thread requests without separating a task from an interactive child. It now follows the requested thread kind and allows starts requested by the user or by a skill they invoke. Eligible native subagent requests keep their native route. - **Group threads and placement:** launch and batch-create copy said "empty parent", and null placement was described as leaving a thread ungrouped. The tools now say "empty group thread" and explain that clearing manual placement leaves ownership unchanged. A visible explicit group can override the default sidebar placement. - **Actions:** the guidance said "top-level" for any thread entitled to run its own Action. It now says eligible Actions, including a launched child's Actions and those a parent runs for a task. - **Release wording:** the thread list described release as an operation. The organize tool now owns the promote/return wording and explains the delegated result and continuation gate. - **Archive:** guidance covered grouped children and subagents only. It now describes the same-environment, cross-project family, the preview selection, and typed-in consent. The sidebar guide covers retention and restore, and identifies read-only subagents as provider-native. - **Separate worktrees:** the remote task prerequisite was missing. The instructions now name the destination capability and the fetchable parent commit. ## Model eval against main GPT-6.1 Sol xhigh with the GPT-6.1 Terra shell simulator. Three samples per case per arm. Baseline `fba5fa4470e`. The wrap-up pair uses the same revised fixture, with read results for the kept conversations. The vocabulary rows use the final model-facing text and were scored with the final grader. The wrap-up baseline uses the revised fixtures. The existing native-subagent guard uses the preceding candidate, which differs only by the default-placement clarification. | Owner phrasing or control | Main | Candidate | | ----------------------------------------------------------- | ---: | --------: | | Task an agent | 3/3 | 3/3 | | Have a task | 3/3 | 3/3 | | Delegate | 3/3 | 3/3 | | Start a child thread | 0/3 | 3/3 | | Hand to a child thread | 0/3 | 3/3 | | Task a top-level thread | 3/3 | 3/3 | | Start a top-level thread | 3/3 | 3/3 | | Start a group thread | 0/3 | 3/3 | | Promote | 3/3 | 3/3 | | Wrap up asks before archiving | 0/3 | 3/3 | | Wrap up after choosing to leave typed-in conversations open | 3/3 | 3/3 | | Ordinary work | 3/3 | 3/3 | | Native subagent request (existing guard) | 0/3 | 0/3 | - **Main's failures:** both child requests used delegation, and the group thread became independent. - **Wrap-up:** the first request must preview, name the two kept conversations, and ask for the user's choice before archiving. The follow-up checks the exact default archive selection after the user asks to keep them open. The existing native-subagent guard failed all three samples on both main and the candidate. It is tracked in #589. All 36 vocabulary samples and all three manual-placement control samples passed with the final grader. Both post-rebase samples passed, covering the explicit top-level flag and consent before archive. After reconciling #771, all 9 archive samples passed, including its temporary-project selection control. All 88 focused MCP and budget tests passed on the combined head. The full tool-use run on `8f6dbba635f`, before the review fixes, passed **600 of 649 scored samples** across 317 cases. Three provider errors were unscored. The launch, grouping, promotion, and archive controls in that run passed. The ordinary new-thread guard passed 2 of 3, and the native-subagent guard also failed there. The paired main comparison covers the cases in the table. The full run has no matching full baseline. Quick CI and 668 focused tests passed across the final changes. Rebase validation covers the generated budget and carry compilation. Required GitHub CI and Codex review passed on the preceding head `ec0d25ef45c815e14fe30dd5abc3da7b135deb48`, with zero unresolved review threads. [GitHub CI](https://github.com/lastobelus/lastCode/actions/runs/44696105772), [Codex review](#768 (comment)). ## Context budget | Value | Main | Candidate | Byte change | | ----------------------------- | -----: | --------: | ----------: | | `claudeSystemAppendBytes` | 21,845 | 23,198 | +1,353 | | `codexAdditionalContextBytes` | 22,843 | 24,196 | +1,353 | | `mcpToolListJsonBytes` | 85,478 | 85,506 | +28 | Main changed other tool descriptions after the focused run. At #771, the archive description kept both the new temporary-project consent and the vocabulary guidance. The measured byte increases are the same after rebasing. The orchestrator applied `agent-context-increase` after reviewing the previously approved head. The rebase after #771 preserves all three approved byte increases. ## Upstream-owned files | File | Added | Removed | | ---------------------------------------------------------------- | ----: | ------: | | `apps/server/src/mcp/McpHttpServer.test.ts` | 1 | 1 | | `apps/server/src/mcp/toolkits/orchestrator/tools.ts` | 3 | 3 | | `apps/server/src/mcp/toolkits/project/tools.ts` | 1 | 1 | | `apps/server/src/mcp/toolkits/thread/tools.ts` | 2 | 2 | | `apps/server/src/provider/agentContextBudget.json` | 3 | 3 | | `docs/user/thread-sidebar.md` | 22 | 17 | | `evals/mcp-tool-use/run.ts` | 3 | 3 | | `packages/provider-core/src/server/orchestrationInstructions.ts` | 7 | 4 | ## Decisions - **Shared copy:** the vocabulary lives in a fork-owned module and is interpolated into the existing orchestration section, so Codex and the other providers get identical text. - **Group threads:** use the existing empty launch inputs. Tool schemas and runtime behavior are unchanged. - **Wrap-up:** name the kept conversations and get the user's choice before applying the archive preview selection. The rebase after #771 preserved its separate consent and history-deletion warnings for removing temporary projects. Cross-environment archiving remains outside this PR. - **Thread-read routing:** the contract is intact. The added fixture returns matching read results so the model can follow the existing link rule. - **Eval scope.** The paired run and the full suite use one evaluator model. The new cases cover the owner's terse phrasing, and the existing suite covers neighboring behavior. - **Carry replay.** The initial push omitted the required source trailers. All source commits now identify #751 and use the Incubator group, as the vocabulary spans the feature’s tools, prompts, tests, and docs. Main’s #726 squash then needed a provenance repair. The rebase onto repaired main preserved the complete PR tree. - **Authorship:** Claude Opus polished the guidance. I clarified null placement where an explicit top-level flag also applies, and fixed wrap-up's consent order after review traced what happens when the archive ends the turn. Local review: 3 rounds with GPT-6.1 Terra (xhigh), approved. The last round found one low-severity grader gap. The tighter check rejects unrelated questions and preserves the paired wrap-up scores when regrading saved samples. Carry-Source-Ref: refs/lastcode/carry-sources/pr-768/19565abda314b40fe618c38bfcec24a7c2aa95cf Carry-Source-Base: 88fca56 Carry-Source-Head: 19565ab
Part of #751 ## What this PR does Archive preview now shows owned conversations on linked environments and names peers it cannot check. This is part 1 of the two-PR split of D4. Linked threads stay open unless the user explicitly selected them through another archive entry in a bulk selection. ## What users see - An available machine lists its owned threads with project, typed-in, active, unread, and protected state. Ordinary archive, bulk archive, saved-workspace confirmation, and the mobile alert use the same information. The `t3_thread_archive_family` tool returns per-machine sections. - An offline machine shows **Pending · Offline**. A refusal shows **Blocked · Access denied**. An older build shows **Blocked · Update this machine to review its threads**. - Each destination applies the paired link's authorization and walks its recorded ownership for the source thread and that thread's locally owned work. Work owned through a second peer needs a separate review. - Peer inventory is read-only. Once the local roster supplies the machine names, owner lookup, link resolution and requests use the remaining time in a shared one-second budget. Each machine's result is retained as it answers. Bulk previews run concurrently and list the selected threads with archive labels and locations. An unavailable peer prompts for review. Empty inventories alone leave the normal idle archive flow in place. ## Archive and restore in part 2 Part 2 records one operation per local archive generation, with an exact selection and receipt for each destination. Local archive finishes independently of the peers. An explicit retry reuses a reviewed selection while it remains valid and asks for fresh review when the destination could not be inspected. Restore reopens the exact committed threads and reports unreachable destinations for retry. The recorded selection preserves consent without a standing retry service. ## Verification - GitHub CI and Codex review passed on `6b36558175043c85896f9bea8ffc88103ca567b9`, with zero unresolved review threads. [GitHub CI](https://github.com/lastobelus/lastCode/actions/runs/44703913066) · [Codex review](#772 (comment)) - Rebased over #771 so local temporary-project removal and linked preview appear in the same confirmation. The later rebase over #768 required regenerating only the context budget. The rebase passed 118 focused tests, 81 web checks, 17 Chromium tests, and the translation catalog check. The final deadline and bulk-label fixes passed 33 focused tests and scoped lint. Quick CI passed on `6b36558175043c85896f9bea8ffc88103ca567b9` against `1aaf7683dc0d16bb937721b7b1585f25348f4379`. - Production indexed reads exercised two separate SQLite environments. The fixtures included transitive ownership across projects, archived and deleted intermediates on both sides, and a thread ID reused under a different environment. Transport tests checked link authorization, refusal, offline, unsupported, and the deadline during both resolution and HTTP. - In the isolated dev app, the real web client named an expired test link as blocked and moved the local thread to Archived after confirmation. The Incognito QA tab paired with the isolated dev credential. Chromium component tests rendered available, offline, and older peers. Mobile tests exercised alert contents and local archive consent. - Six batches of 50 synthetic local archive commands per checkout measured dispatch through completion, with shared dependencies. Median was 3.047 s on the original main baseline, with a 2.081–3.230 s range. The preview branch measured 3.106 s, with a 1.981–3.472 s range. The archive command does not call peers. - The archive tool eval passed 17/18 samples with GPT-6.1 Sol on the final head. Five cases passed 3/3. The busy-owner case passed 2/3, matching a run against main at `1aaf7683dc0d16bb937721b7b1585f25348f4379`. The one failure skipped the archive-family inspection while leaving the busy owner and its work alone. The same case was 0/3 after #768 with the earlier preview wording, and all six cases passed 18/18 before #768. - Repository budget bytes moved from 23,198 to 23,198 for Claude system append, from 24,196 to 24,196 for Codex additional context, and from 85,506 to 85,503 for the MCP tool list (−3 bytes). <details> <summary>Browser component captures</summary> **Before** — local archive choices. <img width="414" alt="Archive confirmation with local threads" src="https://github.com/user-attachments/assets/e9fae817-15b2-4449-b0e0-616db443f2f9" /> **After** — available, offline, and older machines in the same confirmation. <img width="414" alt="Archive confirmation with sections for linked machines" src="https://github.com/user-attachments/assets/d47a2c82-9fce-4083-9556-e6d450ead9bf" /> </details> ## Upstream-owned files touched | File | Added | Removed | | --- | ---: | ---: | | `apps/mobile/src/i18n/translations/de.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/en.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/es.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/fr.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/ja.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/ko.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/pt-BR.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/ru.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/sv.json` | 10 | 1 | | `apps/mobile/src/i18n/translations/zh.json` | 10 | 1 | | `apps/server/src/mcp/toolkits/thread/handlers.ts` | 7 | 4 | | `apps/server/src/mcp/toolkits/thread/tools.ts` | 1 | 1 | | `apps/server/src/peer/PeerLinks.test.ts` | 3 | 0 | | `apps/server/src/peer/PeerLinks.ts` | 9 | 3 | | `apps/server/src/provider/agentContextBudget.json` | 1 | 1 | | `apps/server/src/server.ts` | 7 | 0 | | `apps/server/src/ws.ts` | 8 | 0 | | `apps/web/src/i18n/translations/de.json` | 11 | 1 | | `apps/web/src/i18n/translations/en.json` | 11 | 1 | | `apps/web/src/i18n/translations/es.json` | 11 | 1 | | `apps/web/src/i18n/translations/fr.json` | 11 | 1 | | `apps/web/src/i18n/translations/ja.json` | 11 | 1 | | `apps/web/src/i18n/translations/ko.json` | 11 | 1 | | `apps/web/src/i18n/translations/pt-BR.json` | 11 | 1 | | `apps/web/src/i18n/translations/ru.json` | 11 | 1 | | `apps/web/src/i18n/translations/sv.json` | 11 | 1 | | `apps/web/src/i18n/translations/zh.json` | 11 | 1 | | `packages/contracts/src/index.ts` | 1 | 0 | | `packages/contracts/src/orchestrationV2.ts` | 2 | 0 | Local review: 8 rounds with gpt-6.1-terra (xhigh), approved. Carry-Source-Ref: refs/lastcode/carry-sources/pr-772/6b36558175043c85896f9bea8ffc88103ca567b9 Carry-Source-Base: 1aaf768 Carry-Source-Head: 6b36558
Part of #751
Temporary projects can outlive the orchestrator that registered them. Wrap-up now previews which projects can be removed and confirms the exact thread histories covered by each removal.
What gets removed
Proof
119 focused server tests passed after review. They cover successful deletion, a late keep or new thread, typed-in work, a newly archived history after preview, and restoring the owner before removal.
115 focused client tests and 17 Chromium tests passed after the first review. All 70 web archive action tests passed after the bulk refresh fix. Server and client runtime type checks and scoped lint passed.
The isolated web client showed the project and warning. Applying the confirmation archived the orchestrator, removed the project and its task history, and left a workspace file in place.
The MCP tool list grew by 436 bytes. The new consent guard passed 0/3 on the baseline and 3/3 with the new contract. The full archive suite passed all 18 samples across six cases.
All 100 MCP access and thread handler tests passed after the Codex finding. The regression verifies that an approval-required client can archive a thread while project removal is refused.
Local review: 3 rounds with GPT-6.1 Terra (xhigh), approved before the Codex permission fix.
Before and after
Notes for future edits
ProjectService.deletechanges, move it intoguardWrappedProjectRemovalor another fork helper.executeArchiveexplicitly.Upstream-owned files
apps/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/McpToolAccess.tsapps/server/src/mcp/toolkits/thread/handlers.tsapps/server/src/mcp/toolkits/thread/tools.tsapps/server/src/orchestration-v2/EffectOutbox.tsapps/server/src/orchestration-v2/EffectWorker.tsapps/server/src/orchestration-v2/Orchestrator.tsapps/server/src/orchestration-v2/ThreadManagementService.tsapps/server/src/orchestration-v2/runtimeLayer.tsapps/server/src/project/ProjectService.tsapps/server/src/provider/agentContextBudget.jsonapps/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.jsonpackages/client-runtime/src/operations/commands.test.tspackages/client-runtime/src/operations/commands.tspackages/contracts/src/orchestrationV2.ts