Skip to content

Add bounded retries for transient Codex server errors#110

Merged
tsubasakong merged 1 commit intomainfrom
fix/codex-server-error-retries
Mar 13, 2026
Merged

Add bounded retries for transient Codex server errors#110
tsubasakong merged 1 commit intomainfrom
fix/codex-server-error-retries

Conversation

@tsubasakong
Copy link
Collaborator

Summary

  • add bounded retries for transient OpenAI/Codex server_error responses in the legacy runtime path
  • add the same retry semantics to pi_session_bridge so both backends recover consistently from transient upstream failures
  • extend runtime seam coverage for retryable and non-retryable Codex errors on both backends

Why

Transient upstream OpenAI/Codex server errors were terminating phone tasks immediately, which broke long-running automations even when a simple retry would have recovered. The legacy and bridge backends also behaved differently, so the runtime needed a consistent recovery path.

Changes

  • add shared retry classification helpers and reuse the formatted model error logger for retry handling
  • retry bounded server_error/5xx-style model failures with exponential backoff (1s, 2s) before surfacing a failure
  • keep non-retryable model errors and aborted runs on the existing failure path
  • update continuation handling so follow-up work spawned by retries and textual fallback execution is fully drained before finalizing the run
  • add seam tests covering retry success and non-retryable failure for both legacy_agent_core and pi_session_bridge

Testing

  • node --test test/runtime-seams.test.mjs
  • npm test

Checklist

  • I ran relevant tests, or the Testing section explains why I did not.
  • I updated docs, or confirmed no doc changes were needed.
  • I confirmed the PR does not include secrets, credentials, or private data.

@vercel
Copy link

vercel bot commented Mar 13, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openpocket Ready Ready Preview, Comment Mar 13, 2026 6:42pm

Request Review

@tsubasakong tsubasakong merged commit e5a0a97 into main Mar 13, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant