Repository navigation
feat(projects): hide temporary agent projects by default - #761
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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 11d83e16c3
ℹ️ 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".
11d83e1 to
858169e
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! 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". |
858169e to
dafc448
Compare
|
@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". |
Record the authenticated creating thread in the project registration. Add a temporary marker, owner-scoped listing, and the Keep transition. Implemented by Codex Sol 6.2 in the Codex harness. Carry-Group: incubator Carry-Fix: #751
Filter project rows and starting-work choices while preserving thread access and contextual project actions. Keep is available on the existing Project Settings panel. Implemented by Codex Sol 6.2 in the Codex harness. Carry-Group: incubator Carry-Fix: #751 Carry-Observation: Sidebar picker changes depend on existing Incubator changes.
dafc448 to
b24da50
Compare
|
@codex review |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. 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". |
The hosted browser fixture holds a capture lease, which schedules setCaptureDrawn after rendering. Supply that callback so a frame firing before disposal cannot throw in CI. Implemented by Codex Sol 6.2 in the Codex harness. Carry-Group: incubator Carry-Fix: #761
|
@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". |
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 `getThreadOwner` transitively 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 `archivedWith` cohort. 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 `latestUserAuthoredMessageAt` signal 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 - **Preview first.** Web, desktop, mobile, and the tool show the family before the wider selection applies. Clients list titles and projects, what stays open, and active, unread, or protected state. The tool returns the environment ID and project IDs. - **Server re-check.** The server validates the exact selection again under its locks. - **Saved workspaces.** Each archive selection shows its own discardable and retained copies. The server binds disposal consent to the confirmed thread IDs. A copy shared with a thread that stays open remains available. - **Bulk.** An explicitly selected child still gets its own archive when the parent's default keeps it open. When two operations share a thread, the later one refreshes and can proceed only when its confirmed selection still matches after removing threads the batch already archived. - Existing activity, permission, shutdown, and retry protections apply to the selected family. ## 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 - **Current environment only.** Linked environments can already preview or archive a known thread ID with the peer's authorization. They cannot enumerate a remote part of a family by owner, or record an offline destination as pending. - **Cross-environment follow-up.** Use an owner-qualified inventory and a durable operation record. Review the exact selection per reachable peer, use that peer’s authorization, and record its receipt. Show offline or denied peers as pending or blocked and retry idempotently. Restore the cohorts that actually committed. - **Temporary projects.** PR #761 landed the project listing service. The orchestrator is scheduling removal at wrap-up separately. Promotion landed in #763 and is included through the base. ## 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. | Median wall time | Original main | Original PR | Current main | Guarded indexed PR | | --- | ---: | ---: | ---: | ---: | | Candidate query | 0.08 ms | 33.85 ms | 0.09 ms | 0.43 ms | | Family preview | 12.76 ms | 48.19 ms | 13.47 ms | 14.48 ms | | Archive one 11-thread family | 176 ms | 425 ms | 183 ms | 178 ms | | Archive 50 threads, including previews | 654 ms | 11.44 s | 671 ms | 778 ms | 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_candidates` and 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 in `getThreadOwner`. ## Verification - **Seeded parity.** On a LastCode database seed, current main and the indexed head selected and archived the same 27 threads across three real historical families. Archive events and exact restore cohorts matched. Each case used its own disposable copy, production dispatch, and the production archive runner, with the background worker disabled. The seed stayed byte-for-byte identical. - **Tests.** Archive and promotion server tests, the saved-workspace regression, Chromium confirmation tests, compiled web tests, and mobile and shared unit tests passed. Quick CI passed on the current head. Three bulk-archive regressions cover shared members in both orders and a refresh that finds new work. The database recovery, migration, and archive suites verify guarded lookups on legacy data and index selection. - **Browser.** The isolated browser applied the default cascade across two projects, and the user-authored conversation stayed open. - **Evals.** The new tool eval passed 0/4 on the baseline and 4/4 after the first tool change. The idle control passed 3/3 on both. The rebased tool text passed all 12 scored samples, including 3/3 for the typed-in branch and 2/2 for the idle control. The provider stream ended early on three samples, which remained unscored. - **Context growth.** The measured agent tool list grew by 314 bytes (85,690 → 86,004). The budget changes by one line. <details><summary>Browser evidence</summary> The existing archive menu on the synthetic fixture. <img width="840" alt="Archive option in the existing thread menu" src="https://github.com/user-attachments/assets/87994587-c683-4fd7-9b1a-3e2cb0353b39" /> The cross-project preview with the typed-in conversation kept open. <img width="840" alt="Archive preview with projects, selection, and a keep-open conversation" src="https://github.com/user-attachments/assets/da231c65-2c75-49c1-b7f8-00bb46c4e810" /> 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. | Before | After | | --- | --- | | <img width="414" alt="After opt-in, the saved copy still appears under retained copies" src="https://github.com/user-attachments/assets/71bd3d69-c49e-43a1-be6f-24559f768658" /> | <img width="414" alt="After opt-in, the shared saved copy appears in the list to discard" src="https://github.com/user-attachments/assets/3176ef20-d563-4775-bf04-b3adeac23810" /> | </details> ## Upstream-owned files | File | Added | Removed | | --- | ---: | ---: | | `apps/mobile/src/features/home/useThreadListActions.test.ts` | 4 | 0 | | `apps/server/src/mcp/toolkits/thread/handlers.ts` | 6 | 0 | | `apps/server/src/mcp/toolkits/thread/tools.ts` | 4 | 2 | | `apps/server/src/orchestration-v2/Orchestrator.ts` | 6 | 35 | | `apps/server/src/orchestration-v2/ProjectionStore.ts` | 3 | 1 | | `apps/server/src/orchestration-v2/ThreadManagementService.ts` | 2 | 1 | | `apps/server/src/provider/agentContextBudget.json` | 1 | 1 | | `packages/client-runtime/src/operations/commands.ts` | 8 | 0 | | `packages/contracts/src/orchestrationV2.ts` | 4 | 0 | | Each of `apps/mobile/src/i18n/translations/{de,en,es,fr,ja,ko,pt-BR,ru,sv,zh}.json` | 3 | 0 | | Each of `apps/web/src/i18n/translations/{de,en,es,fr,ja,ko,pt-BR,ru,sv,zh}.json` | 5 | 0 | 🤖 Generated with [Claude Code](https://claude.com/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. Carry-Source-Ref: refs/lastcode/carry-sources/pr-764/51687d0e8003745ca2058df231e4d0fcf7e87310 Carry-Source-Base: afdac03 Carry-Source-Head: 51687d0
## Problem The Test Web 2 job failed on an uncaught throw. All of its assertions passed. ([failed job](https://github.com/lastobelus/lastCode/actions/runs/44634797451/job/135950514783)) The old hidden-capture test never stubbed `setCaptureDrawn`. If the second frame ran before teardown, the bridge fixture threw synchronously from the empty queue's immediate operation path. That happened before a promise handler could attach. Unmounting between the two frames canceled the second frame, so the job's result depended on that ordering. #761 already added the missing stub on `lastcode/main`. ## Fix The test now drives both frames with the fake clock. It asserts exactly one capture-drawn notification before teardown and checks the slot's hidden, visible, and released states. Only `apps/web/src/browser/HostedBrowserWebview.browser.test.tsx` changes. ## Checks - **Controlled frames.** Running the second frame while mounted reproduced the CI stack with the historical fixture. Unmounting between the frames passed. - **Chromium.** All 20 tests passed. - **Gates.** `vp run check:changed origin/lastcode/main` and local Quick CI passed. Local review: 1 round with Codex Terra (xhigh), approved. Carry-Source-Ref: refs/lastcode/carry-sources/pr-778/aa9850ceeb65314bd34ea2de85f8ef66f1e79144 Carry-Source-Base: fc3c914 Carry-Source-Head: aa9850c
) Test-only. The hosted-preview browser fixtures listed every `DesktopPreviewBridge` method, so each unrelated bridge addition meant editing the fixture, and that edit tended to land in checkpoint merges. This PR makes the fixture track the real bridge type instead. **Why it was like this:** #599 made the bridge factory exhaustive after a missed `setShown`. #761 and #778 later repaired capture-callback coverage. The exhaustive list is what caused the drift. **Change** - **Bridge factory:** takes `Partial` of the real bridge for explicit typed overrides. Any method a test doesn't override is a lazy named failure that throws if called, including nested methods. A missing override fails loudly instead of silently passing. - **Defaults kept:** the two existing optional-listener no-op defaults are unchanged. - **Coverage kept:** both existing browser test files match the base. No test cases were removed; mounted guest-creation assertions remain intact. - **Product code:** none changed. **Validation** - The existing 38 browser cases pass on the base and on this branch. - Two new fixture tests fail against the old factory and pass now. - I temporarily added a required method to the real `DesktopPreviewBridge`. The old factory failed with TS2322; the new one typechecked (exit 0). The edit was reverted. - Changed-file checks and Quick CI passed. - Local review: 2 rounds with gpt-6.1-terra (xhigh) at 8cee95b, approved. The first round's mounted-coverage finding was fixed before the clean second round. Implemented with Codex gpt-6.1-sol (xhigh) in the Codex harness. Carry-Source-Ref: refs/lastcode/carry-sources/pr-844/8cee95b2fd04c5e1eb34c083320b23beb3f383b1 Carry-Source-Base: a2e12ce Carry-Source-Head: 8cee95b
Part of #751
Problem
Agents create throwaway projects for evaluations and other one-off runs with
t3_project_create. Today these land in the same project lists as real work and pile up in the sidebar and pickers.What changes
Agent-created temporary projects are recorded with their creating thread and hidden by default. Keep project makes one visible with the rest and leaves its workspace and creating thread intact. PR D owns removal at wrap-up.
Paths
temporary: truetot3_project_createwhen registering a throwaway project by path or title.t3_project_createin the same environment to set owner and marker.t3_project_update({ projectId, keepTemporary: true })or the Keep project UI action, which makes the same transition under normal project write rules. The marker clears and the owner stays, so the project drops out of temporary-owner queries immediately.t3_project_listandt3_project_readreturn owner and temporary status.t3_project_list(temporaryOwner: { environmentId, threadId })filters to one thread's temporary projects. PR D can callProjectService.listTemporaryOwnedBy(owner)in each environment to enumerate them.Storage
Project lifecycle events and the SQLite project projection store
{ owner: { environmentId, threadId }, temporary?: true }. The fields are absent for earlier projects. Client create and update payloads cannot set ownership or the marker.Client scope
The LastCode sidebar hides temporary project rows by default and keeps their threads in the sidebar and keyboard navigation. Show temporary projects reveals the rows for the current client session. Older settled threads remain available through the existing sidebar paging control.
On web and desktop, the command palette, new-thread and draft project pickers, and automatic draft destinations skip hidden temporary checkouts. The palette filters picker candidates before grouping, and its contextual actions use the full project groups. This keeps mixed-repository checkouts out of starting-work choices while the current thread can still use its own project. Direct links and thread lookups remain available. A draft opened through a temporary checkout keeps that checkout in its machine choices.
The existing Project Settings panel offers Keep project for each temporary checkout with project write access. The rest of Settings continues using its existing groups and selection. Four new strings ship in all ten web catalogs.
The default sidebar, mobile, PR and Issues filters, scheduled tasks, prompt links, and broader Settings changes are parked in draft #766. That draft preserves the complete previous head and tracks the selector candidates from #765. Provider adapters and the Electron shell use their existing paths.
Verification
b1a13da402c102b56fa975d000766f0d746ccd4d. After reconciling the thread-ownership sidebar changes from feat(sidebar): place owned threads with their owner #762, 105 focused tests passed. GitHub twice hit a missing callback in a fork-owned browser test fixture. The fixture now supplies it, and all 20 tests in that file passed.bd1d85a60826a0122a4708477b4efcf7b069afdcwere fixed with regression tests.dafc448b926414a3cc75d457bef104e9bfdd2fb3. The subsequent sidebar rebase preserved the tool text and schema. The targeted throwaway registration case improved from 0/2 to 2/2. Ordinary registration and the archive-via-update control each passed 2/2 on the candidate. The broader pre-rebase run passed 270 of 292 completed samples, with nine additional errors. All three project-tool cases passed in the broad run.Screenshots
Captured in the LastCode sidebar with isolated fixtures.
The LastCode sidebar keeps the thread available while its temporary project row is hidden.
35 upstream-owned files touched
The full snapshot touched 76 upstream-owned files. A path is upstream-owned when
git cat-file -e origin/main:<path>succeeds. Counts usegit diff --numstat.apps/server/src/mcp/toolkits/project/handlers.tsapps/server/src/mcp/toolkits/project/tools.tsapps/server/src/orchestration-v2/ProjectCommands.tsapps/server/src/orchestration-v2/ProjectStore.tsapps/server/src/orchestration-v2/ThreadLaunchService.test.tsapps/server/src/project/ManagedProjectFolders.tsapps/server/src/project/ProjectMutation.tsapps/server/src/project/ProjectService.tsapps/server/src/provider/agentContextBudget.jsonapps/server/src/relay/AgentAwarenessRelay.test.tsapps/web/src/components/CommandPalette.tsxapps/web/src/components/CommandPaletteLookups.tsapps/web/src/components/chat/DraftHeroHeadline.tsxapps/web/src/components/settings/ProjectSettingsPanel.tsxapps/web/src/hooks/useHandleNewThread.test.tsapps/web/src/hooks/useHandleNewThread.tsapps/web/src/hooks/useLogicalProjectEnvironments.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.jsonapps/web/src/routes/_chat.index.tsxpackages/client-runtime/package.jsonpackages/client-runtime/src/operations/commands.test.tspackages/client-runtime/src/operations/commands.tspackages/contracts/src/applicationEvent.tspackages/contracts/src/index.tspackages/contracts/src/orchestrationProject.tspackages/contracts/src/project.ts