Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
DeepSeek (and any OpenAI-compatible endpoint that does not fully implement the Responses API tool loop) rejects the second
/responsesrequest with400 No tool output found for tool call ... (request_id: ...)once the agent sends a tool result back, so every tool-using task fails with aRUN_ERROR.This adds an opt-in
OPENAI_CHAT_COMPLETIONS=trueflag: when set, theopenaiprovider is served by TanStack'sopenaiChatCompletionsadapter (/v1/chat/completions) instead of the Responses-APIopenaiTextadapter. The default keeps using the Responses API, so official OpenAI and existing gateway setups are untouched.apps/server/src/engine/tanstack-agent.ts: chooseopenaiChatCompletionswhenOPENAI_CHAT_COMPLETIONS === "true"..env.example: document the flag.tests/helpers/model.ts: the Responses fixture now pins its wire format against a developer.envflag; adds a Chat Completions wire-format fixture.tests/gateway-chat-completions.test.ts: regression tests for both wire formats.Verification
OPENAI_BASE_URL=https://api.deepseek.com,MODEL=openai/deepseek-chat): a tool-using task previously failed with400 No tool output found for tool call ... (request_id: ...); with the flag set it completes the full tool loop (tool call → result → final reply) over/v1/chat/completions.pnpm exec tsc --noEmit— pass.pnpm --dir apps/mobile typecheck— pass.pnpm build:server— pass.pnpm test— full suite passes (208 tests, 0 failures), including the new gateway regression tests.pnpm lint: on a Windows checkout biome reports repo-wide CRLF line-ending formatting (pre-existing, affects all files). The changed TS files pass biome after line-ending normalization; CI checks out LF (* text=autoin.gitattributes).Integration limits
build:web/build:ios/build:android— the change is server-side only.