Repository navigation
Conversation
Reasoning models such as gpt-6.1-sol reject function tools with reasoning_effort on /v1/chat/completions and need /v1/responses. A custom endpoint could only be openai-completions or anthropic-messages, so these models returned 400 on every tool turn. Expose openai-responses as a first-class flavor: - add it to the LocalProviderApi union and coerceLocal, so the saved value survives a settings rewrite - generate a models.json block that keeps /v1 and an empty compat - probe /v1/responses during auto-detect; a dual-route endpoint returns an ambiguous result so the user picks a flavor instead of silently routing to completions - surface the flavor in the models settings tab - allow the flavor through the providers:testLocal IPC guard - relay /v1/responses on a paired computer Tests drive updateLocalProvider and syncModelsConfig, then spawn a real pi in RPC mode against a recording mock and assert it POSTs to /v1/responses with tools, never /v1/chat/completions. Regression guards cover the IPC allowlist and the paired-computer relay path.
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
Expose
openai-responsesas a first-class custom-endpoint API flavor, so reasoning models route through/v1/responsesinstead of/v1/chat/completions.Why
Reasoning models such as gpt-6.1-sol reject function tools combined with
reasoning_efforton/v1/chat/completions:A custom endpoint could only be
openai-completionsoranthropic-messages, so every tool turn on such a model returned 400.Changes
LocalProviderApiunion andcoerceLocalacceptopenai-responses, so the saved value survives a settings rewrite.syncModelsConfigwrites amodels.jsonblock that keeps/v1and an emptycompat./v1/responses. A dual-route endpoint returns an ambiguous result and asks the user to pick a flavor, rather than silently routing to completions.providers:testLocalIPC guard accepts the flavor (otherwise the Test button fails before the probe)./v1/responses(otherwise discovery passes but every turn 502s).Tests
tests/unit/responses-integration.test.ts: drivesupdateLocalProviderthensyncModelsConfig, spawns a real pi in RPC mode against a recording mock, and asserts pi POSTs to/v1/responseswith a non-emptytoolsarray and a Bearer token, never/v1/chat/completions. Flipping the generated flavor to completions makes the test time out, which confirms it is a real regression guard.tests/unit/ipc-guard.test.ts: the guard accepts all three flavors as argument 4, still rejects a bogus flavor.tests/unit/llm-relay.test.ts: the relay allows/v1/responses.tests/unit/models-config.test.ts: auto-detect picks responses when only/v1/responsesanswers; a dual-route endpoint returnsambiguous; the generated block keeps/v1with emptycompat.Typecheck, lint, and the four affected suites pass (65 tests).
Verification status
Verified live against the HAI gateway. A built app was seeded with a Responses custom endpoint for gpt-6.1-sol. The seed used the exact failing
reasoning: trueoverride. One real turn through the desktop UI returned a reply. The same combo 400s on/v1/chat/completions, so the reply proves the turn routed through/v1/responses. The committed integration test also verifies the route against a recording mock and a real pi RPC child.Not yet verified: a Responses endpoint on a paired computer (the relay fix has a unit guard only), and onboarding (out of scope, below).
Out of scope
Onboarding has no flavor control and persists no flavor, so it cannot set up a Responses endpoint yet. That needs a UI control plus persistence and is left as a separate change. The settings tab is the supported path.