Skip to content

Commit 33f3ef5

Browse files
committed
Merge branch 'main' into fix/i22307-usage-limit-auto-resume-ignores-allowanc
The merge drops this branch's HostProcess import in ClaudeProvider.ts because main now imports the same module there.
2 parents 3be580b + bc7fe11 commit 33f3ef5

931 files changed

Lines changed: 71215 additions & 44929 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.github/VOUCHED.td‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ github:btsouth
2222
github:cestercian
2323
github:chrisdeeming
2424
github:chuks-qua
25+
-github:coygeek Filed over 270 automated issues, about 50 a day at peak, far past what maintainers can triage
2526
github:cursoragent
2627
github:D3OXY
2728
github:dbalders

‎.github/workflows/agent-context-budget.yml‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,7 @@ on:
1010
permissions:
1111
contents: read
1212

13-
concurrency:
14-
group: agent-context-budget-${{ github.event.pull_request.number }}
15-
cancel-in-progress: true
16-
13+
# No concurrency group: label events arrive in bursts, and a cancelled run reports as a failed check.
1714
jobs:
1815
budget:
1916
name: Agent context budget

‎.github/workflows/issue-vouch.yml‎

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Issue Vouch
2+
3+
on:
4+
issues:
5+
types: [opened, reopened]
6+
push:
7+
branches:
8+
- main
9+
paths:
10+
- .github/VOUCHED.td
11+
- .github/workflows/issue-vouch.yml
12+
workflow_dispatch:
13+
14+
permissions:
15+
contents: read
16+
issues: write
17+
18+
concurrency:
19+
group: issue-vouch-${{ github.event.issue.number || 'all' }}
20+
cancel-in-progress: true
21+
22+
jobs:
23+
label:
24+
name: Label issues by author trust
25+
runs-on: ubuntu-24.04
26+
steps:
27+
- uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
28+
with:
29+
script: |
30+
const { owner, repo } = context.repo;
31+
// Only listed authors get a label; open issues number in the thousands,
32+
// so unvouched is the default and stays unlabelled.
33+
const labelByStatus = { vouched: "vouch:trusted", denounced: "vouch:denounced" };
34+
const managedLabelNames = new Set(["vouch:trusted", "vouch:unvouched", "vouch:denounced"]);
35+
36+
const { data: file } = await github.rest.repos.getContent({
37+
owner,
38+
repo,
39+
path: ".github/VOUCHED.td",
40+
ref: context.payload.repository.default_branch,
41+
});
42+
const statusByUser = new Map();
43+
for (const raw of Buffer.from(file.content, "base64").toString("utf8").split("\n")) {
44+
const match = /^(-?)github:(\S+)/.exec(raw.trim());
45+
if (match) statusByUser.set(match[2].toLowerCase(), match[1] ? "denounced" : "vouched");
46+
}
47+
48+
const issues =
49+
context.eventName === "issues"
50+
? [context.payload.issue]
51+
: (
52+
await github.paginate(github.rest.issues.listForRepo, {
53+
owner,
54+
repo,
55+
state: "open",
56+
per_page: 100,
57+
})
58+
).filter((issue) => !issue.pull_request);
59+
60+
for (const issue of issues) {
61+
const status = statusByUser.get(issue.user.login.toLowerCase());
62+
const next = labelByStatus[status];
63+
const current = issue.labels.map((label) => label.name).filter((name) => managedLabelNames.has(name));
64+
65+
for (const name of current) {
66+
if (name === next) continue;
67+
try {
68+
await github.rest.issues.removeLabel({ owner, repo, issue_number: issue.number, name });
69+
} catch (error) {
70+
if (error.status !== 404) throw error;
71+
}
72+
}
73+
if (next && !current.includes(next)) {
74+
await github.rest.issues.addLabels({ owner, repo, issue_number: issue.number, labels: [next] });
75+
core.info(`Issue #${issue.number} (${issue.user.login}): ${status} -> ${next}`);
76+
}
77+
}

‎.github/workflows/pr-vouch.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,17 @@ jobs:
101101
{
102102
name: "vouch:trusted",
103103
color: "1f883d",
104-
description: "PR author is trusted by repo permissions or the VOUCHED list.",
104+
description: "Author is trusted by repo permissions or the VOUCHED list.",
105105
},
106106
{
107107
name: "vouch:unvouched",
108108
color: "fbca04",
109-
description: "PR author is not yet trusted in the VOUCHED list.",
109+
description: "Author is not yet trusted in the VOUCHED list.",
110110
},
111111
{
112112
name: "vouch:denounced",
113113
color: "d1242f",
114-
description: "PR author is explicitly blocked by the VOUCHED list.",
114+
description: "Author is explicitly blocked by the VOUCHED list.",
115115
},
116116
];
117117

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,5 @@ node_modules/
4949

5050
# pnpm content-addressable store; never belongs in the repo.
5151
.pnpm-store/
52+
53+
/packages/ssh/.ssh-launcher-test-*/

‎AGENTS.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# T3 Code
22

3-
T3 Code is a minimal GUI for coding agents. A Node WebSocket server wraps provider CLIs and agents (Codex, Claude Code, Cursor, Grok, OpenCode, Antigravity, Kiro) and serves web, desktop, and mobile clients.
3+
T3 Code is a minimal GUI for coding agents. A Node WebSocket server wraps provider CLIs and agents (Codex, Claude Code, Cursor, Grok, OpenCode, Antigravity, Kiro, Pi, Muse Code, fx) and serves web, desktop, and mobile clients.
44

55
You can think of T3 Code as an open source "bring-your-own-subscription" alternative to apps like Claude Desktop, Codex App, Cursor Glass and Conductor.
66

@@ -68,7 +68,7 @@ The most common defect in this repo is a change that works on the path you teste
6868

6969
- **Entry points.** A behavior reachable from the chat view is usually also reachable from Settings, the command palette, and a keybinding. Fixing one is not fixing the feature.
7070
- **Clients.** Web, desktop (wraps web, adds Electron shell/IPC), and mobile (React Native, separate navigation). Shared logic lives in `packages/client-runtime`
71-
- **Providers.** Codex, Claude, Cursor, Grok, OpenCode, Antigravity, and Kiro each have an adapter. Provider-shaped features need a decision per adapter, even if the decision is "not supported here".
71+
- **Providers.** Codex, Claude, Cursor, Grok, OpenCode, Antigravity, Kiro, Pi, Muse Code, fx, and ACP Registry each have an adapter. Provider-shaped features need a decision per adapter, even if the decision is "not supported here".
7272
- **Agents.** A capability a user can trigger is usually one an agent should reach through MCP tools, and scheduled tasks run the same paths. That only works when it is a service method, not handler code.
7373
- **Contracts.** Anything crossing the wire is typed in `packages/contracts`. Change the schema and the server, web, mobile, and desktop all follow.
7474
- **Reverse states.** If you added a way in, add the way out and the way to see it. Snooze needs unsnooze. Close needs reopen. A one-way door is a bug.
@@ -83,7 +83,8 @@ The most common defect in this repo is a change that works on the path you teste
8383
- Ports derive from the worktree path and are stable across restarts, but read the real ones from the `[dev-runner]` line since occupied ports shift.
8484
- Sharing over the tailnet is three steps: run `vp run dev --share` in the background, wait for the `pairingUrl:` line in its output, then give that full URL to an unpaired browser. Do not wire up `tailscale serve` by hand, open the URL yourself, or consume the user's pairing link. A browser with the reusable dev cookie can use the bare origin. If a normal one-time token was consumed, mint a fresh one with `node apps/server/src/bin.ts pair`. It carries standard scopes, while the startup URL carries admin scopes needed for Connections settings.
8585
- To reuse web dev auth across worktrees, configure one fixed `T3CODE_DEV_AUTH_TOKEN` in the main checkout's gitignored `.env`. The `t3.json` setup links that file into worktrees. Never commit or publish the token or a startup URL. See [Reusable dev credential](docs/operations/development.md#reusable-dev-credential).
86-
- Stop what you started, by the PID you tracked. See rule 1.
86+
- Stop what you started, by the PID you tracked. See rule 1. `vp` does not pass SIGTERM on, so signalling the `vp run dev` PID alone leaves Vite and the server running. Stop the background task with your harness's own stop, which ends the whole tree.
87+
- Run dev servers, Metro, and builds from your own shell so they end with your session. Do not detach them with `systemd-run`, `nohup`, `setsid`, or `tmux` unless the user asks for one that outlives the session. Detached servers ran for weeks and filled RAM and swap. The dev runner stops itself above `--memory-limit-gb` (half of RAM, at most 16 GiB) on Linux.
8788
- Need a second checkout? `git worktree add` it next to this worktree, not in `/tmp`. Remove it when done.
8889

8990
## Test data
@@ -149,7 +150,7 @@ For mobile verification, a missing or outdated native client is an install step,
149150
## Pull requests
150151

151152
- Never make a PR unless the developer explicitly asks you to do so.
152-
- If `origin` is git.cafe, follow [GitCafe mirror](docs/operations/development.md#gitcafe-mirror-optional): push to `origin`, open and track PRs with `cafe` and their git.cafe URLs, and keep `gh` for merging.
153+
- `origin` is not always GitHub. Check `git remote get-url origin` before your first forge command and use that forge's CLI and skill. See [Forge mirror](docs/operations/development.md#forge-mirror-optional).
153154
- Conventional commit titles, plain language: `fix(web): new threads no longer spike CPU`.
154155
- Body: the problem in a sentence or two, then how you fixed it. End with the model and harness that did the work.
155156
- UI changes need before/after images. Motion or timing needs a short video.

‎apps/desktop/src/app/DesktopClerk.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ it.effect.each(["startup", "open-url", "early-second-instance"] as const)(
424424
),
425425
Effect.provideService(DesktopWebLinks.DesktopWebLinks, ignoreWebLinks),
426426
);
427-
}).pipe(Effect.scoped),
427+
}),
428428
);
429429

430430
it.effect("hands web and app links to the renderer and leaves other links alone", () =>
@@ -481,5 +481,5 @@ it.effect("hands web and app links to the renderer and leaves other links alone"
481481
}),
482482
),
483483
);
484-
}).pipe(Effect.scoped),
484+
}),
485485
);

‎apps/desktop/src/app/DesktopCliCommand.test.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
160160
expect(yield* fs.exists(upgradedLink)).toBe(false);
161161
expect((yield* upgraded.install).installedPath).toBe(upgradedLink);
162162
}
163-
}).pipe(Effect.scoped),
163+
}),
164164
);
165165

166166
it.effect("never replaces or removes a t3 it did not create", () =>
@@ -202,7 +202,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
202202
expect((yield* Effect.flip(command.install)).message).toContain("Could not set up");
203203
yield* command.uninstall;
204204
expect(yield* fs.readFileString(launcher)).toBe("npm's t3\n");
205-
}).pipe(Effect.scoped),
205+
}),
206206
);
207207

208208
it.effect("finds and removes a link left by a previous T3 home", () =>
@@ -259,7 +259,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
259259
);
260260
expect(yield* fs.exists(path.join(home, ".local", "bin", "t3"))).toBe(false);
261261
expect(yield* fs.readFileString(path.join(home, "bin", "t3.staging"))).toBe("mine");
262-
}).pipe(Effect.scoped),
262+
}),
263263
);
264264

265265
it.effect("refuses to install behind another t3 that runs first", () =>
@@ -309,7 +309,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
309309
installedPath: path.join(home, ".local", "bin", "t3"),
310310
});
311311
expect(installed.shadowedBy).toBeUndefined();
312-
}).pipe(Effect.scoped),
312+
}),
313313
);
314314

315315
it.effect.skipIf(HostProcess.Platform.defaultValue() === "win32")(
@@ -343,7 +343,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
343343
onPath: true,
344344
installedPath: path.join(home, ".local", "bin", "t3"),
345345
});
346-
}).pipe(Effect.scoped),
346+
}),
347347
);
348348

349349
it.effect("does not treat its own launcher as another t3 when its folder is first on PATH", () =>
@@ -372,7 +372,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
372372
expect(yield* command.state).toEqual(removed);
373373
expect(yield* fs.exists(installed.installedPath!)).toBe(false);
374374
expect(yield* fs.exists(launcher)).toBe(true);
375-
}).pipe(Effect.scoped),
375+
}),
376376
);
377377

378378
it.effect("leaves the Windows PATH alone when it cannot be read", () =>
@@ -411,7 +411,7 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
411411
const reader = yield* commandIn({ home, platform: "win32" }, inherited.spawner);
412412
yield* reader.install;
413413
expect(inherited.registry).toMatchObject({ path: `${userPath};${launcherDir}`, writes: 1 });
414-
}).pipe(Effect.scoped),
414+
}),
415415
);
416416

417417
it.effect("does not claim or remove a Windows PATH entry the user added", () =>
@@ -441,6 +441,6 @@ it.layer(NodeServices.layer)("DesktopCliCommand", (it) => {
441441
yield* (yield* commandIn({ home: besideHome, platform: "win32" }, beside.spawner))
442442
.installOnFirstLaunch;
443443
expect(beside.registry).toMatchObject({ path: "C:\\Tools", writes: 0 });
444-
}).pipe(Effect.scoped),
444+
}),
445445
);
446446
});

‎apps/desktop/src/app/DesktopCliShim.test.ts‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const run = (shim: string, args: ReadonlyArray<string>, env: NodeJS.ProcessEnv =
3939
});
4040

4141
const REPORTER =
42-
'#!/bin/sh\necho "node=$ELECTRON_RUN_AS_NODE cli=$T3CODE_CLI_PATH home=$T3CODE_HOME"\nprintf "%s\\n" "$@"\nexit 3\n';
42+
'#!/bin/sh\necho "node=$ELECTRON_RUN_AS_NODE cli=$T3CODE_CLI_PATH home=$T3CODE_HOME appimage=$APPIMAGE"\nprintf "%s\\n" "$@"\nexit 3\n';
4343

4444
const fakeAppImage = (canMount = true, app = REPORTER) => {
4545
const root = tempRoot();
@@ -56,7 +56,7 @@ const fakeAppImage = (canMount = true, app = REPORTER) => {
5656
`echo $$ >'${root}/mounter.pid'`,
5757
canMount ? `echo '${image}'` : 'echo "Cannot mount AppImage"; exit 1',
5858
// Like the FUSE runtime, any of these unmounts. fd 3 reports to the test when it is open.
59-
`trap 'echo unmounted >&3 2>/dev/null; touch "${root}/unmounted"; exit 0' TERM HUP INT`,
59+
"trap 'echo unmounted >&3 2>/dev/null; exit 0' TERM HUP INT",
6060
"trap 'echo mounted >&3 2>/dev/null' WINCH",
6161
"while :; do sleep 0.05; done",
6262
"",
@@ -150,6 +150,14 @@ describe("renderCliShim", () => {
150150
);
151151
});
152152

153+
// The server skips its compile cache only under APPIMAGE; each mount path is new.
154+
it("tells the CLI it runs from the mounted AppImage", () => {
155+
const { appImage, shim } = fakeAppImage();
156+
const result = run(shim, ["--version"]);
157+
expect(result.status).toBe(3);
158+
expect(result.stdout).toContain(`appimage=${appImage}`);
159+
});
160+
153161
it("keeps the install's T3 home under sudo, unless one is set", () => {
154162
const root = tempRoot();
155163
writeExecutable(NodePath.join(root, "app"), REPORTER);

‎apps/desktop/src/app/DesktopCliShim.ts‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ export const renderCliShim = (input: {
109109
' (cd "$work" && "$app" --appimage-extract >/dev/null) || { echo "Could not open $app." >&2; exit 1; }',
110110
' mount="$work/squashfs-root"',
111111
"fi",
112+
// The runtime sets this when it launches the app; the CLI skips its path-keyed compile cache on it.
113+
'export APPIMAGE="$app"',
112114
run("$mount"),
113115
"",
114116
].join("\n");

0 commit comments

Comments
 (0)