Repository navigation
Conversation
…its runner On a shared server, a signed-in person's agents must run as their own Linux user, not as the server's. `t3 runner` serves spawn requests on a unix socket (socket-activated or --socket, 0660), refuses root, confines cwd to the user's home and --allow-root dirs, and refuses overrides of HOME, PATH, loader and shell variables. PrincipalExecution picks the thread owner's runner for non-default principals and fails closed when it is missing; the default principal still spawns in-process. Codex app-server, the Claude SDK (via spawnClaudeCodeProcess) and terminal PTYs (and so setup scripts) go through it.
… user Providers without a runner path (cursor, opencode, grok, pi, fx, muse, acpRegistry, antigravity) now refuse to open for a thread owned by a non-default principal instead of running as the server user. Git, gh and other server processes whose cwd lies in a principal's thread worktree go through that principal's runner (GitVcsDriverCore.executeRaw and ProcessRunner), so checkpoints and diffs run as the owner. A cwd owned by several principals, or a missing runner, fails closed.
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: a249863dd3
ℹ️ 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".
| child.stdout!.on("data", (chunk: Buffer) => send({ t: "out", s: "stdout", d: encode(chunk) })); | ||
| child.stderr!.on("data", (chunk: Buffer) => send({ t: "out", s: "stderr", d: encode(chunk) })); |
There was a problem hiding this comment.
Apply backpressure to runner output
When a runner-launched process produces output faster than the client consumes it, these listeners keep reading even after sendFrame signals socket backpressure. The queued frames can grow without bound and exhaust runner memory; pause the child streams when the socket is full and resume them on drain.
Useful? React with 👍 / 👎.
| const { socketPath } = options; | ||
| if (NodeFs.existsSync(socketPath)) { | ||
| if (!(await isStale(socketPath))) throw new Error(`A runner is already listening on ${socketPath}.`); | ||
| NodeFs.unlinkSync(socketPath); |
There was a problem hiding this comment.
Preserve non-socket files at the configured path
If the configured path already exists as a regular file, the connect probe fails with ECONNREFUSED, so this treats it as stale and deletes it before starting the runner. Check the existing entry’s type and only unlink a stale socket; otherwise, fail without removing unrelated data.
Useful? React with 👍 / 👎.
| FROM orchestration_v2_projection_threads | ||
| WHERE deleted_at IS NULL | ||
| AND json_extract(payload_json, '$.ownerPrincipal') IS NOT NULL | ||
| AND json_extract(payload_json, '$.ownerPrincipal') != ${DEFAULT_PRINCIPAL_ID} |
There was a problem hiding this comment.
Include the default principal in worktree owner conflicts
If a default-owned thread and a non-default thread share a worktree path, this filter omits the default owner, leaving only the non-default owner in the result. spawnerForPath then routes Git and other processes for that path through the non-default user instead of failing closed, so include default ownership when detecting ambiguous paths.
Useful? React with 👍 / 👎.
| const child = yield* (runnerSpawner ?? commandSpawner) | ||
| .spawn( | ||
| ChildProcess.make(executable, commandInput.args, { | ||
| cwd: commandInput.cwd, |
There was a problem hiding this comment.
Keep temporary Git indexes accessible to the runner
When a non-default thread uses selected-file commits, prepareCommitContext creates its temporary index in a server-owned directory and passes that path as GIT_INDEX_FILE. Git now runs as the principal's runner user, which cannot traverse that directory, so selected-file commits fail with a permission error; create the temporary index under the runner identity or otherwise make it accessible.
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-only, stacked on #2. A signed-in principal's work runs as that person's Linux user through
t3 runner, a unix-socket service started byt3-runner@<user>.spawnClaudeCodeProcess), terminal PTYs and setup scripts. Git, gh and other processes run through the runner when their cwd is inside a principal's thread worktree.--allow-root, and refuses overrides of HOME, PATH, loader and shell variables. Socket permissions (0660) are the auth boundary.Known gap: git work in a project root outside any thread worktree still runs as the server user, because projects carry no owner yet.
Council review
Rounds: 1 (question: close as superseded by #6)
🤖 Generated with Claude Code