Skip to content

Managed OpenAI Inference + Native Web Search#26251

Merged
noanflaherty merged 9 commits into
mainfrom
noanflaherty/managed-openai-native-web-search
Apr 17, 2026
Merged

Managed OpenAI Inference + Native Web Search#26251
noanflaherty merged 9 commits into
mainfrom
noanflaherty/managed-openai-native-web-search

Conversation

@noanflaherty
Copy link
Copy Markdown
Contributor

@noanflaherty noanflaherty commented Apr 17, 2026

Summary

Enable OpenAI as a first-class managed inference provider and route inference-provider-native web search through OpenAI's native Responses web search tool. Remove Anthropic-only assumptions in macOS settings so users can choose OpenAI in managed mode.

Self-review result

PASS after 3 rounds of review+remediation (4 fix PRs addressing integration gaps)

PRs merged into feature branch

Fix PRs

Part of plan: managed-openai-native-web-search.md


Open with Devin

noanflaherty and others added 8 commits April 17, 2026 17:04
…26218)

* [macOS] Allow managed inference provider selection beyond Anthropic

* fix: capture draftProvider before async Task to prevent race condition

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…der supports it (#26230)

* [macOS] Allow provider-native web search when managed inference provider supports it

* fix: gate mode-specific web search invalidation on modeChanging to prevent false-positive alerts

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* fix: generalize alert message to cover both mode and provider changes

* fix: scope provider-native invalidation to your-own web search mode

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@noanflaherty noanflaherty self-assigned this Apr 17, 2026
devin-ai-integration[bot]

This comment was marked as resolved.

chatgpt-codex-connector[bot]

This comment was marked as resolved.

@noanflaherty
Copy link
Copy Markdown
Contributor Author

Review (Worktree + Targeted Validation)

Pulled this PR into a dedicated worktree and reviewed all touched files end-to-end (backend + macOS settings + tests).

Findings

1) [P1] Persisting unpaired server_tool_use from OpenAI native search can inject synthetic failures after provider switch

  • In assistant/src/providers/openai/responses-provider.ts (content assembly around lines 301-312), we now persist server_tool_use blocks for OpenAI web search calls.
  • Those blocks are persisted without a paired web_search_tool_result.
  • Anthropic’s request repair path explicitly treats this as orphaned tool state and injects synthetic web_search_tool_result_error entries (assistant/src/providers/anthropic/client.ts around lines 346-399).

Why this matters:
A conversation that used OpenAI native web search can be silently rewritten to include synthetic “search unavailable” failures when the user later switches provider to Anthropic in the same thread.

Suggested fix:

  • Either avoid persisting OpenAI server_tool_use blocks in history (keep event-stream + raw diagnostics only),
  • Or persist a paired result block so cross-provider handoff does not synthesize failure artifacts.

2) [P2] server_tool_complete is always emitted as success for OpenAI web search

  • In assistant/src/providers/openai/responses-provider.ts (lines ~285-291), server_tool_complete is emitted with isError: false for every tracked web-search call on response.completed.
  • This happens regardless of response/call status.

Why this matters:
Tool telemetry/UI can report successful completion even when the search call is interrupted/failed/incomplete.

Suggested fix:

  • Derive completion state from web-search call status (stream status events or final response output item status),
  • Emit isError: true when status is non-success,
  • Add a regression test for non-completed web search status.

If helpful, I can also add a concrete regression test scenario for the OpenAI->Anthropic provider-switch path described in Finding #1.

…ry corruption

The OpenAI Responses provider emitted server_tool_use content blocks for
web_search_call items but did not emit matching web_search_tool_result blocks.
repairHistory() treats any unpaired server_tool_use as an interrupted search
and injects a synthetic web_search_tool_result_error, which corrupts
conversation history by making successful searches appear as failures.

After each server_tool_use block, also emit a paired web_search_tool_result
with empty content (since OpenAI weaves search results into the text output).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@noanflaherty noanflaherty merged commit f4a3ca9 into main Apr 17, 2026
12 checks passed
@noanflaherty noanflaherty deleted the noanflaherty/managed-openai-native-web-search branch April 17, 2026 23:13
Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

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

Devin Review found 1 new potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment on lines +31 to +32
managed: true,
proxyPath: "/v1/runtime-proxy/openai",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🚩 OpenAI managed proxy requires companion platform-side route support

The new proxy path /v1/runtime-proxy/openai at assistant/src/providers/managed-proxy/constants.ts:32 requires the companion vellum-assistant-platform repo to have a corresponding proxy route that forwards OpenAI Responses API requests. The AGENTS.md mentions checking the sibling repo for compatibility when making HTTP API or container changes. The OpenAI SDK will construct URLs like {baseURL}/responses for the Responses API stream endpoint, so the platform proxy needs to handle this path correctly.

Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

siddseethepalli added a commit that referenced this pull request Apr 18, 2026
… llm.default API

The tests were added in #26251 against the old `setInferenceProvider` /
`services.inference.provider` API. #26159 merged afterward renamed that
API to `setLLMDefaultProvider` and moved the config path to
`llm.default.provider`, leaving the tests unable to compile.

Rename the calls and update the patch assertions to match the new shape.
siddseethepalli added a commit that referenced this pull request Apr 18, 2026
… llm.default API (#26287)

The tests were added in #26251 against the old `setInferenceProvider` /
`services.inference.provider` API. #26159 merged afterward renamed that
API to `setLLMDefaultProvider` and moved the config path to
`llm.default.provider`, leaving the tests unable to compile.

Rename the calls and update the patch assertions to match the new shape.
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.

1 participant