Skip to content

Route Codex standalone search through the Account Pooler - #3541

Merged
SawyerHood merged 1 commit into
mainfrom
bb/fix-bb-issue-3528-thr_b9auerm6th
Sep 11, 2026
Merged

SawyerHood merged 1 commit into
mainfrom
bb/fix-bb-issue-3528-thr_b9auerm6th

Conversation

@SawyerHood

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

Codex web search (the web.run tool) sends a standalone request to ${CODEX_OPENAI_BASE_URL}/alpha/search. The Account Pooler contributes CODEX_OPENAI_BASE_URL as /api/v1/plugins/account-pool/http/v1, so the request reaches the plugin as POST /v1/alpha/search. Plugin HTTP routes match exactly, and the pool registered only /v1/responses, the two image routes, and GET /v1/models for Codex. Every search from a pooled Codex thread stopped at the plugin router with plugin "account-pool" has no POST route for "/v1/alpha/search" and never reached the hub. Codex logs on bee show this 404 in production threads on 2026-09-08, 09-09 and 09-10. See #3528 and the reproduction report.

What changed

  • plugins/account-pool/src/server.ts: registers POST /v1/alpha/search next to the other Codex routes and sends it to hub.handle(..., "codex"). The hub already forwards by path (mountedUpstreamUrl(..., "v1/")), so the request reaches <codexUpstreamBaseUrl>/alpha/search with the usual pool token check, account selection, credential replacement, failover and quota accounting. This is the fix proposed in the issue.
  • plugins/account-pool/src/server.test.ts: the native Codex route test now covers alpha/search as well as the image routes. It checks that a request without the pool token gets 401, and that an authenticated request reaches the upstream path with account credentials, no pool token header, an unchanged body, and the upstream response passed through.

No wire, CLI, or configuration changes.

How you verified

  • pnpm exec turbo run test typecheck --filter=bb-plugin-account-pool: 281 tests pass and typecheck is clean.

  • Fail-before: with the old server.ts, the new alpha/search case fails with no http route POST /v1/alpha/search is registered.

  • End to end with real Codex CLI 0.154.0 against a dev bb app from this branch. The Account Pooler routed a real Codex account (production access token with a fake refresh token, removed afterwards), and each thread was asked to find the latest Node.js LTS version with web search. Codex's own request log (~/.codex/logs_2.sqlite) recorded:

    Pool code POST …/account-pool/http/v1/alpha/search Thread result
    this fix 200 OK (Cloudflare headers from the ChatGPT upstream) answered with version and source URL
    route removed, plugin reloaded 404 Not Found: plugin "account-pool" has no POST route for "/v1/alpha/search" "the web tool returned a 404 error"
    fix restored, plugin reloaded 200 OK answered with version and source URL

Fixes #3528

AGENT GENERATED

🤖 Generated with Claude Code

Codex web search posts to ${CODEX_OPENAI_BASE_URL}/alpha/search. The pool
registered no route for /v1/alpha/search, so every search from a pooled
Codex thread failed with a router-level 404 before reaching the hub.

Fixes #3528

Co-Authored-By: Claude Code <[email protected]>
@SawyerHood
SawyerHood merged commit b055ddd into main Sep 11, 2026
16 checks passed
@SawyerHood
SawyerHood deleted the bb/fix-bb-issue-3528-thr_b9auerm6th branch September 11, 2026 21:38
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.

Account Pooler has no route for Codex standalone search, so Codex web search 404s through the pool

1 participant