Repository navigation
Conversation
One server per machine serves several people, each with their own workspace, instead of one server and port per person. Covers principals bound to the pairing subject, owner-stamped threads and projects, fail-closed RPC and HTTP surfaces, per-principal execution (recommends a per-user runner over one OS user with per-principal HOMEs), peer links per principal, migration, the threat model including pingdotgg#26490, and a C2 outline for groups. Also adds an unposted draft reply for Ideas pingdotgg#12283.
A pairing grant or session issued with --principal <id> carries subject principal:<id>. Threads that session creates are stamped with ownerPrincipal, and shell, thread, history and dispatch paths over WebSocket and HTTP only show or act on threads the caller's principal owns. Other threads fail as not found. Principals are capped at orchestration scopes, may call only an allowlist of RPCs, and every other scoped HTTP, raw and media route fails closed for them. Existing subjects map to the default "owner" principal, so single-user state and behavior are unchanged. Projects, MCP tool reads and per-principal execution are not covered yet; see docs/internals/multi-user.md.
Upstream's CI needs Blacksmith runners, so the fork gets one hosted job that typechecks and runs the contracts and server suites on pull requests.
Codex Review SummaryThis 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: e455d558ed
ℹ️ 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".
| export const threadVisibleTo = ( | ||
| principal: string, | ||
| thread: { readonly ownerPrincipal?: string | undefined }, | ||
| ) => (thread.ownerPrincipal ?? DEFAULT_PRINCIPAL_ID) === principal; |
There was a problem hiding this comment.
Enforce principal ownership in MCP thread reads
When an agent running in a principal-owned thread calls t3_thread_read with another thread ID, the MCP read path does not apply this visibility check: OrchestratorMcpService.loadReadableThread accepts any existing thread. This bypasses the new HTTP and WebSocket checks and lets the agent read another principal’s transcript. Apply the same ownership check to MCP reads before returning thread data.
Useful? React with 👍 / 👎.
| export const PRINCIPAL_RPC_METHODS: ReadonlySet<string> = new Set([ | ||
| ORCHESTRATION_V2_WS_METHODS.subscribeShell, | ||
| ORCHESTRATION_V2_WS_METHODS.subscribeThread, | ||
| ORCHESTRATION_V2_WS_METHODS.dispatchCommand, |
There was a problem hiding this comment.
Provide principals a safe new-thread launch path
When a principal sends the first message in a new draft or worktree through the standard web composer, startThreadTurn calls orchestration.launchThread, which this allowlist rejects before its handler runs; no thread or first turn is created. Add a principal-aware launch path that assigns the caller as owner, rather than leaving the normal new-thread flow unavailable to principals.
Useful? React with 👍 / 👎.
| threadManagement.readShellSnapshot({ location: "active", threadIds }), | ||
| latestSequence: applicationEvents.latestApplicationSequence, | ||
| }).pipe( | ||
| Effect.map((page) => ({ ...page, threads: scopeThreadList(principal, page.threads) })), |
There was a problem hiding this comment.
Filter older-settled rows before paginating
When principals' older settled threads share a page, listOlderSettledThreads applies its row limit before this owner filter. The client pagesAtom treats any response with fewer than 25 visible threads as the end of history, so even one hidden row can make it stop and omit that principal's later older threads. Filter by owner before applying the page limit, or provide a continuation cursor based on the unfiltered page.
Useful? React with 👍 / 👎.
…threads Agents reading or changing a thread through MCP now pass the same visibility check as clients: an agent acts as its thread's owner, and an outside MCP client as the default principal. Principals can launch threads; the launch is stamped with the caller's principal and a reused thread must be visible. The older-settled page filters by owner before its limit, so a hidden row no longer ends a principal's pagination early.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1024bf39b6
ℹ️ 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".
| yield* assertThreadOwnedByCallerPrincipal( | ||
| parent?.thread.ownerPrincipal ?? DEFAULT_PRINCIPAL_ID, | ||
| shell, | ||
| () => | ||
| threadNotFound(threadManagement, threadId, `Thread ${threadId} is no longer available.`), |
There was a problem hiding this comment.
Filter principal-owned MCP thread listings
When an agent in a non-owner thread calls t3_thread_list for a shared project or with allProjects: true, this guard protects direct reads, but OrchestratorMcpService.listThreads still paginates unfiltered shells. The result exposes other principals’ thread titles, statuses, linked PRs, and run metadata; filter by the caller thread’s owner before pagination.
Useful? React with 👍 / 👎.
t3_thread_list and t3_thread_search now filter by the calling thread's owner before pagination and the hit limit, so a principal's agent sees neither the other principals' threads nor short pages. Threads an agent launches through t3_thread_launch inherit its owner.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de34a9f8a2
ℹ️ 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".
| }; | ||
|
|
||
| /** Everything else stays denied to a non-default principal: those methods act as the server's OS user or across all workspaces. */ | ||
| export const PRINCIPAL_RPC_METHODS: ReadonlySet<string> = new Set([ |
There was a problem hiding this comment.
Allow principals to search within their own threads
When the server advertises threadFind, ChatView enables Find and useThreadFind sends searchThread or searchThreadStream; neither RPC is in this allowlist, so authorization rejects Find requests even for the principal’s own thread. Add per-thread ownership checks to those handlers before allowing the methods.
Useful? React with 👍 / 👎.
| `Thread ${threadId} is no longer available.`, | ||
| ); | ||
| } | ||
| yield* assertThreadOwnedByCallerPrincipal( |
There was a problem hiding this comment.
Check ownership before waiting on a thread
When a principal’s agent calls t3_thread_wait with another principal’s thread ID, this guard only covers loadReadableThread; the wait tool goes through loadScopedThread/loadTargetThread without checking ownership, then returns the target run ID and status while waiting on its run. Apply the visibility check before that wait so principals cannot observe another workspace’s activity.
Useful? React with 👍 / 👎.
Principals could not search their own threads because searchThread and searchThreadStream were missing from the principal RPC allowlist. Both now check thread visibility first. t3_thread_wait and the other tools that resolve a target through loadScopedThread skipped the ownership check; they now fail with thread_not_found for another principal's thread.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a021339b35
ℹ️ 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".
| ...(input.reuseExistingThread === undefined | ||
| ? {} | ||
| : { reuseExistingThread: input.reuseExistingThread }), | ||
| projectId: input.projectId, |
There was a problem hiding this comment.
Validate project ownership before launching
When a non-owner principal uses the new-thread composer and selects another user's project from the unfiltered shell, this handler accepts the supplied projectId without checking project ownership. It stamps the new thread as the caller's, but the agent still launches in that project's workspace. Filter projects by owner and reject launches against projects the principal does not own.
Useful? React with 👍 / 👎.
| ORCHESTRATION_V2_WS_METHODS.searchThread, | ||
| ORCHESTRATION_V2_WS_METHODS.searchThreadStream, |
There was a problem hiding this comment.
Allow owner-scoped global thread search
When a principal uses the normal sidebar or command-palette search, useThreadSearch sends searchThreads for message matches, but this allowlist includes only the per-thread search variants, so the global search RPC is rejected and message hits are unavailable. Add an owner-filtered search path before allowing searchThreads, since its current handler can search across principals' threads.
Useful? React with 👍 / 👎.
| ORCHESTRATION_V2_WS_METHODS.getThreadProjection, | ||
| ORCHESTRATION_V2_WS_METHODS.getTurnItem, | ||
| ORCHESTRATION_V2_WS_METHODS.getOlderSettledThreads, | ||
| ORCHESTRATION_V2_WS_METHODS.getArchivedShellSnapshot, |
There was a problem hiding this comment.
Keep omitted thread families readable for principals
When a principal connects, the server advertises shellThreadFamilies, so the shell omits idle subagents and the client requests getThreadFamily to load them. This allowlist rejects that request, leaving those threads absent and queued messages targeting omitted children waiting; provide an owner-scoped family read or stop omitting those rows for principals.
Useful? React with 👍 / 👎.
| WS_METHODS.serverProbe, | ||
| WS_METHODS.serverGetConfig, | ||
| WS_METHODS.subscribeServerConfig, | ||
| WS_METHODS.subscribeServerLifecycle, |
There was a problem hiding this comment.
Allow principals to stop their own runs
When a principal opens an owned thread with an unresponsive run or workflow subagent, the UI shows its Force stop/Stop control because the principal has orchestration:operate, but forceStopThread and stopWorkflow are absent from this allowlist and are rejected before their handlers run. Add owner checks and allow these per-thread operations, or hide the controls, so advertised stop actions do not always fail.
Useful? React with 👍 / 👎.
|
Note 🤖 Claude Opus 5.5 responding on behalf of caniko Superseded by #6, which rebased these commits onto the 20261104 nightly and merged them into |
Fork-internal PR, not for upstream. Upstream needs an approved Ideas discussion first; the unposted draft for pingdotgg#12283 is in
docs/proposals/multi-user-ideas-draft.md.One T3 Code server per machine should serve several people, each with their own workspace, instead of one server and port per person. This branch has the design and the first slice (C1a).
docs/internals/multi-user.mdcovers principals, workspaces, per-principal execution (it recommends a per-user runner over one OS user with per-principal HOMEs), peer links per principal, migration, the threat model including [Bug]: Guest share stream ships owner thread events (worktree path, branch, file lists) past the filtered guest view pingdotgg/t3code#26490, and an outline of C2 (groups and collaboration).t3 auth pairing create --principal <id>/t3 auth session issue --principal <id>mint credentials with subjectprincipal:<id>, capped at orchestration scopes. Existing subjects map to the defaultownerprincipal, so single-user behavior is unchanged.ownerPrincipal, inherited the same way aslinkOrigin. Shell, thread, history and dispatch over WebSocket and HTTP go through one visibility helper, and other principals' threads fail as not found.Not done yet: project ownership (migration 077), principal filtering for MCP tool reads, per-principal execution (runner), and importing an existing per-user server's state.
Council review
Rounds: 1 (question: close as superseded by #6)
🤖 Generated with Claude Code