You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(llm): replay OpenAI Responses hosted tool history as native input items #29159
The native OpenAI Responses adapter rejects replayed assistant history that contains provider-executed hosted tool results.
This affects the native @opencode-ai/llm OpenAI Responses path, not the default TS AI SDK path. The failure happens before any network call:
ProviderShared.request: OpenAI Responses assistant messages only support text, reasoning, and tool-call content for now
Root cause: OpenAI Responses hosted tools such as web_search_call are parsed into common tool-call + tool-result events with providerExecuted: true. The tool runtime can later replay those as assistant message content, but openai-responses.ts only lowers assistant text, reasoning, and tool-call parts.
Based on Codex’s Responses handling, hosted tool history should be replayed as native top-level Responses input items, for example:
Suggested fix: detect matching providerExecutedtool-call + tool-result pairs in lowerMessages, and lower them to native hosted Responses input items (or item_reference when stored state is usable). Malformed or mismatched hosted results should fail with a clear invalid-request error.
bun test test/provider/openai-responses.test.ts -t "replays provider-executed hosted tool results in assistant history"
Actual result:
ProviderShared.request: OpenAI Responses assistant messages only support text, reasoning, and tool-call content for now
Expected result:
The request should prepare successfully and include the hosted tool as a top-level OpenAI Responses input item, not as assistant tool-result content or generic function_call history.
Activity
github-actions commentedon Jul 25, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.