Improve API protocol setup for custom providers - #675
Open
johnnygreco wants to merge 5 commits into
Open
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.
Overview
When users add a custom OpenAI-compatible provider, Tau currently gives them no
way to choose between Chat Completions and the Responses API. This PR adds that
choice to both custom-provider setup flows and uses it consistently when sending
requests.
Users can select the API through
tau setupor/login custom. Tau stores theselection alongside the existing provider metadata and uses it regardless of how
the model is named. The routing follows Pi's resolved-model API behavior, where
provider and model metadata determine which transport is used.
User experience
The CLI accepts an
--apioption during setup.The
/login customflow presents the same choice with friendly labels.The selector defaults to Chat Completions and supports keyboard-only navigation,
including accepting the default selection with Enter.
The supported configuration values are
openai-completionsopenai-responsesTau stores the selection alongside the existing provider metadata in
~/.tau/catalog.toml. Individual models can override the provider-level choicethrough model metadata. Provider preferences remain in
providers.json, andsession JSONL remains unchanged.
Protocol resolution
Tau resolves the API in this order
The resolved value directly selects
/chat/completionsor/responses. ModelIDs are passed through as request data and do not affect that decision.
This matches Pi's behavior, where the resolved model API selects the registered
transport. Tau continues to use one OpenAI-compatible provider class with two
internal transports while preserving the same selection behavior.
Compatibility
New providers configured through
tau setupor/login customalways receivean explicit API value. Existing catalog entries without the field continue to
use Chat Completions, preserving compatibility with providers configured before
this option was available.
Configurations that previously depended on names such as
gpt-5orcodextoreach the Responses API should add the following setting.
Tau leaves existing configuration files intact and applies the Chat Completions
compatibility behavior when API metadata is unavailable.
Documentation
The updated documentation covers
A development note records the Pi revision used during implementation and the
architectural mapping behind the change.
Validation
uv run pytestwith 1,861 passing tests and 3 platform-specific skipsuv run ruff check .uv run ruff format --check .uv run mypyCloses #546.