Skip to content

Surface Flex capacity failures as a distinct terminal error - #47967

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f2e03a6d2d36a6d9748c35952e40397f8670d121
Sep 24, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/f2e03a6d2d36a6d9748c35952e40397f8670d121

Conversation

@copyberry

@copyberry copyberry Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

Surface Flex capacity failures as a distinct terminal error

What changed

  • Recognize flex_unavailable in HTTP 429 responses and streamed error and response.failed events. End normal turns without retries and report Flex capacity unavailable.
  • Expose flexUnavailable through the core and app-server protocols and generated schemas and SDK types.
  • Keep Flex capacity failures eligible for Guardian review and sampler retries, with a distinct telemetry classification.
  • Map unexpected HTTP responses to HttpConnectionFailed, preserving their status codes.

Testing

Add regression coverage for terminal Flex failures over HTTP, SSE, and WebSocket, HTTP 504 status preservation after a stream retry, and protocol serialization. Update Guardian retry and sampler recovery tests to cover Flex failures.

## What changed

- Recognize `flex_unavailable` in HTTP 429 responses and streamed `error` and `response.failed` events. End normal turns without retries and report `Flex capacity unavailable.`
- Expose `flexUnavailable` through the core and app-server protocols and generated schemas and SDK types.
- Keep Flex capacity failures eligible for Guardian review and sampler retries, with a distinct telemetry classification.
- Map unexpected HTTP responses to `HttpConnectionFailed`, preserving their status codes.

## Testing

Add regression coverage for terminal Flex failures over HTTP, SSE, and WebSocket, HTTP 504 status preservation after a stream retry, and protocol serialization. Update Guardian retry and sampler recovery tests to cover Flex failures.

GitOrigin-RevId: f2e03a6d2d36a6d9748c35952e40397f8670d121
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/f2e03a6d2d36a6d9748c35952e40397f8670d121 branch from 9569b5e to dafb133 Compare September 24, 2026 23:33
@copyberry
copyberry Bot merged commit dafb133 into main Sep 24, 2026
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/f2e03a6d2d36a6d9748c35952e40397f8670d121 branch September 24, 2026 23:33
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 24, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant