Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(codex): sharing usage limits offer the existing recovery options #25341

Mergedshivamhwp(GitHub profile, opens in a new tab)merged 8 commits intomain fromrefs/pull/25341/headmerged by shivamhwp(GitHub profile, opens in a new tab) View on GitHub

Showing 8 changed files with 123 additions and 18 deletions (loading 6).

x
0 of 8 viewed, 8 left
101 additions and 13 deletionsapps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.tsModified
View file
@@ -478,6 +478,8 @@
});
​
const DEFAULT_CODEX_SETTINGS = Schema.decodeSync(CodexSettings)({});
+const CHATGPT_SHARING_LIMIT_MESSAGE =
+ "stream disconnected before completion: The ChatGPT user has reached their Subscription Sharing usage limit. Ask the user to try again after their usage limit resets or use an API key instead.";
const CODEX_TEST_MODEL_SELECTION = {
instanceId: CodexAdapterV2.CODEX_DEFAULT_INSTANCE_ID,
model: "gpt-5.4",
@@ -1173,6 +1175,7 @@
onRequest: (method: string, params: unknown) => Effect.Effect<void> = () => Effect.void,
readChildMetadata?: Parameters<typeof withCodexReplayChildMetadata>[2],
beforeEmitInbound?: CodexReplay.CodexAppServerReplayDriver["beforeEmitInbound"],
+ onUsageLimits?: CodexAdapterV2.CodexAdapterV2Options["onUsageLimits"],
Effect.gen(function* () {
const fileSystem = yield* FileSystem.FileSystem;
@@ -1230,6 +1233,7 @@
settings: DEFAULT_CODEX_SETTINGS,
environment: {},
clientFactory,
+ ...(onUsageLimits ? { onUsageLimits } : {}),
digest: yield* Digest.Digest,
fileSystem,
idAllocator,
@@ -5426,14 +5430,58 @@
code: "other",