Skip to content

feat(sidebar): place owned threads with their owner - #762

Merged
lastobelus merged 4 commits into
lastcode/mainfrom
lastcode/sidebar-owned-threads
Nov 20, 2026
Merged

lastobelus merged 4 commits into
lastcode/mainfrom
lastcode/sidebar-owned-threads

Conversation

@lastobelus

@lastobelus lastobelus commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Part of #751.

Some owned threads appeared at the top level even when their orchestrator was visible. The LastCode sidebar now uses the recorded owner to place them.

🧭 The graph rule

Each logical project resolves owners from the shells it already has, using environment and thread ID together. An owned thread uses its explicit placement when the target is visible. Otherwise it nests under a visible owner in the same logical project, or appears in a derived group in the destination project. The grouping is display-only.

📐 Rules

# Rule Behavior
1 Owned threads An owned thread always has an owner or a group above it in the sidebar.
2 Same project The child nests under its owner, including across connected environments when both projects share the existing repository group.
3 Different project The destination shows one collapsed group per owner. The label uses the owner's title, and its link opens the owner.
4 Historical threads Stored creator provenance alone keeps the thread's existing placement. A released thread can appear as a root.
5 Explicit placement A valid non-null groupedUnderThreadId wins, including a stored group thread. The sidebar creates the other groups in memory.
6 Unavailable owner The fallback group opens by default. Its label comes from the owner's loaded shell or stored remote title. If neither supplies a title, it shows the translated “Creator unavailable” label with the owner ID. Selection keeps the active path visible through collapse. Rows reattach when normal shell loading brings the owner in. Cycles break into reachable groups.
7 Attribution The row and menu read stored creatorOrigin, delegatedFrom, and the legacy creatorThreadId. An unavailable creator can still be named.

🎯 Surfaces and decisions

  • Shared surfaces: LastCode web and desktop share the placement code, project menu, keyboard order and Command Palette search.
  • Attention: Sidebar attention rolls up from descendants and from collapsed owner groups. Pending approval and user input stay visible in the group status. A collapsed destination group also shows direct child failures.
  • Palette listing: The initial jump list keeps the existing exclusion for subagents and delegated tasks represented by a visible owner. A typed search can find an owned task whose owner is unavailable.
  • Hidden tags: The LastCode sidebar and search apply hidden tags to each thread's own tags, so a hidden owner leaves independently visible work discoverable. Existing older-settled paging brings in more shells through the same projection.
  • Not changed: Inbox, the default sidebar and native mobile keep their own navigation, since this issue targets the LastCode sidebar. Command Palette in Inbox mode keeps its existing list policy.
  • Data source: The graph reads provider-neutral shell metadata for local and connected environments.
  • Out of scope for PR C: launch tools, scheduled work, native routes, settings controls, RPCs, persistence and server-side lifecycle. Archive and promote belong to PR D, temporary project visibility to PR E. Existing menu mutations are preserved.
  • Promote integration: PR feat(threads): promote owned threads to top level and return them to their owner #763 supplies Promote and Return to owner. The rebased menu keeps those actions and the creator label. Legacy grouping still writes explicit placement to the existing eligible local creator.
  • Follow-up: Store the owner’s title at launch so the fallback group can name an owner whose shell is unavailable.
  • Copy and docs: New group controls reuse existing translated strings. No user documentation update is needed.

✅ Verification

Tests. 112 focused unit tests, 49 focused browser tests, 15 React Compiler checks, web type checking and targeted lint passed. Local Quick CI is deferred to the required GitHub checks.

Browser. Before and after were captured in the same isolated dev browser, using Replay threads and two real connected dev environments on one machine.

  • Fixture scopes: same-project launch, remote task in the same repository group, cross-project group, disconnected owner, and an independent comparison.
  • Synthetic ownership: the ownership records are synthetic, applied to the isolated projection databases. The app itself loaded and rendered the shells. The after image shows the fallback using a stored title. A separate isolated app fixture with an untitled owner showed the translated “Creator unavailable” label, with the child visible and the group expanded.
  • Checked: Search opened the collapsed cross-project child, and the group link returned to the owner, clearing the previous selection and setting the new selection anchor.

Performance. Browser measurement rebuilt the thread index and projected 40 projects, with mixed local, remote, independent and cross-project shells. Eight warmups, then 25 paired samples that alternated order. Values are before → after.

Shells Median (ms) p90 (ms)
4,000 5.3 → 7.4 6.0 → 8.3
12,000 14.6 → 19.6 18.7 → 22.4

This measures graph projection and indexing only. It excludes sorting, React rendering and shell transport. Ownership lookup and graph traversal are bounded by the number of loaded shells, and there are no extra transcript reads.

🧱 Upstream-owned files

Each changed path was checked against origin/main.

File Added Removed
apps/web/src/components/CommandPalette.logic.ts 7 5
apps/web/src/components/CommandPaletteThreadItems.tsx 3 4

Before and after

Before After
Owned threads appeared as project roots Same-project children nest under their owner, with a collapsed destination group and an open fallback group

Local review: 2 initial full-diff rounds, 1 orchestrator-fix delta round and 1 post-rebase full-diff round with Codex Terra 6.1 (xhigh), approved.

GPT-6.2 Sol high via Codex in LastCode.

@lastobelus lastobelus changed the title Group owned threads under their orchestrator in the LastCode sidebar feat(sidebar): place owned threads with their owner Nov 20, 2026
@lastobelus
lastobelus marked this pull request as ready for review November 20, 2026 00:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 20, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-20T01:56:09.626614Z 54f369a Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 50a2991a9f

ℹ️ 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".

@lastobelus
lastobelus force-pushed the lastcode/sidebar-owned-threads branch from 50a2991 to 7b2a751 Compare November 20, 2026 00:43
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Another round soon, please!

Reviewed commit: 7b2a751f82

ℹ️ 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".

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: faa40fe866

ℹ️ 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".

@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 05245c8ad3

ℹ️ 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".

Show owned threads under their orchestrator or in a destination project group, and keep them reachable when the owner is unavailable. Resolve creator labels from the recorded origin.

GPT-6.2 Sol high via Codex in LastCode.

Carry-Fix: #751
Carry-Group: incubator
Carry-Observation: Sidebar ownership and attribution extend the placement graph and creator menu changes already carried in Incubator.
Open the owner through normal sidebar navigation and keep direct failures visible on a collapsed destination group.

GPT-6.2 Sol high via Codex in LastCode.

Carry-Fix: #751
Carry-Group: incubator
Carry-Observation: Sidebar ownership and attribution extend the placement graph and creator menu changes already carried in Incubator.
Keep delegated work out of the normal jump list and allow typed searches for orphaned tasks. Use the existing translated creator label when an owner has no title.

GPT-6.2 Sol high via Codex in LastCode.

Carry-Group: incubator
Carry-Fix: #751
Remove the static fallback-label assertion. The focused projection and navigation regressions continue to cover changes in behavior.

GPT-6.2 Sol high via Codex in LastCode.

Carry-Group: incubator
Carry-Fix: #751
@lastobelus
lastobelus force-pushed the lastcode/sidebar-owned-threads branch from 05245c8 to 54f369a Compare November 20, 2026 01:52
@lastobelus

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 54f369a59c

ℹ️ 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".

@lastobelus
lastobelus merged commit c3e8c33 into lastcode/main Nov 20, 2026
21 checks passed
@lastobelus
lastobelus deleted the lastcode/sidebar-owned-threads branch November 20, 2026 02:06
lastobelus added a commit that referenced this pull request Nov 20, 2026
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

- **Create.** Every agent registration records the owner. Pass `temporary: true` to `t3_project_create` when registering a throwaway project by path or title.
  - Local registration records the authenticated calling thread as owner.
  - Linked registration records the authenticated sender, from the same creator lookup as thread launch.
  - Temporary registration requires a thread. A standalone MCP client can still register an ordinary project.
  - Clone only creates the checkout. Register the cloned path with `t3_project_create` in the same environment to set owner and marker.
- **Keep.** `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.
- **Query.** `t3_project_list` and `t3_project_read` return owner and temporary status. `t3_project_list(temporaryOwner: { environmentId, threadId })` filters to one thread's temporary projects. PR D can call `ProjectService.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

- Quick CI and same-base carry replay passed on `b1a13da402c102b56fa975d000766f0d746ccd4d`. After reconciling the thread-ownership sidebar changes from #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.
- Local review: 1 round with Codex Terra (xhigh), not clean. The two findings on `bd1d85a60826a0122a4708477b4efcf7b069afdc` were fixed with regression tests.
- Focused checks passed for registration, ownership query, Keep, sidebar and picker behavior, and locale catalogs. The changed-file run passed during the split and was uncached because the review fixes changed files during the run.
- Isolated web QA opened a temporary checkout through its thread link while the project row was hidden, exercised reveal from the LastCode new-thread picker and palette, and opened that checkout’s Project Settings from the palette. Keep removed the control and cleared the marker in the isolated database while retaining ownership.
- Model-facing text and tool schemas are identical to the earlier head. The tool list is 85,690 bytes, up **377 bytes** from 85,313 on the current base. All six focused samples passed on `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.

| Base                                                                                                                                         | Temporary project hidden by default                                                                                               |
| -------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| ![The evaluation workspace is a normal project row on base](https://github.com/user-attachments/assets/15c6e2c4-9c84-4ebc-a129-62a781da5cea) | ![The evaluation workspace is hidden by default](https://github.com/user-attachments/assets/b94b70ca-70d9-45d8-91b6-39b600ff5647) |

| Revealed for this session                                                                                                            | Visible after Keep                                                                                                                             |
| ------------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| ![The evaluation workspace is visible after reveal](https://github.com/user-attachments/assets/bf9675d5-1ed6-43cd-8522-7b28d8ed74c2) | ![The kept workspace is a normal project row with its thread](https://github.com/user-attachments/assets/cb311a14-7d2e-44d2-80e7-10218a065e00) |

The LastCode sidebar keeps the thread available while its temporary project row is hidden.

![An active thread is visible in the LastCode sidebar while the Acme Run Checkout project row is hidden](https://github.com/user-attachments/assets/20252859-f984-4f01-89d1-526b2f9b3f81)

<details>
<summary>35 upstream-owned files touched</summary>

The full snapshot touched 76 upstream-owned files. A path is upstream-owned when `git cat-file -e origin/main:<path>` succeeds. Counts use `git diff --numstat`.

| File                                                           | Added | Removed |
| -------------------------------------------------------------- | ----: | ------: |
| `apps/server/src/mcp/toolkits/project/handlers.ts`             |    21 |      14 |
| `apps/server/src/mcp/toolkits/project/tools.ts`                |     8 |       3 |
| `apps/server/src/orchestration-v2/ProjectCommands.ts`          |     6 |       0 |
| `apps/server/src/orchestration-v2/ProjectStore.ts`             |    10 |       0 |
| `apps/server/src/orchestration-v2/ThreadLaunchService.test.ts` |     1 |       0 |
| `apps/server/src/project/ManagedProjectFolders.ts`             |    15 |       8 |
| `apps/server/src/project/ProjectMutation.ts`                   |     1 |       0 |
| `apps/server/src/project/ProjectService.ts`                    |    58 |      28 |
| `apps/server/src/provider/agentContextBudget.json`             |     1 |       1 |
| `apps/server/src/relay/AgentAwarenessRelay.test.ts`            |     1 |       0 |
| `apps/web/src/components/CommandPalette.tsx`                   |    12 |       4 |
| `apps/web/src/components/CommandPaletteLookups.ts`             |    14 |      10 |
| `apps/web/src/components/chat/DraftHeroHeadline.tsx`           |     5 |       2 |
| `apps/web/src/components/settings/ProjectSettingsPanel.tsx`    |     2 |       0 |
| `apps/web/src/hooks/useHandleNewThread.test.ts`                |     7 |       0 |
| `apps/web/src/hooks/useHandleNewThread.ts`                     |     4 |       2 |
| `apps/web/src/hooks/useLogicalProjectEnvironments.ts`          |     2 |       2 |
| `apps/web/src/i18n/translations/de.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/en.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/es.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/fr.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/ja.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/ko.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/pt-BR.json`                    |     5 |       1 |
| `apps/web/src/i18n/translations/ru.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/sv.json`                       |     5 |       1 |
| `apps/web/src/i18n/translations/zh.json`                       |     5 |       1 |
| `apps/web/src/routes/_chat.index.tsx`                          |     2 |       1 |
| `packages/client-runtime/package.json`                         |     4 |       0 |
| `packages/client-runtime/src/operations/commands.test.ts`      |    16 |       0 |
| `packages/client-runtime/src/operations/commands.ts`           |     3 |       0 |
| `packages/contracts/src/applicationEvent.ts`                   |     3 |       0 |
| `packages/contracts/src/index.ts`                              |     1 |       0 |
| `packages/contracts/src/orchestrationProject.ts`               |     2 |       0 |
| `packages/contracts/src/project.ts`                            |     3 |       0 |

</details>

Carry-Source-Ref: refs/lastcode/carry-sources/pr-761/b1a13da402c102b56fa975d000766f0d746ccd4d
Carry-Source-Base: c3e8c33
Carry-Source-Head: b1a13da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant