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
refactor(llm): one tool-schema converter per provider wire format (Anthropic, OpenAI function-tool) with a single-source guard (#16815) - #21816
This PR was opened for an existing branch that never had one (triage status UNFINISHED). The branch carries 1ahead commit(s) of work not on main, linked to #16815 (Consolidate duplicated per-provider LLM message/tool-schema formatting). It still needs a conflict sync with main and a review before it can merge. Acceptance criteria have not been verified against this branch.
Standardised how tool definitions are formatted for supported AI providers. Existing request formats and tool-choice behaviour remain unchanged, so users should see no changes when interacting with these integrations.
Tests
Added checks to confirm provider requests preserve existing tool definitions and behaviour across supported integrations.
Provider request builders now use shared functions to format Anthropic and OpenAI function-tool schemas. Tests check formatted payloads against frozen expectations and scan provider sources for inline schema definitions.
Changes: Provider tool-schema formatting
Layer / File(s)
Summary
Shared converters and provider integration autobot-backend/llm_shared/providers/message_formatting.py, autobot-backend/llm_shared/providers/{anthropic,bedrock,mistral,ollama,openai_compatible}.py, autobot-backend/llm_shared/providers/message_formatting_test.py
Adds shared Anthropic and OpenAI function-tool schema converters. Anthropic, Bedrock, Mistral, Ollama and OpenAI-compatible request builders use the converters. Tests compare formatted output and provider payloads with frozen expectations.
Inline-schema scan and scope registration repo_tests/provider_tool_schema_single_source_16815_test.py, repo_tests/_reach_declared_scopes.py, repo_tests/_reach_policy_verdicts_n_to_z.py, repo_tests/reach_scope_claim_17844_test.py
Adds an AST-based scan for inline tool-schema definitions in provider sources. Registers the scan scope and its reach policy.
Merge Risk: Moderate · previous review 47491
The new provider payload tests cannot be collected because of a wrong import, and the reach scope-claim test fails because the recorded roots differ from the registered ones. Both are small fixes, and no runtime behavior problem was found. Fix them so CI passes before merging.
Pre-merge checks: 4
Check name
Status
Explanation
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
The title names the refactor of tool-schema formatting into one converter per provider wire format (Anthropic and OpenAI function-tool), plus a single-source guard. The changeset matches this: new con…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Title check
Explanation
The title names the refactor of tool-schema formatting into one converter per provider wire format (Anthropic and OpenAI function-tool), plus a single-source guard. The changeset matches this: new converters in message_formatting.py, providers switched to use them, and a repo test that scans for inlined schemas. The title is long and lists two items, but it refers to the primary change and is not misleading.
Finishing Touches
Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Auto-sync: merging main into issue-16815-llm-provider-formatting conflicts
The sync aborted the merge and pushed nothing. Conflicts are information, so it never resolves one itself. Below, for each conflicted file, are the commits that touched it on each side since the merge base 38c62a97b8. Merge main in yourself and push; the label clears on the first run that finds this branch 0 behind.
autobot-backend/llm_shared/providers/anthropic.py
side
commit
subject
issue refs
main
224a92a239
fix(llm): resolve the Claude SSOT review findings and merge main (#20884)
refactor(llm): one provider x tier table for hosted default models; every provider resolves through it with a {PROVIDER}_DEFAULT_MODEL override; OpenRouter and Bedrock off their stale defaults; catalogs use the SSOT names (#15501, #18210)
refactor(llm): one provider x tier table for hosted default models; every provider resolves through it with a {PROVIDER}_DEFAULT_MODEL override; OpenRouter and Bedrock off their stale defaults; catalogs use the SSOT names (#15501, #18210)
refactor(llm): one provider x tier table for hosted default models; every provider resolves through it with a {PROVIDER}_DEFAULT_MODEL override; OpenRouter and Bedrock off their stale defaults; catalogs use the SSOT names (#15501, #18210)
mrveiss
changed the title
refactor(llm): one formatter per provider wire format, Claude-on-Vertex and Bedrock share the Anthropic splitter (#16815)
refactor(llm): one tool-schema converter per provider wire format (Anthropic, OpenAI function-tool) with a single-source guard (#16815)
Nov 18, 2026
Notice: 29 open PRs — past the runaway threshold (25)
This is not a request to defer this PR. There is no cap on open PRs (#19397) -- nothing blocks opening or pushing a PR.
This notice only means the count is high enough to be worth a glance for a runaway — something opening PRs in a loop, or a merge pipeline that has stalled so nothing is draining.
If the queue is draining normally, ignore this. Otherwise:
Check whether CI is dispatching at all — see the ci-dispatch-watchdog status on these PRs
Approved PRs land through the merge train the coordinator sequences (merge commits, never squash) -- check the open chore(merge-train) PR is moving, not each PR on its own
Look for a loop opening near-identical PRs
Warn-only runaway detector — .github/workflows/pr-queue-gate.yml. It never blocks a merge.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
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
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.
Thinking Path
This PR was opened for an existing branch that never had one (triage status UNFINISHED). The branch carries 1ahead commit(s) of work not on main, linked to #16815 (Consolidate duplicated per-provider LLM message/tool-schema formatting). It still needs a conflict sync with main and a review before it can merge. Acceptance criteria have not been verified against this branch.
What Changed
Commits on the branch (not on main):
Diff summary: 11 files changed, 439 insertions(+), 110 deletions(-)
Verification
Not yet verified. No CI evidence: this is a draft; no CI has run on it yet, and it needs a conflict sync with main and a review first.
Model Used
Branch authored by earlier Claude sessions; PR opened by Claude Sonnet 5.5.
Refs #16815
🤖 Generated with Claude Code
Summary by CodeRabbit