Skip to content

[Bug]: OpenCode Go Muse Spark 1.3 rejects Codex web_search indexed_web_access #3362

Description

@0disoft

Client or integration

Codex App

Provider or upstream service

OpenCode Go (opencode-go / Console Go)

OpenCodex version

2.41.0

Endpoint or capability

/v1/responses web search tool translation for opencode-go/muse-spark-1.3-contributor

Current behaviour

OpenCodex 2.41.0 correctly routes muse-spark-1.3-contributor through openai-responses, but a normal Codex App turn fails when the client-provided web_search tool includes indexed_web_access.

The OpenCode Go upstream rejects the request with HTTP 400:

[invalid_request_error] `tools[].indexed_web_access` is not supported for Responses web_search.

A text-only request through the same provider/model succeeds. Provider authentication, model discovery, and the base Responses route are healthy.

stripMuseSparkUnsupportedWebSearchFields() already removes search_content_types for Muse Spark 1.2 and 1.3, but does not remove indexed_web_access.

Expected behaviour

For the strict Muse Spark Responses models, OpenCodex should remove indexed_web_access from a plain web_search tool before forwarding the request to OpenCode Go, just as it already removes search_content_types.

The request should then complete normally through /zen/go/v1/responses while preserving the supported web search tool fields.

Minimal redacted request or reproduction

# Select opencode-go/muse-spark-1.3-contributor in Codex App and send any turn.
# Codex App 0.153.0-alpha.5 advertises web_search with indexed_web_access.

curl http://127.0.0.1:10100/v1/responses \
  -H 'Authorization: Bearer [REDACTED]' \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "opencode-go/muse-spark-1.3-contributor",
    "input": [{
      "role": "user",
      "content": [{"type": "input_text", "text": "Reply with exactly OK."}]
    }],
    "tools": [{
      "type": "web_search",
      "indexed_web_access": true,
      "search_content_types": ["webpage"]
    }],
    "tool_choice": "auto",
    "reasoning": {"effort": "low"},
    "stream": true,
    "max_output_tokens": 64
  }'

Actual response or error

HTTP 400
Error from provider (Console Go): Upstream request failed: [invalid_request_error] `tools[].indexed_web_access` is not supported for Responses web_search.

OpenCodex request-history evidence:

provider: opencode-go
model: muse-spark-1.3-contributor
adapter: openai-responses
status: 400
closeReason: non_stream
errorCode: invalid_request_error
usageStatus: unreported

Control results:

Direct OpenCode Go /zen/go/v1/responses request without indexed_web_access: HTTP 200
OpenCodex text-only request: HTTP 200, closeReason=terminal
Locally patched OpenCodex request with the full Codex web_search shape: HTTP 200, closeReason=terminal, usageStatus=reported

Upstream documentation

Suggested mapping or implementation notes

Extend the existing Muse-only sanitizer in src/adapters/openai-responses.ts:

if (!Object.hasOwn(tool, "search_content_types") &&
    !Object.hasOwn(tool, "indexed_web_access")) return tool;

const {
  search_content_types: _droppedSearchContentTypes,
  indexed_web_access: _droppedIndexedWebAccess,
  ...rest
} = tool;

Apply the same rewrite to both top-level body.tools and nested additional_tools, matching the existing function's behavior.

This was locally validated against the exact failing provider/model and changed the result from HTTP 400 to HTTP 200.

Additional context and attachments

Checks

  • I searched existing provider and compatibility issues.
  • The request and response were redacted.
  • The expected behaviour is based on an upstream specification or a concrete client requirement.

Activity

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

    providerProvider adapters, OpenAI-compat presets, upstream API quirksprovider-compatibilityProvider compatibility reportstoolstool_calls, MCP, web-search / sidecar tools

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions