Skip to content

Commit 260297b

Browse files
maria-rcksclaude
andauthored
fix(server): GPT-6.1 Sol no longer compacts after every tool call on managed Codex (#30004)
Co-authored-by: maria-rcks <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 550c5fa commit 260297b

2 files changed

Lines changed: 56 additions & 27 deletions

File tree

‎apps/server/src/provider/CodexInstallation.test.ts‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,33 @@ it.effect("requires an update before running an older activated managed installa
359359
}).pipe(Effect.scoped, Effect.provide(Layer.mergeAll(NodeServices.layer, NodeCrypto.layer))),
360360
);
361361

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+
362389
it.effect("rejects corrupted downloads without publishing a runtime", () =>
363390
Effect.gen(function* () {
364391
const { installation, fs } = yield* makeHarness({

‎apps/server/src/provider/CodexInstallation.ts‎

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
type ServerProviderCompatibilityAdvisory,
66
} from "@t3tools/contracts";
77
import { cliArchiveTarCommand } from "@t3tools/shared/cliRelease";
8+
import { compareSemverVersions } from "@t3tools/shared/semver";
89
import * as HostProcess from "@t3tools/shared/HostProcess";
910
import { resolveCommandPath, resolveSpawnCommand } from "@t3tools/shared/shell";
1011
import * as Clock from "effect/Clock";
@@ -58,46 +59,46 @@ export interface CodexReleaseAsset {
5859
}
5960
const RELEASES: Readonly<Record<string, CodexReleaseAsset>> = {
6061
"darwin-arm64": {
61-
version: "0.156.1",
62+
version: "0.166.0",
6263
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,
6667
},
6768
"darwin-x64": {
68-
version: "0.156.1",
69+
version: "0.166.0",
6970
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,
7374
},
7475
"linux-arm64": {
75-
version: "0.156.1",
76+
version: "0.166.0",
7677
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,
8081
},
8182
"linux-x64": {
82-
version: "0.156.1",
83+
version: "0.166.0",
8384
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,
8788
},
8889
"win32-arm64": {
89-
version: "0.156.1",
90+
version: "0.166.0",
9091
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,
9495
},
9596
"win32-x64": {
96-
version: "0.156.1",
97+
version: "0.166.0",
9798
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,
101102
},
102103
};
103104
const resolveCodexReleaseAsset = (platform: NodeJS.Platform, arch: string) =>
@@ -655,14 +656,12 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function
655656
}
656657
const operationId = yield* random.uuidV4();
657658
const next: ProviderInstallState = {
658-
driver: DRIVER,
659+
...current,
659660
operationId,
660661
phase: "downloading",
661662
downloadedBytes: 0,
662663
totalBytes: asset.archiveBytes,
663664
version: asset.version,
664-
installedVersion: current.installedVersion,
665-
canRemove: current.canRemove,
666665
message: "Downloading Codex.",
667666
};
668667
yield* SubscriptionRef.set(state, next);
@@ -807,6 +806,9 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function
807806
source: "managed",
808807
}) satisfies ProviderInstallState,
809808
);
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);
810812
}).pipe(
811813
Effect.catch(() =>
812814
SubscriptionRef.update(

0 commit comments

Comments
 (0)