Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions Dockerfile.backend
Original file line number Diff line number Diff line change
Expand Up @@ -82,24 +82,24 @@ COPY packages/sandbox-local ./packages/sandbox-local

RUN set -eux; \
asset_dir=/app/backend/runtime-assets; \
archive="$asset_dir/native-runtime-42ef3397fa38.tar.gz"; \
archive="$asset_dir/native-runtime-c3a1dd480534.tar.gz"; \
test -f "$archive"; \
printf '%s %s\n' \
'280ff1023e238377733a87b07bf86c83ff18ae9953fb8d06281d767c8340779d' \
"$asset_dir/dependencies/bun.lock" | sha256sum -c -; \
printf '%s %s\n' \
'311a81889490e525df5ec3f5dbb660a40b04059467d7907a81d90f38017efc8f' \
'fb4fc5a879aa102a2764c537a5ba085b20b0d4a1d71d915070a28086fbeedbd4' \
"$archive" | sha256sum -c -; \
test "$(tar -xOzf "$archive" ./T3_SOURCE_COMMIT)" = \
'42ef3397fa38befec011b840c953adbff7c8770a'; \
'c3a1dd480534347b5bfddfebd33aafd016d5b78b'; \
tar -xOzf "$archive" ./SHA256SUMS | sha256sum | \
grep -Fx 'd33c54581f880d3aa2d37f87580ee6fc4f232c19948b3938cc54e527880b9c88 -'; \
grep -Fx '6118efc14e27b7432b8b906c32fed87a51dbf71735a17a3f565eb3df8d158efb -'; \
verify_dir="$(mktemp -d)"; \
tar -xzf "$archive" -C "$verify_dir"; \
(cd "$verify_dir" && sha256sum -c SHA256SUMS); \
rm -rf "$verify_dir"; \
bun -e \
'const m=await Bun.file(process.argv[1]).json();const e={archiveName:"native-runtime-42ef3397fa38.tar.gz",archiveSha256:"311a81889490e525df5ec3f5dbb660a40b04059467d7907a81d90f38017efc8f",manifestSha256:"d33c54581f880d3aa2d37f87580ee6fc4f232c19948b3938cc54e527880b9c88",sourceCommit:"42ef3397fa38befec011b840c953adbff7c8770a",dependencyVersion:"0.1.1-nightly.20261018.3315",dependencyLockSha256:"280ff1023e238377733a87b07bf86c83ff18ae9953fb8d06281d767c8340779d"};if(JSON.stringify(m)!==JSON.stringify(e))process.exit(1)' \
'const m=await Bun.file(process.argv[1]).json();const e={archiveName:"native-runtime-c3a1dd480534.tar.gz",archiveSha256:"fb4fc5a879aa102a2764c537a5ba085b20b0d4a1d71d915070a28086fbeedbd4",manifestSha256:"6118efc14e27b7432b8b906c32fed87a51dbf71735a17a3f565eb3df8d158efb",sourceCommit:"c3a1dd480534347b5bfddfebd33aafd016d5b78b",dependencyVersion:"0.1.1-nightly.20261018.3315",dependencyLockSha256:"280ff1023e238377733a87b07bf86c83ff18ae9953fb8d06281d767c8340779d"};if(JSON.stringify(m)!==JSON.stringify(e))process.exit(1)' \
"$asset_dir/manifest.json"

RUN ln -s backend/node_modules /app/node_modules \
Expand All @@ -116,8 +116,8 @@ RUN ln -s backend/node_modules /app/node_modules \
/opt/useagent/native-runtime \
/opt/useagent/pi-runtime \
&& ln -s /app/backend/runtime-assets/manifest.json /opt/useagent/native-runtime/manifest.json \
&& ln -s /app/backend/runtime-assets/native-runtime-42ef3397fa38.tar.gz \
/opt/useagent/native-runtime/native-runtime-42ef3397fa38.tar.gz \
&& ln -s /app/backend/runtime-assets/native-runtime-c3a1dd480534.tar.gz \
/opt/useagent/native-runtime/native-runtime-c3a1dd480534.tar.gz \
&& chown -R bun:bun \
/app/backend/.artifacts \
/app/backend/.runs \
Expand Down
8 changes: 4 additions & 4 deletions backend/runtime-assets/manifest.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"archiveName": "native-runtime-42ef3397fa38.tar.gz",
"archiveSha256": "311a81889490e525df5ec3f5dbb660a40b04059467d7907a81d90f38017efc8f",
"manifestSha256": "d33c54581f880d3aa2d37f87580ee6fc4f232c19948b3938cc54e527880b9c88",
"sourceCommit": "42ef3397fa38befec011b840c953adbff7c8770a",
"archiveName": "native-runtime-c3a1dd480534.tar.gz",
"archiveSha256": "fb4fc5a879aa102a2764c537a5ba085b20b0d4a1d71d915070a28086fbeedbd4",
"manifestSha256": "6118efc14e27b7432b8b906c32fed87a51dbf71735a17a3f565eb3df8d158efb",
"sourceCommit": "c3a1dd480534347b5bfddfebd33aafd016d5b78b",
"dependencyVersion": "0.1.1-nightly.20261018.3315",
"dependencyLockSha256": "280ff1023e238377733a87b07bf86c83ff18ae9953fb8d06281d767c8340779d"
}
4 changes: 2 additions & 2 deletions backend/src/engines/runtime-environment-client.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ describe("T3 environment client", () => {
const command = buildRuntimeEnvironmentAuthenticationCommand();

expect(command).toContain(
'"/root/.local/share/useagent/native-runtime/42ef3397fa38befec011b840c953adbff7c8770a/bin/t3" auth pairing create',
'"/root/.local/share/useagent/native-runtime/c3a1dd480534347b5bfddfebd33aafd016d5b78b/bin/t3" auth pairing create',
);
expect(command).not.toMatch(/(^|\s)t3 auth pairing create/);
expect(command).toContain('--json >"$PAIRING"');
Expand All @@ -118,7 +118,7 @@ describe("T3 environment client", () => {
const command = buildRuntimeEnvironmentAuthenticationCommand(BOX_LAYOUT);

expect(command).toContain(
'"/home/user/.local/share/useagent/native-runtime/42ef3397fa38befec011b840c953adbff7c8770a/bin/t3" auth pairing create',
'"/home/user/.local/share/useagent/native-runtime/c3a1dd480534347b5bfddfebd33aafd016d5b78b/bin/t3" auth pairing create',
);
expect(command).not.toContain("/root");
expect(Bun.spawnSync(["bash", "-n", "-c", command]).exitCode).toBe(0);
Expand Down
2 changes: 1 addition & 1 deletion backend/src/engines/runtime-native-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { buildSandboxBunProbeCommand } from "./sandbox-bun";
// probes that prove an installed engine is exactly that package.
export const CODEX_VERSION = "0.162.1";
export const CLAUDE_CODE_VERSION = "2.1.296";
export const OPENCODE_VERSION = "2.0.26";
export const OPENCODE_VERSION = "2.2.5";
export const OPENCODE_PACKAGE = "@opencode/cli";
/** The pinned driver versions the bootstrap installs; the native image name is derived from them. */
export const RUNTIME_ENGINE_VERSIONS = {
Expand Down
22 changes: 11 additions & 11 deletions backend/src/engines/runtime-provider-bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ async function runColdClaudeBootstrap(
}

async function runColdOpenCodeBootstrap(
packageVersion = "2.0.26",
packageVersion = "2.2.5",
installedBinary: Uint8Array = nativeElfHeaderFixture,
): Promise<{
home: string;
Expand Down Expand Up @@ -576,9 +576,9 @@ describe("T3 provider bridge", () => {
},
{
id: "opencode" as const,
package: "@opencode/cli@2.0.26",
package: "@opencode/cli@2.2.5",
binary: "opencode",
version: "2.0.26",
version: "2.2.5",
},
];
for (const engine of engines) {
Expand All @@ -598,7 +598,7 @@ describe("T3 provider bridge", () => {
await Bun.write(packageBin, nativeElfHeaderFixture);
await Bun.write(join(packageDir, "package.json"), JSON.stringify({
name: "@opencode/cli",
version: "2.0.26",
version: "2.2.5",
bin: { opencode: "./bin/opencode.exe" },
}));
await Bun.$`chmod 700 ${packageBin}`;
Expand Down Expand Up @@ -654,7 +654,7 @@ describe("T3 provider bridge", () => {
for (const otherPackage of [
"@openai/codex@0.162.1",
"@anthropic-ai/claude-code@2.1.296",
"@opencode/cli@2.0.26",
"@opencode/cli@2.2.5",
]) {
if (otherPackage !== engine.package) expect(command).not.toContain(otherPackage);
}
Expand Down Expand Up @@ -765,7 +765,7 @@ exit 17
expect(run.result.exitCode).toBe(1);
const output = `${run.result.stdout?.toString() ?? ""}${run.result.stderr?.toString() ?? ""}`;
expect(output).toContain(
"useagent-native-version-probe: install_identity_mismatch expected=2.0.26",
"useagent-native-version-probe: install_identity_mismatch expected=2.2.5",
);
expect(output.length).toBeLessThan(160);
} finally {
Expand All @@ -774,11 +774,11 @@ exit 17
});

test("rejects the executable placeholder shipped before OpenCode postinstall", async () => {
const run = await runColdOpenCodeBootstrap("2.0.26", Buffer.from(openCodePostinstallPlaceholder));
const run = await runColdOpenCodeBootstrap("2.2.5", Buffer.from(openCodePostinstallPlaceholder));
try {
expect(Buffer.byteLength(openCodePostinstallPlaceholder)).toBe(229);
expect(run.result.exitCode).toBe(1);
expect(run.result.stderr?.toString() ?? "").toContain("install_identity_mismatch expected=2.0.26");
expect(run.result.stderr?.toString() ?? "").toContain("install_identity_mismatch expected=2.2.5");
expect(await Bun.file(run.launchMarker).exists()).toBe(false);
} finally {
await rm(run.home, { recursive: true, force: true });
Expand Down Expand Up @@ -989,7 +989,7 @@ exit 17
expect(bootstraps).toHaveLength(3);
expect(bootstraps[0]).toContain("@openai/codex@0.162.1");
expect(bootstraps[1]).toContain("@anthropic-ai/claude-code@2.1.296");
expect(bootstraps[2]).toContain("@opencode/cli@2.0.26");
expect(bootstraps[2]).toContain("@opencode/cli@2.2.5");
// Only OpenCode trusts its package scripts: its postinstall places the native binary.
expect(bootstraps[2]).toContain("add --global --exact --trust --no-progress");
expect(bootstraps[0]).not.toContain("--trust");
Expand Down Expand Up @@ -1336,7 +1336,7 @@ exit 17
true,
);

expect(commands.filter((command) => command.includes('NATIVE_PACKAGE="@opencode/cli@2.0.26"')))
expect(commands.filter((command) => command.includes('NATIVE_PACKAGE="@opencode/cli@2.2.5"')))
.toHaveLength(1);
expect(commands.filter((command) =>
command.includes(buildOpenCodeInstallIdentityProbeCommand({
Expand Down Expand Up @@ -1368,7 +1368,7 @@ exit 17
executeCommand: async (command: string) => {
const nativePackage = engine === "claude"
? '@anthropic-ai/claude-code@2.1.296'
: '@opencode/cli@2.0.26';
: '@opencode/cli@2.2.5';
if (command.includes(`NATIVE_PACKAGE="${nativePackage}"`)) {
fullBootstraps += 1;
if (!bootstrapSucceeds) return { exitCode: 1, result: "" };
Expand Down
10 changes: 7 additions & 3 deletions docs/operations/native-runtime-assets.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ asset, not committed to Git.
`backend/runtime-assets/manifest.json` pins the release filename, archive hash,
embedded checksum-manifest hash, source commit, dependency version, and frozen
Bun dependency-lock hash. The archive is built from reviewed fork commit
`42ef3397fa38befec011b840c953adbff7c8770a`, based on upstream nightly
`c3a1dd480534347b5bfddfebd33aafd016d5b78b`, based on upstream nightly
`v0.1.1-nightly.20261018.3315` (`9c161462c94f7d9d6d9169da5c841457cbadf213`) plus a fork
commit that sets the version, on the V2 orchestrator line. It is the server's `dist`
directory with its bundled web client, plus a `T3_SOURCE_COMMIT` marker and a
Expand Down Expand Up @@ -50,7 +50,7 @@ that sandbox, as the process that ran it does.
## Staging

```sh
bun run deploy/stage-native-runtime.ts /path/to/native-runtime-42ef3397fa38.tar.gz
bun run deploy/stage-native-runtime.ts /path/to/native-runtime-c3a1dd480534.tar.gz
```

Without an argument, the script downloads the exact filename from the public
Expand All @@ -75,7 +75,7 @@ bundle and patch on a new private release. A runtime distribution change does
not change harness protocol selection: Codex, Claude Code, OpenCode, and Pi
remain on their native engine drivers.

The matching `t3code-fork-42ef3397fa38.bundle` and `.patch` preserve the custom
The matching `t3code-fork-c3a1dd480534.bundle` and `.patch` preserve the custom
source; their hashes and upstream prerequisite commit are recorded in
`third_party/t3code-fork.lock`. Fetch the upstream prerequisite before using
the Git bundle. The fork's contract label (`orchestrator-v2-hosted-codex-host-switches-v7`)
Expand Down Expand Up @@ -137,3 +137,7 @@ carries no runtime state.
- 2026-10-19: fork `42ef3397fa38` on top of it: with continuations off the runtime refuses at
dispatch any message a person did not send, and OpenCode steers wait behind the freeze gate.
Engines unchanged.
- 2026-11-06: fork `c3a1dd480534` on top of it, for OpenCode 2.1 and later: upstream's
compaction history decode (t3code #22661) and the compaction started and ended events,
which OpenCode 2.1 sends without `recent`, decode again. Engines: `@opencode/cli` 2.2.5
(was 2.0.26; 2.1.4+ never stops a location's runs while one is waiting on a person).
11 changes: 8 additions & 3 deletions docs/operations/t3-upstream.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ changes, and how to take the next upstream release. Update the log table on ever
| Item | Value |
|---|---|
| Upstream base | nightly `v0.1.1-nightly.20261018.3315` (`9c161462c9`, on upstream main), with a fork commit that reports that version (orchestrator V2) |
| Fork head | `42ef3397fa38` (branch `useagent-v2`; bundle and patch attached to the release) |
| Runtime release | `native-runtime-42ef3397fa38` (pro and public `useagenthq/useagent`) |
| Fork head | `c3a1dd480534` (branch `useagent-v2`; bundle and patch attached to the release) |
| Runtime release | `native-runtime-c3a1dd480534` (pro and public `useagenthq/useagent`) |
| Pins in `third_party/t3code-fork.lock` and `backend/runtime-assets/manifest.json` | contract `orchestrator-v2-hosted-codex-host-switches-v7` |
| Engines | Codex `0.162.1`, Claude Code `2.1.296`, OpenCode `@opencode/cli 2.0.26` (installed with `--trust`), Pi (bypasses T3) |
| Engines | Codex `0.162.1`, Claude Code `2.1.296`, OpenCode `@opencode/cli 2.2.5` (installed with `--trust`), Pi (bypasses T3) |
| Runtime generation | `useagent-runtime-v9`, the image default (compose blanks any host env pin, so each image brings its own) |

## What our fork changes
Expand Down Expand Up @@ -70,6 +70,10 @@ move the code they touch.
12. A Codex file change item lists every file of its patch in `changes` (operation and path, a
move's old path as `oldPath`); `fileName` and `diffStr` stay the first file's, which is what
the plane reads.
13. OpenCode 2.1+ on the bundled 2.0.28 client: upstream's compaction history decode (t3code
#22661, cherry-picked; drop it when a rebase brings it), and the event stream fills the
`recent` OpenCode 2.1 dropped from `session.compaction.started` and
`session.compaction.ended` before decoding them (upstream still skips both).

The relay still fills in the run's environment when a turn arrives without one
(`codex-subscription-protocol.ts`), and answers the runtime's known thread methods it does not carry
Expand Down Expand Up @@ -128,3 +132,4 @@ and the model manifest.
| 2026-10-17 | v0.1.0 (`81493efb71`) | `23456795847f` | `native-runtime-23456795847f` | `z4l5cmr17dkj74ujxvh9` | a Codex file change lists every file of its patch (`changes`), on top of `a72f0dfb8a6e` |
| 2026-10-19 | nightly 20261018.3315 (`9c161462c9`) | `7a5654cc7499` | `native-runtime-7a5654cc7499` | `e69y4jc119uv2tlpryt9` | 499 upstream commits (live command output on its own RPC, which the plane does not use; restart wakes for subagents' cut background work; follow-ups queued while a thread compacts; one resolver for project and worktree folders; Claude subagent fixes); our 22 commits carried, upstream's two v0.1.0 release-branch commits left out (main has them); engines unchanged |
| 2026-10-19 | nightly 20261018.3315 (`9c161462c9`) | `42ef3397fa38` | `native-runtime-42ef3397fa38` | `ofm96owqkopgr9uzp5e5` | follow-up on `7a5654cc7499`: with continuations off the runtime refuses at dispatch any message a person did not send, and OpenCode steers wait behind the freeze gate (then go out, never dropped); reviewed by gpt-5.6-sol (astra out of quota) |
| 2026-11-06 | nightly 20261018.3315 (`9c161462c9`) | `c3a1dd480534` | `native-runtime-c3a1dd480534` | see host env | OpenCode 2.0.26 -> 2.2.5 (2.1.4+ never stops a location's runs while one waits on a person); upstream #22661 cherry-picked and compaction events decoded without `recent` |
6 changes: 3 additions & 3 deletions third_party/t3code-fork.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
source=https://github.com/pingdotgg/t3code
base_commit=9c161462c94f7d9d6d9169da5c841457cbadf213
source_commit=42ef3397fa38befec011b840c953adbff7c8770a
patch_sha256=39d0beff6bc090ad999d58ac0cd1687b863c2b0759e51768e40b9243e1f03c39
bundle_sha256=a556c4cad3c027f32f61fdf0172ec69af7dac477ecde0a1e0da3564a2455f78f
source_commit=c3a1dd480534347b5bfddfebd33aafd016d5b78b
patch_sha256=b0169b8487aa82f9979e0074aaa616310fde03bb7b9bb856708d196e6920c291
bundle_sha256=54664e23f196cbeb48d99abda55bf7118dcea184548fb19123b43e9f6af2e300
contract=orchestrator-v2-hosted-codex-host-switches-v7
Loading