Skip to content

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

Closed

Description

@MacKevinroe

Summary

The Account Pooler does not register a route for Codex's standalone search endpoint, so Codex web search fails with a router-level 404 for every thread routed through the pool:

HTTP 404: plugin "account-pool" has no POST route for "/v1/alpha/search"

The agent then degrades to fetching pages directly, which hits JavaScript/cookie challenges, so the failure surfaces as "web search is broken" rather than as a routing gap.

Cause

packages/.../account-pool/src/server.ts contributes CODEX_OPENAI_BASE_URL as serverPath: "/api/v1/plugins/account-pool/http/v1". Current Codex clients send standalone search to ${base}/alpha/search, which arrives at the plugin as subPath /v1/alpha/search.

The plugin registers only:

  • POST /v1/messages (claude)
  • POST /v1/messages/count_tokens (claude)
  • POST /v1/responses (codex)
  • GET /v1/models (codex)
  • HEAD /api/hello

bb.http.route is exact-match, so the request stops in src/routes/plugins.ts and never reaches the hub.

Nothing else is missing. mountedUpstreamUrl(request, settings.codexUpstreamBaseUrl, "v1/") already forwards by path, so the request needs no translation — only a registration.

Verification (bb 0.42.1, Linux)

Before, through the pool:

POST {CODEX_OPENAI_BASE_URL}/alpha/search  -> 404 {"ok":false,"error":"plugin \"account-pool\" has no POST route for \"/v1/alpha/search\""}
POST {ANTHROPIC_BASE_URL}/v1/messages/count_tokens -> 200   (control)

The upstream supports the endpoint. Direct to the configured Codex upstream with pool-style credentials:

POST https://chatgpt.com/backend-api/codex/alpha/search
  {"id":"...","model":"gpt-5.6-sol","commands":{"search_query":[{"q":"..."}]}}
  -> 200 {"encrypted_output":"gAAAAA..."}

Suggested fix

One registration alongside the existing Codex routes:

bb.http.route(
  "POST",
  "/v1/alpha/search",
  (context) => hub.handle(context.req.raw, "codex"),
  { auth: "none" },
);

I applied exactly this to the shipped bundle on my host and reloaded the plugin:

POST {CODEX_OPENAI_BASE_URL}/alpha/search -> 200 {"encrypted_output":"gAAAAA..."}
POST {ANTHROPIC_BASE_URL}/v1/messages/count_tokens -> 200   (no regression)

It slots into the existing pipeline unchanged: account selection, credential replacement, failover, quota accounting and logging all come from hub.handle. parseCodexRequestBody tolerates the search body shape (no thread-id/prompt_cache_key, so no affinity pin, family: "other").

Since account-pool is builtin, a local patch is reverted by the next bb-app update, hence this issue.

Note for triage

Claude Code's WebSearch is unaffected and needs no route: it rides /v1/messages with the server-side web_search_20250305 tool. This is Codex-specific.

A different proxy hit the identical gap and fixed it the same way, which may be useful for confirming the client contract: farion1231/cc-switch#5378 and its PR #5379.

Activity

  1. added theissue type on Sep 11, 2026
  2. added
    providers
    provider-codex
    confirmed-repro
    on Sep 11, 2026
  3. bb-slop-cop commented on Sep 11, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Classified as Bug · Medium priority · Low effort; added providers and provider-codex.

    REPRODUCED · high root-cause confidence — reproduction report. Two clean checkouts of trusted main reproduced the missing Codex search registration. Exact route lookup rejects the request before the pool hub; the existing responses control reaches its authentication gate. The report includes the failing test. Live upstream search was not tested.

    Reproduction label: confirmed-repro.

    No PR: adding an externally callable HTTP endpoint exceeds this rule's simple-fix restriction against public-protocol changes.

    AGENT GENERATED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-reproprovider-codexproviders

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions