|
5 | 5 | type ServerProviderCompatibilityAdvisory, |
6 | 6 | } from "@t3tools/contracts"; |
7 | 7 | import { cliArchiveTarCommand } from "@t3tools/shared/cliRelease"; |
| 8 | +import { compareSemverVersions } from "@t3tools/shared/semver"; |
8 | 9 | import * as HostProcess from "@t3tools/shared/HostProcess"; |
9 | 10 | import { resolveCommandPath, resolveSpawnCommand } from "@t3tools/shared/shell"; |
10 | 11 | import * as Clock from "effect/Clock"; |
@@ -58,46 +59,46 @@ export interface CodexReleaseAsset { |
58 | 59 | } |
59 | 60 | const RELEASES: Readonly<Record<string, CodexReleaseAsset>> = { |
60 | 61 | "darwin-arm64": { |
61 | | - version: "0.156.1", |
| 62 | + version: "0.166.0", |
62 | 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, |
66 | 67 | }, |
67 | 68 | "darwin-x64": { |
68 | | - version: "0.156.1", |
| 69 | + version: "0.166.0", |
69 | 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, |
73 | 74 | }, |
74 | 75 | "linux-arm64": { |
75 | | - version: "0.156.1", |
| 76 | + version: "0.166.0", |
76 | 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, |
80 | 81 | }, |
81 | 82 | "linux-x64": { |
82 | | - version: "0.156.1", |
| 83 | + version: "0.166.0", |
83 | 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, |
87 | 88 | }, |
88 | 89 | "win32-arm64": { |
89 | | - version: "0.156.1", |
| 90 | + version: "0.166.0", |
90 | 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, |
94 | 95 | }, |
95 | 96 | "win32-x64": { |
96 | | - version: "0.156.1", |
| 97 | + version: "0.166.0", |
97 | 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, |
101 | 102 | }, |
102 | 103 | }; |
103 | 104 | const resolveCodexReleaseAsset = (platform: NodeJS.Platform, arch: string) => |
@@ -655,14 +656,12 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function |
655 | 656 | } |
656 | 657 | const operationId = yield* random.uuidV4(); |
657 | 658 | const next: ProviderInstallState = { |
658 | | - driver: DRIVER, |
| 659 | + ...current, |
659 | 660 | operationId, |
660 | 661 | phase: "downloading", |
661 | 662 | downloadedBytes: 0, |
662 | 663 | totalBytes: asset.archiveBytes, |
663 | 664 | version: asset.version, |
664 | | - installedVersion: current.installedVersion, |
665 | | - canRemove: current.canRemove, |
666 | 665 | message: "Downloading Codex.", |
667 | 666 | }; |
668 | 667 | yield* SubscriptionRef.set(state, next); |
@@ -807,6 +806,9 @@ export const makeCodexInstallation = Effect.fn("makeCodexInstallation")(function |
807 | 806 | source: "managed", |
808 | 807 | }) satisfies ProviderInstallState, |
809 | 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); |
810 | 812 | }).pipe( |
811 | 813 | Effect.catch(() => |
812 | 814 | SubscriptionRef.update( |
|
0 commit comments