Skip to content

Commit 87b5fa6

Browse files
committed
chore: merge main into pi lifecycle fix
2 parents a3a4eaf + e6e2ab0 commit 87b5fa6

902 files changed

Lines changed: 37723 additions & 4730 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/scripts/ci-changes.cjs‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const INERT = [
1414

1515
// Shared test setup and vendored mobile dependencies affect every package.
1616
const RUNS_EVERYTHING = [
17-
/^packages\/shared\/src\/(HostProcess|testing\/longTempDir)\.ts$/,
17+
/^packages\/shared\/src\/(HostProcess|testing\/(longTempDir|providerEnv))\.ts$/,
1818
/^apps\/mobile\/deps\//,
1919
];
2020

@@ -27,6 +27,8 @@ const EXTRA_OWNERS = [
2727
[/^native\/browser-secret\//, ["@t3tools/desktop"]],
2828
[/^native\/kde-snap-shot\//, ["@t3tools/desktop"]],
2929
[/^native\/libghostty-vt\//, ["@t3tools/web"]],
30+
// apps/server/src/cloud/ConnectReachability.test.ts checks the guide's headings.
31+
[/^docs\/user\/t3-connect-troubleshooting\.md$/, ["t3"]],
3032
];
3133
const RUST = /^native\/(resource-monitor|kde-snap-shot|hyprland-snap-shot)\//;
3234

@@ -92,11 +94,11 @@ function readWorkspace() {
9294

9395
// [] means inert; null means unknown and requires every job.
9496
function ownersOf(file, packages) {
95-
if (INERT.some((pattern) => pattern.test(file))) return [];
97+
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
98+
if (INERT.some((pattern) => pattern.test(file))) return extra;
9699
// A manifest can change dependencies or versions other packages read.
97100
if (path.posix.basename(file) === "package.json") return null;
98101
if (RUNS_EVERYTHING.some((pattern) => pattern.test(file))) return null;
99-
const extra = EXTRA_OWNERS.flatMap(([pattern, names]) => (pattern.test(file) ? names : []));
100102
// scripts/build-desktop-artifact.test.ts reads the crates' sources.
101103
if (RUST.test(file)) return ["@t3tools/scripts", ...extra];
102104

‎.github/scripts/thread-transfer-report.cjs‎

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -300,18 +300,28 @@ async function resolve({ github, context, core }) {
300300
core.setOutput("publish", "false");
301301
return;
302302
}
303-
const workflowRuns = await github.paginate(github.rest.actions.listWorkflowRuns, {
304-
owner,
305-
repo,
306-
workflow_id: source.workflow_id,
307-
branch: pull.base.ref,
308-
event: "push",
309-
status: "success",
310-
per_page: 100,
311-
});
303+
// One page each for the exact base and the newest runs; paging through
304+
// every successful main run costs up to ten requests to keep 20.
305+
const listRuns = async (filters) => {
306+
const { data } = await github.rest.actions.listWorkflowRuns({
307+
owner,
308+
repo,
309+
workflow_id: source.workflow_id,
310+
branch: pull.base.ref,
311+
event: "push",
312+
status: "success",
313+
per_page: 20,
314+
...filters,
315+
});
316+
return data.workflow_runs;
317+
};
318+
const [baseRuns, recentRuns] = await Promise.all([
319+
listRuns({ head_sha: pull.base.sha }),
320+
listRuns({}),
321+
]);
312322
const orderedRuns = [
313-
...workflowRuns.filter((run) => run.head_sha === pull.base.sha),
314-
...workflowRuns.filter((run) => run.head_sha !== pull.base.sha),
323+
...baseRuns,
324+
...recentRuns.filter((run) => run.head_sha !== pull.base.sha),
315325
].slice(0, 20);
316326

317327
let baselineRun;

‎.github/scripts/thread-transfer-report.test.cjs‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,18 @@ test("validates the fixed artifact schema", () => {
5555
test("resolves a fallback PR with a redacted head repo and exact main baseline", async () => {
5656
const outputs = {};
5757
const listWorkflowRunArtifacts = () => {};
58-
const listWorkflowRuns = () => {};
58+
// The exact base run sits far past the newest page of main CI runs.
59+
const mainRuns = Array.from({ length: 1_000 }, (_, index) => ({
60+
id: 1_000 - index,
61+
head_sha: index === 900 ? "base-sha" : `main-sha-${index}`,
62+
}));
63+
const listWorkflowRuns = async ({ head_sha, per_page }) => ({
64+
data: {
65+
workflow_runs: mainRuns
66+
.filter((run) => head_sha === undefined || run.head_sha === head_sha)
67+
.slice(0, per_page),
68+
},
69+
});
5970
const listPullRequestsAssociatedWithCommit = () => {};
6071
const github = {
6172
paginate: async (method, input) => {
@@ -77,9 +88,6 @@ test("resolves a fallback PR with a redacted head repo and exact main baseline",
7788
},
7889
];
7990
}
80-
if (method === listWorkflowRuns) {
81-
return [{ id: 1, head_sha: "base-sha" }];
82-
}
8391
throw new Error("unexpected pagination call");
8492
},
8593
rest: {
@@ -123,7 +131,7 @@ test("resolves a fallback PR with a redacted head repo and exact main baseline",
123131
assert.equal(outputs.publish, "true");
124132
assert.equal(outputs.pull_number, "5350");
125133
assert.equal(outputs.pr_artifact, "true");
126-
assert.equal(outputs.baseline_run_id, "1");
134+
assert.equal(outputs.baseline_run_id, "100");
127135
assert.equal(outputs.baseline_matches_base, "true");
128136
});
129137

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ permissions:
2020
jobs:
2121
collect-targets:
2222
name: Collect PR targets
23+
# Most comments are not recheck commands; skip them before a runner starts.
24+
if: >-
25+
github.event_name != 'issue_comment' ||
26+
(github.event.issue.pull_request && contains(github.event.comment.body, '/recheck-vouch'))
2327
runs-on: ubuntu-24.04
2428
outputs:
2529
targets: ${{ steps.collect.outputs.targets }}

‎.macroscope/check-run-agents/ui-consistency.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The reference for how this codebase wants UI built is the composer banner system
4444

4545
- `ComposerBanner.tsx` exports one object of small slot components (`Root`, `Row`, `Icon`, `Content`, `Actions`, `Dismiss`, `Children`, and so on). Each slot owns its own Tailwind classes, exposes a `data-slot` attribute, takes `className` and spreads the rest of its props, and uses `cn` so callers can adjust without overriding. Variants and density are props on `Root`, not ad hoc class strings at call sites. Where a slot needs a real control it renders `Button` from `ui/` rather than a styled `<button>`.
4646
- `ComposerBannerStack.tsx` composes those slots into the ordered stack and owns only stack behavior (priority, expand and collapse, dismiss transitions).
47-
- Consumers such as `ComposerActivityStatus.tsx`, `ComposerStashBadge.tsx`, and `ComposerPlanFollowUpBanner.tsx` are a few lines of `<ComposerBanner.Row><ComposerBanner.Icon/><ComposerBanner.Content>…` with no styling of their own.
47+
- Consumers such as `ComposerPlanFollowUpBanner.tsx` are a few lines of `<ComposerBanner.Row><ComposerBanner.Icon/><ComposerBanner.Content>…` and style only their own content.
4848

4949
Hold new and changed UI to that shape:
5050

‎README.md‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
T3 Code is an "agent harness control surface". It enables control of the agents on your machine with a best-in-class mobile app ([iOS](https://apps.apple.com/us/app/t3-code-remote-claude-more/id6787819824), [Android](https://play.google.com/store/apps/details?id=com.t3tools.t3code)), [web app](https://app.t3.codes) and [Electron-based desktop app](https://t3.codes).
44

5-
Works with your subscriptions on Claude Code, Codex, Cursor, Grok Build, OpenCode, and Google Antigravity. If they're set up on your computer, T3 Code can control them.
5+
Works with your subscriptions on Claude Code, Codex, Cursor, Grok Build, OpenCode, Google Antigravity, and fx. If they're set up on your computer, T3 Code can control them.
66

77
## "Wait, what are you selling me?"
88

@@ -13,14 +13,15 @@ We wanted something performant, remote-ready, and truly open. If we ever go the
1313
## Installation
1414

1515
> [!WARNING]
16-
> T3 Code currently supports Codex, Claude, Cursor, Grok Build, OpenCode, and Antigravity. Install and authenticate at least one provider before use:
16+
> T3 Code currently supports Codex, Claude, Cursor, Grok Build, OpenCode, Antigravity, and fx. Install and authenticate at least one provider before use:
1717
>
1818
> - Codex: install [Codex CLI](https://developers.openai.com/codex/cli) and run `codex login`
1919
> - Claude: install [Claude Code](https://claude.com/product/claude-code) and run `claude auth login`
2020
> - Cursor: install [Cursor CLI](https://cursor.com/cli) and run `agent login`
2121
> - Grok Build: install [Grok Build CLI](https://x.ai/cli) and run `grok login`
2222
> - OpenCode: install [OpenCode](https://opencode.ai) and run `opencode auth login`
2323
> - Antigravity: enable it in Settings, then use **Install Antigravity** and **Sign in with Google**. No CLI is required.
24+
> - fx: install [fx](https://fx.sh) and run `fx login` on the machine running the T3 Code server ([setup guide](./docs/user/providers-fx.md))
2425
2526
### Command line
2627

‎apps/desktop/scripts/main-process-bundle.test.mjs‎

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as NodeFSP from "node:fs/promises";
33
import * as NodeOS from "node:os";
44
import * as NodePath from "node:path";
55
import * as NodeVM from "node:vm";
6+
import * as NodeURL from "node:url";
67
import { build } from "vite-plus/pack";
78
import { assert, it } from "vite-plus/test";
89

@@ -114,18 +115,16 @@ it("loads the emitted packaged boot entry and backend cache preload", async () =
114115
const directory = await NodeFSP.mkdtemp(NodePath.join(NodeOS.tmpdir(), "t3-desktop-boot-"));
115116
try {
116117
const entries = ["src/boot.ts", "src/compileCache.ts"];
117-
await NodeFSP.mkdir(NodePath.join(directory, "src"));
118-
await Promise.all(
119-
entries.map((entry) =>
120-
NodeFSP.copyFile(new URL(`../${entry}`, import.meta.url), NodePath.join(directory, entry)),
121-
),
122-
);
123118
assert.ok(Array.isArray(desktopConfig.pack));
124119
for (const packConfig of desktopConfig.pack) {
125120
if (!Array.isArray(packConfig.entry)) continue;
126121
if (!packConfig.entry.some((entry) => entries.includes(entry))) continue;
127122
await build({
128123
...packConfig,
124+
entry: packConfig.entry.map((entry) =>
125+
NodeURL.fileURLToPath(new URL(`../${entry}`, import.meta.url)),
126+
),
127+
outDir: NodePath.join(directory, "dist-electron"),
129128
config: false,
130129
cwd: directory,
131130
tsconfig: false,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type EarlyLinuxElectronOptionsInput = EarlyDesktopSettingsInput;
2626

2727
export interface EarlyLinuxElectronOptions {
2828
readonly isDevelopment: boolean;
29-
readonly linuxWmClass: string;
3029
readonly linuxDesktopEntryName: string;
3130
readonly passwordStore: LinuxPasswordStoreSwitch | null;
3231
}
@@ -146,7 +145,6 @@ export function resolveEarlyLinuxElectronOptions(
146145
const isDevelopment = isDevelopmentEnvironment(input.env);
147146
return {
148147
isDevelopment,
149-
linuxWmClass: isDevelopment ? "t3code-dev" : "t3code",
150148
linuxDesktopEntryName: resolveLinuxDesktopEntryName(isDevelopment),
151149
passwordStore: resolveLinuxPasswordStoreSwitch({
152150
preference,

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ export class DesktopEnvironment extends Context.Service<
7575
readonly displayName: string;
7676
readonly appUserModelId: string;
7777
readonly linuxDesktopEntryName: string;
78-
readonly linuxWmClass: string;
7978
readonly linuxApplicationsDir: string;
8079
readonly desktopLauncherPath: Option.Option<string>;
8180
readonly appImagePath: Option.Option<string>;
@@ -232,7 +231,6 @@ const make = Effect.fn("desktop.environment.make")(function* (
232231
isDevelopment ? "com.t3tools.t3code.dev" : "com.t3tools.t3code",
233232
),
234233
linuxDesktopEntryName: resolveLinuxDesktopEntryName(isDevelopment),
235-
linuxWmClass: isDevelopment ? "t3code-dev" : "t3code",
236234
linuxApplicationsDir,
237235
desktopLauncherPath: config.desktopLauncherPath,
238236
appImagePath: config.appImagePath,

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

Lines changed: 48 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ import * as Layer from "effect/Layer";
55
import * as Ref from "effect/Ref";
66
import * as TestClock from "effect/testing/TestClock";
77

8+
import * as HostProcess from "@t3tools/shared/HostProcess";
9+
810
import type * as Electron from "electron";
911

1012
import * as ElectronApp from "../electron/ElectronApp.ts";
@@ -20,6 +22,7 @@ function layerElectronApp(
2022
appListeners: Map<string, (...args: readonly unknown[]) => void>,
2123
quit: Effect.Effect<void> = Effect.void,
2224
exit: (code: number) => Effect.Effect<void> = () => Effect.void,
25+
relaunch: (options: Electron.RelaunchOptions) => Effect.Effect<void> = () => Effect.void,
2326
) {
2427
const registerListener = (eventName: string, listener: (...args: readonly unknown[]) => void) =>
2528
Effect.acquireRelease(
@@ -40,7 +43,7 @@ function layerElectronApp(
4043
requestSingleInstanceLock: Effect.succeed(true),
4144
quit,
4245
exit,
43-
relaunch: () => Effect.void,
46+
relaunch,
4447
setPath: () => Effect.void,
4548
setName: () => Effect.void,
4649
setAboutPanelOptions: () => Effect.void,
@@ -223,6 +226,50 @@ describe("DesktopLifecycle", () => {
223226
}),
224227
);
225228

229+
it.effect("relaunches without the app link that launched it", () =>
230+
Effect.gen(function* () {
231+
const relaunched = yield* Deferred.make<Electron.RelaunchOptions>();
232+
const layerEnvironment = Layer.succeed(DesktopEnvironment.DesktopEnvironment, {
233+
platform: "linux",
234+
isDevelopment: false,
235+
} as DesktopEnvironment.DesktopEnvironment["Service"]);
236+
const layer = DesktopLifecycle.layer.pipe(
237+
Layer.provideMerge(
238+
layerElectronApp(
239+
new Map(),
240+
Effect.void,
241+
() => Effect.void,
242+
(options) => Deferred.succeed(relaunched, options).pipe(Effect.asVoid),
243+
),
244+
),
245+
Layer.provideMerge(layerElectronTheme),
246+
Layer.provideMerge(layerElectronWindow()),
247+
Layer.provideMerge(layerDesktopWindow()),
248+
Layer.provideMerge(layerEnvironment),
249+
Layer.provideMerge(DesktopShutdown.layer),
250+
Layer.provideMerge(DesktopState.layer),
251+
);
252+
253+
const options = yield* Effect.gen(function* () {
254+
const lifecycle = yield* DesktopLifecycle.DesktopLifecycle;
255+
yield* (yield* DesktopShutdown.DesktopShutdown).markComplete;
256+
yield* lifecycle.relaunch("network access changed");
257+
return yield* Deferred.await(relaunched);
258+
}).pipe(
259+
Effect.provide(layer),
260+
Effect.provideService(HostProcess.ExecutablePath, "/opt/T3 Code/t3code"),
261+
Effect.provideService(HostProcess.Arguments, [
262+
"/opt/T3 Code/t3code",
263+
"--no-sandbox",
264+
"T3CODE://pair?token=spent",
265+
"t3code://new?prompt=hello",
266+
]),
267+
);
268+
269+
assert.deepEqual(options, { execPath: "/opt/T3 Code/t3code", args: ["--no-sandbox"] });
270+
}),
271+
);
272+
226273
it.effect("exits on a repeated quit only once shutdown has stalled", () =>
227274
Effect.gen(function* () {
228275
const appListeners = new Map<string, (...args: readonly unknown[]) => void>();

0 commit comments

Comments
 (0)