Skip to content

Handle new Codex terminal error variants - #2455

Open
ymichael wants to merge 1 commit into
mainfrom
bb/post-merge-fix-handle-codex-0-149-1-terminal-err-thr_7pa2mstkg5
Open

Handle new Codex terminal error variants#2455
ymichael wants to merge 1 commit into
mainfrom
bb/post-merge-fix-handle-codex-0-149-1-terminal-err-thr_7pa2mstkg5

Conversation

@ymichael

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Codex 0.149.1 added sessionBudgetExceeded and misalignmentPolicyViolation to its generated error contract, but BB's handwritten runtime schema and category mapper remained stale. Because both error and failed turn/completed pass through that shared parser, either new literal was downgraded to an unhandled provider event and the failed turn omitted its terminal boundary. The root cause and current-main reproduction are recorded in the fixer thread.

What changed

  • Admit both generated literals at the shared runtime error boundary.
  • Enforce bidirectional compile-time parity between the generated CodexErrorInfo union and the handwritten runtime schema so future regeneration drift fails typecheck.
  • Classify session rollout budget exhaustion as budget-exceeded, not an account rate-limit, and classify misalignment as policy; preserve both exact provider codes.
  • Cover both literals through both normalized error and failed turn/completed behavior.

This is provider-local runtime translation. No server/daemon wire contract changed, so HOST_DAEMON_PROTOCOL_VERSION is unchanged.

How you verified

  • The focused regression failed before the production change: both cases produced provider/unhandled instead of provider/error and never reached their failed-turn boundary assertion.
  • The same focused Turbo test passed after the fix and again after rebasing onto current origin/main.
  • pnpm exec turbo run typecheck test build --filter=bb-plugin-provider-codex --force: 24 test files and 240 tests passed; typecheck and applicable build prerequisites passed.
  • A two-pass translator harness now consistently produces provider.error plus turn.boundary; error info is exactly budget-exceeded / sessionBudgetExceeded and policy / misalignmentPolicyViolation.
  • The rebased diff remains 73 manually authored lines: 14 production and 59 tests.

Fixes #

AGENT GENERATED

Keep the handwritten runtime error schema aligned with the generated Codex contract so session-budget and misalignment failures remain normalized and terminal.
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