Skip to content

[Bug] A static Responses Lite provider header leaks into the classic OpenAI search helper #8160

Closed

Description

@tackle-me

Client or integration

Codex search sidecar; deterministic helper-level reproduction and an authenticated diagnostic request.

Area

Tools / MCP / web search

Summary

runWebSearch() merges selected caller and provider headers, including x-openai-internal-codex-responses-lite, then independently creates a classic Responses request with hosted web_search and reasoning: { effort: ... }.

A diagnostic request with this mismatched header/body was rejected with HTTP 400: the Lite marker requires reasoning.context to be all_turns. The capture below reproduces the mismatch without network access.

Trigger scope: Codex 0.166 CLI captures with the current routed catalog did not show a natural client path that sends a Lite marker to the hosted-search helper: routed Opus requests were classic, and native GPT's Lite request declared no hosted search. This is a configuration-specific robustness report. A static providers.openai.headers entry for the marker reproduces it without an incoming Lite header. I have not observed a current default-client regression.

Configuration trigger

The relevant configuration shape is an OpenAI search sidecar whose forward provider has this static header. The routed main model can use its ordinary classic request. No credentials are included:

{
  "providers": {
    "openai": {
      "adapter": "openai-responses",
      "authMode": "forward",
      "baseUrl": "https://chatgpt.com/backend-api/codex",
      "headers": { "x-openai-internal-codex-responses-lite": "true" }
    }
  },
  "webSearchSidecar": { "backend": "openai", "model": "gpt-6.1-sol" }
}

Reproduction

Save at the repository root as repro-lite.ts and run bun repro-lite.ts.

import { runWebSearch } from './src/web-search/executor.ts';
const original = globalThis.fetch;
let sent: any;
globalThis.fetch = (async (_url: any, init: any) => {
  sent = { headers: new Headers(init.headers), body: JSON.parse(init.body) };
  return new Response('data: ' + JSON.stringify({ type: 'response.completed',
    response: { status: 'completed', output: [] } }) + '\n\n');
}) as any;
try {
  await runWebSearch('synthetic query', { type: 'web_search' }, {
    adapter: 'openai-responses', authMode: 'forward',
    baseUrl: 'https://chatgpt.com/backend-api/codex',
    headers: { 'x-openai-internal-codex-responses-lite': 'true' },
  } as any, new Headers(),
  { model: 'gpt-6.1-sol', reasoning: 'low', timeoutMs: 1000 });
  console.log({ lite: sent.headers.has('x-openai-internal-codex-responses-lite'),
    reasoning: sent.body.reasoning, tools: sent.body.tools });
} finally { globalThis.fetch = original; }

Actual: lite: true, hosted web_search, and reasoning: { effort: 'low' } without the required Lite context. Here the marker comes entirely from static provider headers: the incoming Headers object is empty. An incoming-marker variant also reproduces at the helper boundary, but its current real-client trigger remains unconfirmed.

Expected behavior and tested mitigation

When the helper owns a classic envelope, remove the Lite marker case-insensitively from its merged headers, while preserving unrelated selected headers. A local patch and focused header-capture checks cover incoming and static markers.

A fully Lite-conformant helper would be an alternative design only if hosted search is supported on that wire. In a separate diagnostic, adding the context field still returned HTTP 400 because Lite accepted only function/custom tools and client-executed tool search. Adding reasoning.context alone is therefore not a verified fix for the hosted-search helper.

Version

OpenCodex 2.97.0; Bun 1.4.4.

src/web-search/executor.ts matches inspected dev commit ad6a80e5cd5cf347097dbd0572e2410f92e7604b.

Operating system

Windows 10 Pro, x64, build 19045.

Checks

  • I searched existing issues and pull requests.
  • The capture uses a fetch stub. Authenticated diagnostic results are reduced to status/error facts; no credential or original request is attached.

Activity

  1. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    Automated translation bookkeeping — detected language: English.

  2. coderabbitai commented on Nov 4, 2026

    @coderabbitai
    Contributor
    🔗 Related PRs

    #8065 - fix(codex): isolate Pool installation identity per account [merged]


    📝 Issue Planner

    Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.

    • Create Plan

    🧪 Issue enrichment is currently in open beta.

    To disable automatic issue enrichment, add the following to your .coderabbit.yaml:

    issue_enrichment:
      auto_enrich:
        enabled: false

    💬 Have feedback or questions? Drop into our discord!

  3. added
    bug
    catalog
    tools
    on Nov 4, 2026
  4. github-actions commented on Nov 4, 2026

    @github-actions
    Contributor

    Issue reopened

    The report now contains the information required by the automated check. Thanks for updating it.

  5. lidge-jun commented on Nov 6, 2026

    @lidge-jun
    Owner

    Fixed on dev by #8202 (62578b5): the classic OpenAI search helper no longer forwards the Responses Lite marker header. It ships in the next release from dev.

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

    bugcatalogtools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions