Skip to content

Commit acdc7d8

Browse files
committed
merge: integrate latest main into usage polling
2 parents 32b1151 + 2d5e0ae commit acdc7d8

286 files changed

Lines changed: 10994 additions & 1497 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

‎AGENTS.md‎

Lines changed: 2 additions & 2 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.

‎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");

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

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as NodeChildProcess from "node:child_process";
33
import * as NodeFS from "node:fs";
44
import { assert, describe, it } from "@effect/vitest";
55

6-
import { stopChildProcessesBeforeExit } from "./DesktopExitChildren.ts";
6+
import { stopChildProcessesBeforeExit, stopZygotesBeforeExit } from "./DesktopExitChildren.ts";
77

88
const isRunning = (pid: number) => {
99
try {
@@ -39,4 +39,24 @@ describe.runIf(NodeFS.existsSync("/proc/self/task"))("stopChildProcessesBeforeEx
3939
parent.kill("SIGKILL");
4040
}
4141
});
42+
43+
it("kills zygote children before returning and leaves other helpers running", async () => {
44+
const spawnTitled = async (title: string) => {
45+
const child = NodeChildProcess.spawn("sleep", ["60"], { argv0: title, stdio: "ignore" });
46+
await new Promise((resolve) => child.once("spawn", resolve));
47+
return child;
48+
};
49+
// Chromium rewrites a zygote's argv into one space-separated title.
50+
const zygote = await spawnTitled("/opt/T3 Code/t3code --type=zygote --no-sandbox");
51+
const utility = await spawnTitled("/opt/T3 Code/t3code --type=utility");
52+
try {
53+
stopZygotesBeforeExit(process.pid);
54+
55+
assert.isFalse(isRunning(zygote.pid!));
56+
assert.isTrue(isRunning(utility.pid!));
57+
} finally {
58+
zygote.kill("SIGKILL");
59+
utility.kill("SIGKILL");
60+
}
61+
});
4262
});

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

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ const childPids = (pid: number): ReadonlyArray<number> => {
2929
);
3030
};
3131

32+
// A zygote rewrites its argv into one space-separated title.
33+
const isZygote = (pid: number): boolean =>
34+
(readProc(`/proc/${pid}/cmdline`) ?? "")
35+
.replaceAll("\0", " ")
36+
.split(" ")
37+
.includes("--type=zygote");
38+
3239
// A zombie has already released its memory mappings.
3340
const isRunning = (pid: number): boolean => {
3441
const stat = readProc(`/proc/${pid}/stat`);
@@ -68,3 +75,13 @@ export const stopChildProcessesBeforeExit = (pid: number): ReadonlyArray<number>
6875
waitUntilStopped(survivors, KILL_WAIT_MS);
6976
return survivors;
7077
};
78+
79+
/**
80+
* Chromium's zygotes exit only after main does, so on an AppImage they outlive the mount even on
81+
* an orderly quit. Kills them while main still holds the image mounted. Linux only (/proc).
82+
*/
83+
export const stopZygotesBeforeExit = (pid: number): void => {
84+
const zygotes = childPids(pid).filter(isZygote);
85+
signal(zygotes, "SIGKILL");
86+
waitUntilStopped(zygotes, KILL_WAIT_MS);
87+
};

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { assert, describe, it } from "@effect/vitest";
22
import * as Deferred from "effect/Deferred";
33
import * as Effect from "effect/Effect";
44
import * as Layer from "effect/Layer";
5+
import * as Option from "effect/Option";
56
import * as Ref from "effect/Ref";
67
import * as TestClock from "effect/testing/TestClock";
78

@@ -117,6 +118,7 @@ describe("DesktopLifecycle", () => {
117118
const layerEnvironment = Layer.succeed(DesktopEnvironment.DesktopEnvironment, {
118119
platform,
119120
isDevelopment: false,
121+
appImagePath: Option.none(),
120122
} as DesktopEnvironment.DesktopEnvironment["Service"]);
121123

122124
const layer = DesktopLifecycle.layer.pipe(

0 commit comments

Comments
 (0)