@devries-cameron20 / t3code-1 / commits / 260297b55f
Fork 0

The best way to control Claude Code, Codex and more from any computer or phone

fix(server): GPT-6.1 Sol no longer compacts after every tool call on managed Codex (#30004)

Co-authored-by: maria-rcks <254055478+maria-rcks@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

maria committed Nov 3, 2026 at 20:31 UTC 260297b55fc97c5b10ff55511967f6d20c622e54
2 files changed +56 -27
apps/server/src/provider/CodexInstallation.test.ts
+27
@@ -359,6 +359,33 @@ it.effect("requires an update before running an older activated managed installa
359 }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
360 );
361
362 +it.effect("updates an older supported managed installation to the pinned release on startup", () =>
363 + Effect.gen(function* () {
364 + const first = yield* makeHarness();
365 + yield* first.installation.start;
366 + yield* terminalState(first.installation);
367 + const executable = yield* first.installation.resolve();
368 + const oldDirectory = `${first.installation.managedDirectory}/0.156.0`;
369 + yield* first.fs.rename(executable.managedVersionDirectory!, oldDirectory);
370 + for (const name of ["codex-package.json", ".install-complete.json"]) {
371 + const file = `${oldDirectory}/${name}`;
372 + yield* first.fs.writeFileString(
373 + file,
374 + (yield* first.fs.readFileString(file)).replaceAll("0.156.1", "0.156.0"),
375 + );
376 + }
377 + yield* first.fs.writeFileString(
378 + `${first.installation.managedDirectory}/active.json`,
379 + '{"version":"0.156.0"}',
380 + );
381 + const restarted = yield* makeHarness({ baseDir: first.baseDir });
382 + expect((yield* restarted.installation.state).operationId).not.toBeNull();
383 + expect((yield* terminalState(restarted.installation)).phase).toBe("succeeded");
384 + expect((yield* restarted.installation.resolve()).version).toBe("0.156.1");
385 + expect(restarted.downloads()).toBe(1);
386 + }).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
387 +);
388 +
389 it.effect("rejects corrupted downloads without publishing a runtime", () =>
390 Effect.gen(function* () {
391 const { installation, fs } = yield* makeHarness({
apps/server/src/provider/CodexInstallation.ts
+29 -27
@@ -5,6 +5,7 @@ import {
5 type ServerProviderCompatibilityAdvisory,
6 } from "@t3tools/contracts";
7 import { cliArchiveTarCommand } from "@t3tools/shared/cliRelease";
8 +import { compareSemverVersions } from "@t3tools/shared/semver";
9 import * as HostProcess from "@t3tools/shared/HostProcess";
10 import { resolveCommandPath, resolveSpawnCommand } from "@t3tools/shared/shell";
11 import * as Clock from "effect/Clock";
@@ -58,46 +59,46 @@ export interface CodexReleaseAsset {
59 }
60 const RELEASES: Readonly<Record<string, CodexReleaseAsset>> = {
61 "darwin-arm64": {
61 - version: "0.156.1",
62 + version: "0.166.0",
63 target: "aarch64-apple-darwin",
63 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-aarch64-apple-darwin.tar.gz",
64 - sha256: "fea42f9625091f011e38f059da974d52e57ba31831648bb1c7f0b1a385fde547",
65 - archiveBytes: 127394863,
64 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-aarch64-apple-darwin.tar.gz",
65 + sha256: "55a440cb579f970abe7c79ab181e54b0ea4c419be99f333bbd868eebac9c21f0",
66 + archiveBytes: 165951869,
67 },
68 "darwin-x64": {
68 - version: "0.156.1",
69 + version: "0.166.0",
70 target: "x86_64-apple-darwin",
70 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-x86_64-apple-darwin.tar.gz",
71 - sha256: "618dbcd55419fa041871f777a14b107ceb3fe2d339ef81e21e6ab5374420dc71",
72 - archiveBytes: 138670455,
71 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-x86_64-apple-darwin.tar.gz",
72 + sha256: "1cb65690230be5982c654ba2655e3a3b594dce9c55b780e78bfdfeff829d7ad9",
73 + archiveBytes: 180076524,
74 },
75 "linux-arm64": {
75 - version: "0.156.1",
76 + version: "0.166.0",
77 target: "aarch64-unknown-linux-musl",
77 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-aarch64-unknown-linux-musl.tar.gz",
78 - sha256: "fdd47ed6aade0360796fd3f6f95a45096f327c15e19e8c7339f9dc5633041786",
79 - archiveBytes: 136933361,
78 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-aarch64-unknown-linux-musl.tar.gz",
79 + sha256: "7821b77dda2e6283fb1f63f3165177a271da8833e857cf673c6ca1c9db3bfcc6",
80 + archiveBytes: 187370368,
81 },
82 "linux-x64": {
82 - version: "0.156.1",
83 + version: "0.166.0",
84 target: "x86_64-unknown-linux-musl",
84 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-x86_64-unknown-linux-musl.tar.gz",
85 - sha256: "8b711520beddf385467b8da4d2c93736637c6ba1e46811cf0d8606b7c490b6f6",
86 - archiveBytes: 145976992,
85 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-x86_64-unknown-linux-musl.tar.gz",
86 + sha256: "1d44b28bc4ac9937d7d3532264baa68a507ce364956a0d4ebb856f331cdee254",
87 + archiveBytes: 199694962,
88 },
89 "win32-arm64": {
89 - version: "0.156.1",
90 + version: "0.166.0",
91 target: "aarch64-pc-windows-msvc",
91 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-aarch64-pc-windows-msvc.tar.gz",
92 - sha256: "85994caecdc7609c49fd585c1cdb5677fa9d0acbf789650cff23a13afc9505db",
93 - archiveBytes: 142037952,
92 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-aarch64-pc-windows-msvc.tar.gz",
93 + sha256: "9383152a72f97bb5dd148493c8214e4fed38d805aa2c3297cb3739f7f130becf",
94 + archiveBytes: 187024318,
95 },
96 "win32-x64": {
96 - version: "0.156.1",
97 + version: "0.166.0",
98 target: "x86_64-pc-windows-msvc",
98 - url: "https://github.com/openai/codex/releases/download/rust-v0.156.1/codex-package-x86_64-pc-windows-msvc.tar.gz",
99 - sha256: "a2e017db9807e6a2269a26fea0e1d9546469cef4d472a33016bc9f3ad7d3b733",
100 - archiveBytes: 153839991,
99 + url: "https://github.com/openai/codex/releases/download/rust-v0.166.0/codex-package-x86_64-pc-windows-msvc.tar.gz",
100 + sha256: "d559bb88e74d471265857b93b7f19bc250dae527673b9191b33534478093f6bc",
101 + archiveBytes: 202589789,
102 },
103 };
104 const resolveCodexReleaseAsset = (platform: NodeJS.Platform, arch: string) =>
@@ -655,14 +656,12 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function
656 }
657 const operationId = yield* random.uuidV4();
658 const next: ProviderInstallState = {
658 - driver: DRIVER,
659 + ...current,
660 operationId,
661 phase: "downloading",
662 downloadedBytes: 0,
663 totalBytes: asset.archiveBytes,
664 version: asset.version,
664 - installedVersion: current.installedVersion,
665 - canRemove: current.canRemove,
665 message: "Downloading Codex.",
666 };
667 yield* SubscriptionRef.set(state, next);
@@ -807,6 +806,9 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function
806 source: "managed",
807 }) satisfies ProviderInstallState,
808 );
809 + // A supported older runtime still resolves, so a raised pin needs its own update.
810 + if (asset && compareSemverVersions(installed.version, asset.version) < 0)
811 + yield* start.pipe(Effect.ignore);
812 }).pipe(
813 Effect.catch(() =>
814 SubscriptionRef.update(