Repository navigation
Conversation
Introduce internal/toolcall as the single model of tool declarations, tool choice, argument repair, native call identity and rendering. translate.ValidateChatRequest now delegates tool_choice validation to toolcall.ParseRequest, which keeps an orphan `auto` degrading to unspecified while a `required` or named choice fails instead of being silently dropped. translate's own tool-argument helpers stay in place until the delivery path switches to the new package in a follow-up change.
Adapters now derive their tool payload from the canonical toolcall profile instead of each package reshaping tools on its own, so declared tools, tool_choice and parallel_tool_calls reach the upstream request body unchanged. Adapters also replay a transient failure in place and report the internal retry count upward, keep the upstream Retry-After hint, and fail a stream that ends without a terminal frame instead of relaying it as success.
guyu233
force-pushed
the
pr/provider-tool-profiles
branch
from
December 4, 2026 08:01
891098d to
ee93142
Compare
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 this adds
Providers consume the canonical tool profiles from
internal/toolcallinstead of each adapter keeping its own list, and adapter-level retries are reported upward instead of being hidden.ToolProfilederived from the canonical package, so a model's declared tool capabilities and reasoning levels come from one catalog contract (§toolprofile.go, voiding the per-adapterToolProfileglue).ChatOutcome/ResolvedChat/ provider errors gainInternalRetries, so an attempt retried inside the adapter is visible in terminal accounting instead of looking like one clean dispatch.retry_after.go/retry_count.go: honour upstreamRetry-After, replay strictly transient failures in place with a hard cap, and report the count.Stack
PR 2 of 3, based on #654 (
pr/toolcall-contract-core). This branch already contains that commit, so merging in order needs no rebase. The console PR in this set is independent.Verification
go build ./...go vet ./...go test ./...python3 scripts/release-notes.py validate