@devries-cameron20 / t3code-1 / commits / 586c790eeb
Fork 0

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

fix(server): Codex network waits no longer show a stale retry limit (#29224)

Co-authored-by: afrojun <1935642+afrojun@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

Arjun Radhakrishnan committed Nov 11, 2026 at 23:03 UTC 586c790eebb51ac4eaf050b2247d019aee97d2f7
2 files changed +30 -5
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.test.ts
+28 -4
@@ -3737,6 +3737,25 @@ describe("CodexAdapterV2 post-settle continuation", () => {
3737 },
3738 },
3739 },
3740 + {
3741 + type: "emit_inbound",
3742 + label: "error/retry/waiting-for-network",
3743 + frame: {
3744 + method: "error",
3745 + params: {
3746 + threadId: nativeThreadId,
3747 + turnId: nativeTurnId,
3748 + willRetry: true,
3749 + error: {
3750 + message: "Reconnecting... waiting for network",
3751 + additionalDetails: "Connection failed: error sending request",
3752 + codexErrorInfo: {
3753 + responseStreamDisconnected: { httpStatusCode: null },
3754 + },
3755 + },
3756 + },
3757 + },
3758 + },
3759 {
3760 type: "emit_inbound",
3761 label: "item/started/after-retry",
@@ -3820,7 +3839,7 @@ describe("CodexAdapterV2 post-settle continuation", () => {
3839 ? [event.turnItem]
3840 : [],
3841 );
3823 - assert.lengthOf(retryItems, 2);
3842 + assert.lengthOf(retryItems, 3);
3843 assert.equal(retryItems[0]?.status, "running");
3844 assert.equal(retryItems[0]?.failure.code, "responseStreamDisconnected");
3845 assert.deepEqual(retryItems[0]?.retry, {
@@ -3828,9 +3847,14 @@ describe("CodexAdapterV2 post-settle continuation", () => {
3847 maxAttempts: 5,
3848 retryDelayMs: null,
3849 });
3831 - assert.equal(retryItems[1]?.id, retryItems[0]?.id);
3832 - assert.equal(retryItems[1]?.status, "completed");
3833 - assert.equal(retryItems[1]?.title, "Provider recovered");
3850 + assert.deepEqual(retryItems[1]?.retry, {
3851 + attempt: 3,
3852 + maxAttempts: null,
3853 + retryDelayMs: null,
3854 + });
3855 + assert.equal(retryItems[2]?.id, retryItems[0]?.id);
3856 + assert.equal(retryItems[2]?.status, "completed");
3857 + assert.equal(retryItems[2]?.title, "Provider recovered");
3858
3859 const recoveredIndex = harness.events.findIndex(
3860 (event) =>
apps/server/src/orchestration-v2/Adapters/CodexAdapterV2.ts
+2 -1
@@ -4885,7 +4885,8 @@ export const makeCodexAdapterV2 = Effect.fn("makeCodexAdapterV2")(function* (
4885 const progress = parseCodexRetryProgress(payload.error.message);
4886 const retry: OrchestrationV2ProviderRetry = {
4887 attempt: progress?.attempt ?? (previous?.retry.attempt ?? 0) + 1,
4888 - maxAttempts: progress?.maxAttempts ?? previous?.retry.maxAttempts ?? null,
4888 + // Codex drops the count once it starts waiting for the network, which has no limit.
4889 + maxAttempts: progress?.maxAttempts ?? null,
4890 retryDelayMs: null,
4891 };
4892 const code = codexErrorInfoCode(payload.error.codexErrorInfo);