Skip to content

fix(responses): strip search_content_types on web_search for Muse Spark (#2617) - #2621

Merged
lidge-jun merged 8 commits into
devfrom
codex/2617-muse-spark-web-search
Aug 25, 2026
Merged

lidge-jun merged 8 commits into
devfrom
codex/2617-muse-spark-web-search

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Aug 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Carries #2617 by @DevonGithub onto dev (the original targets main, which is maintainer-promotion-only), with a regression test and without an unrelated version bump.

Muse Spark's Responses gateway 400s a plain web_search carrying search_content_types, while accepting the same field on web_search_preview and accepting a bare web_search. The field is not ours: Codex emits it from web_search_tool_type: TextAndImage. This is the same incompatibility class Codex itself handles for Bedrock by selecting text-only search, so dropping exactly the refused field at the adapter boundary is a compatibility guard rather than a symptom patch — the tool type and every other accepted option survive, and other models on the same provider are untouched.

What I changed from the submitted PR

  • Dropped the package.json 2.32.1-preview.20260825 → 2.33.0 bump. Versioning belongs to the release train, not to a bug fix; that edit would have moved the release surface as a side effect of a web-search fix.
  • Added tests/muse-spark-web-search-compat.test.ts. This touches a shared adapter and the provider registry, and shipped with no test, so neither the model-scoped field removal nor the new Responses wire default was protected.
  • Updated the registry decision log, which still described modelWireDefaults as Luna-only after gaining a second entry. A decision log that no longer matches its own map is worse than none.

Verification

bun x tsc --noEmit                                  exit 0
bun test ./tests/muse-spark-web-search-compat.test.ts \
         ./tests/responses-routed-web-search-fields.test.ts \
         ./tests/provider-registry-parity.test.ts     52 pass / 0 fail

Falsified: removing the sanitizer call reddens the plain-web_search and nested additional_tools cases and nothing else — the web_search_preview, other-model, and registry assertions stay green, which is what pins the change as narrow rather than blanket.

One claim I could not independently reproduce, stated plainly: the PR's live 200/400 matrix. The available account now receives 403 … requires explicit opt in for every Muse request, so the gateway's rejection could not be re-probed here. What is independently confirmed is the field's origin in Codex's hosted_spec.rs and the precedent of Codex switching Bedrock to text-only for the same reason. The change is safe regardless of that matrix: it is scoped to one exact model and removes one field the OpenAI-only sanitizer already treats as optional.

Checklist

  • Targets dev
  • Regression test added and falsified
  • Registry decision log kept consistent with the map it documents
  • No credential, auth, workflow or release-automation surface touched

Closes #2617.

Summary by CodeRabbit

  • New Features
    • Added compatibility for Muse Spark web searches when using OpenCode Go.
    • Muse Spark requests are routed through the appropriate Responses interface.
    • Existing web-search options and behavior remain unchanged for other models.

lidge-jun and others added 8 commits August 25, 2026 10:36
release: promote dev into main for v2.32.1
# Conflicts:
#	package.json
[WRONG BRANCH] merge dev into main for the v2.33.0 release
Muse Spark (muse-spark-1.2-contributor) only serves over the Responses API. Its
gateway rejects search_content_types on a plain web_search tool (400) but
accepts it on web_search_preview and accepts every other web_search field on
both tool types (probed directly 2026-08-26). Only Muse is affected; Luna and
DeepSeek are not.

- Strip search_content_types from web_search for Muse only.
- Route Muse to the same openai-responses default as gpt-5.6-luna.
…rk (#2617)

Carries DevonGithub's change onto dev with the test it needs, minus an
unrelated version bump.

Three changes to what was submitted:
- dropped the package.json 2.32.1-preview -> 2.33.0 bump. Versioning is the
  release train's, not a bug fix's.
- added tests/muse-spark-web-search-compat.test.ts. This touches a shared
  adapter and the provider registry; without a test neither the model-scoped
  field removal nor the Responses wire default is protected.
- updated the registry decision log, which still described the map as
  Luna-only after gaining a second entry.

Falsified: removing the sanitizer call reddens the plain-web_search and
nested additional_tools cases and nothing else.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner August 25, 2026 20:40
@lidge-jun
lidge-jun merged commit 1a15d62 into dev Aug 25, 2026
9 of 10 checks passed
@lidge-jun
lidge-jun deleted the codex/2617-muse-spark-web-search branch August 25, 2026 20:40
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 624f10d9-ab93-4e0e-bdea-406543672f36

📥 Commits

Reviewing files that changed from the base of the PR and between e449974 and 3426644.

📒 Files selected for processing (3)
  • src/adapters/openai-responses.ts
  • src/providers/registry.ts
  • tests/muse-spark-web-search-compat.test.ts

📝 Walkthrough

Walkthrough

The change routes muse-spark-1.2-contributor through openai-responses and removes search_content_types from its plain web_search tools. Tests cover nested tools, preview tools, other models, and exact routing.

Changes

Muse Spark Responses compatibility

Layer / File(s) Summary
Exact model routing
src/providers/registry.ts
The OpenCode Go registry routes muse-spark-1.2-contributor and gpt-5.6-luna to openai-responses. Other model routes and explicit modelAdapters precedence remain unchanged.
Web-search request sanitization
src/adapters/openai-responses.ts, tests/muse-spark-web-search-compat.test.ts
The routed request path removes search_content_types from Muse Spark web_search tools at the top level and in additional_tools. web_search_preview, other fields, and other model requests remain unchanged. Tests cover these cases and exact registry routing.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: ingwannu, olddonkey

Sequence Diagram(s)

sequenceDiagram
  participant OpenCodeGo
  participant OpenAIResponses
  participant MuseSpark
  OpenCodeGo->>OpenAIResponses: route muse-spark-1.2-contributor request
  OpenAIResponses->>OpenAIResponses: remove search_content_types from web_search tools
  OpenAIResponses->>MuseSpark: send sanitized Responses request
Loading
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/2617-muse-spark-web-search

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Aug 25, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3426644607

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

if (provider.supportsOpenAiWebSearchToolFields === false) {
outBody = stripOpenAiOnlyWebSearchFields(outBody);
}
outBody = stripMuseSparkUnsupportedWebSearchFields(outBody, parsed.modelId);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Scope the Muse rewrite to the OpenCode Go destination

When an operator routes muse-spark-1.2-contributor through any other noncanonical Responses provider or custom gateway, this call strips search_content_types solely because the model ID matches, silently downgrading the requested TextAndImage search even though only OpenCode Go was observed to reject the field. Pass the provider into the guard and restrict the rewrite to the normalized OpenCode Go destination (or an explicit provider capability); the test should also cover the same model on another provider.

AGENTS.md reference: src/AGENTS.md:L19-L19

Useful? React with 👍 / 👎.

tarunravi pushed a commit to tarunravi/opencodex that referenced this pull request Sep 14, 2026
…rk (lidge-jun#2617) (lidge-jun#2621)

* release: v2.32.1

* release: v2.33.0

* fix(responses): strip search_content_types on web_search for Muse Spark

Muse Spark (muse-spark-1.2-contributor) only serves over the Responses API. Its
gateway rejects search_content_types on a plain web_search tool (400) but
accepts it on web_search_preview and accepts every other web_search field on
both tool types (probed directly 2026-08-26). Only Muse is affected; Luna and
DeepSeek are not.

- Strip search_content_types from web_search for Muse only.
- Route Muse to the same openai-responses default as gpt-5.6-luna.

* fix(responses): strip search_content_types on web_search for Muse Spark (lidge-jun#2617)

Carries DevonGithub's change onto dev with the test it needs, minus an
unrelated version bump.

Three changes to what was submitted:
- dropped the package.json 2.32.1-preview -> 2.33.0 bump. Versioning is the
  release train's, not a bug fix's.
- added tests/muse-spark-web-search-compat.test.ts. This touches a shared
  adapter and the provider registry; without a test neither the model-scoped
  field removal nor the Responses wire default is protected.
- updated the registry decision log, which still described the map as
  Luna-only after gaining a second entry.

Falsified: removing the sanitizer call reddens the plain-web_search and
nested additional_tools cases and nothing else.

---------

Co-authored-by: DevonGithub <DevonGithub@users.noreply.github.com>
agentHits pushed a commit to agentHits/opencodex that referenced this pull request Sep 17, 2026
…rk (lidge-jun#2617) (lidge-jun#2621)

* release: v2.32.1

* release: v2.33.0

* fix(responses): strip search_content_types on web_search for Muse Spark

Muse Spark (muse-spark-1.2-contributor) only serves over the Responses API. Its
gateway rejects search_content_types on a plain web_search tool (400) but
accepts it on web_search_preview and accepts every other web_search field on
both tool types (probed directly 2026-08-26). Only Muse is affected; Luna and
DeepSeek are not.

- Strip search_content_types from web_search for Muse only.
- Route Muse to the same openai-responses default as gpt-5.6-luna.

* fix(responses): strip search_content_types on web_search for Muse Spark (lidge-jun#2617)

Carries DevonGithub's change onto dev with the test it needs, minus an
unrelated version bump.

Three changes to what was submitted:
- dropped the package.json 2.32.1-preview -> 2.33.0 bump. Versioning is the
  release train's, not a bug fix's.
- added tests/muse-spark-web-search-compat.test.ts. This touches a shared
  adapter and the provider registry; without a test neither the model-scoped
  field removal nor the Responses wire default is protected.
- updated the registry decision log, which still described the map as
  Luna-only after gaining a second entry.

Falsified: removing the sanitizer call reddens the plain-web_search and
nested additional_tools cases and nothing else.

---------

Co-authored-by: DevonGithub <DevonGithub@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants