Skip to content

feat(threads): move a thread to another project - #41

Merged
pnupu merged 3 commits into
mainfrom
t3/move-thread-project
Nov 25, 2026
Merged

pnupu merged 3 commits into
mainfrom
t3/move-thread-project

Conversation

@pnupu

@pnupu pnupu commented Nov 25, 2026

Copy link
Copy Markdown
Owner

Do not merge yet. Merging starts the fork release, and another issue must be fixed before that release. Merge only after the user says in the T3 thread that the blocking issue is fixed, or says to merge.

A thread could never leave the project it was created in. About 20 autofixedcloud threads on serveri sit in "upcloud siirto" and must move to "autofixed-cloud".

How it works

  • thread.metadata.update takes an optional projectId. The event stays thread.metadata-updated with the full thread, so stored events decode as before and the projection already writes project_id. No migration.
  • The orchestrator rejects a move to the same project, to a missing, deleted or archived project, and while a turn is preparing, starting, running or waiting, or a question is pending.
  • A thread without its own worktree runs in the new project's root on its next turn, so the move detaches its provider sessions like any workspace change. A thread with its own worktree keeps worktreePath and branch.
  • Scheduled tasks bound to the thread follow it through a small event follower (ThreadMoveTaskFollower). It writes only when a thread's project changes.
  • Client thread lists, sidebar groups and the PR feed read projectId from the thread shell, so they follow the move. Settled and snoozed state is per thread and does not change.

Surfaces

  • Sidebar thread menu: "Move to project…" lists the other live projects on the same server. Servers advertise threadProjectMove, so the menu stays hidden on servers that would ignore the field.
  • MCP: t3_thread_update with action: "move", projectId and an optional new title. It refuses the No project folder as a target.
  • Not added: the chat header menu and mobile. Moved threads still show in the right project there.

Checks

  • Tests beside the code: the move decision (accept and each reject), workspace detection, the SQL projection, old command and event decode, the MCP action and its Scratch refusal, and the task follower. 25 tests pass locally.
  • Typecheck passes for contracts, client-runtime, server and web.
  • MCP evals not run (paid models, not in the fork gate).

Model: Claude Opus 5.5 in Claude Code, through T3 Code.

🤖 Generated with Claude Code

pnupu and others added 2 commits November 25, 2026 17:33
A thread could never leave the project it was created in.

`thread.metadata.update` takes an optional `projectId`. The orchestrator
rejects a move to the same project, to a missing, deleted or archived
project, and while a turn is preparing, starting, running or waiting, or
a question is pending. The event stays `thread.metadata-updated` with the
full thread, so stored events decode as before and the projection already
writes `project_id`: no migration.

A thread without its own worktree now runs in the new project's root, so
the move detaches its provider sessions like any workspace change. A
thread with its own worktree keeps `worktreePath` and `branch`.

Scheduled tasks bound to the thread follow it through a small event
follower, whichever client moved it; it writes only when a thread's
project changes. Client thread lists are derived from the thread shell,
so the sidebar groups follow the new `projectId`.

Surfaces: a "Move to project…" submenu in the sidebar thread menu, listing
the other live projects on the same server, and `t3_thread_update` with
`action: "move"`, `projectId` and an optional new `title`. The MCP action
refuses the No project folder as a target. Servers advertise
`threadProjectMove`, so clients hide the menu on servers that would
ignore the field.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ext says what stays

Review nits on the move feature: the submenu label used the global
message resolver instead of the one the menu builder passes, and the
t3_thread_update description said the workspace cannot change while a
move can change a thread's root.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pnupu
pnupu merged commit ea33fbd into main Nov 25, 2026
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