Repository navigation
Forward only standard chat fields and function tools upstream - #23
Merged
Merged
Conversation
The caller's body went to the provider verbatim apart from `model`. On OpenRouter-backed aliases that let a caller pass `models` (fallback list), `provider`, `route`, `plugins` or server tools such as `openrouter:fusion` with paid analysis models, spending paid quota through a free-only alias. The fusion path rejected tools and plugins but still forwarded `models`, `provider` and `route`. Both paths now forward an allow-list of OpenAI chat-completions fields (cerberus/caller_fields.py), and a dispatch request naming a non-function tool is refused with 400 unsupported_tool. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ
Owner
Author
|
The fix is at the source: #24's single commit was amended to use Generated by Claude Code |
5 of 6 tasks
Deep-Sixed
marked this pull request as ready for review
October 5, 2026 12:52
Deep-Sixed
pushed a commit
that referenced
this pull request
Oct 5, 2026
PR #23 refuses a non-function tool on dispatch-path aliases with a 400 before any upstream call, but emitted no routing event, so the refusal never appeared in /admin/events or the telemetry sink. Fusion and jev-router already record their own caller-field refusals. The refusal now emits an invalid_request event (status 400, no attempts) under the caller's identity and the request's revision, and the 400 body carries the event's request_id so the two can be matched. docs/architecture.md now states the dispatch-path caller-field rule: the CALLER_FIELDS allowlist, what is dropped and why, the function-tool refusal, and how fusion and jev-router differ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TVM2AGUsSu6Fyr5s5LSvew
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.
Problem
build_upstream_requestforwarded the caller's body verbatim; onlymodeland the reasoning fields were rewritten. On OpenRouter-backed aliases, a caller on a free-only alias could therefore add:models: OpenRouter's fallback listprovider/routeplugins, e.g. web search{"type": "openrouter:fusion", "parameters": {"analysis_models": [<paid>]}}Any of these can bill models the alias never lists, under Cerberus's credential. The fusion path rejected
tools,tool_choiceandplugins, but still forwardedmodels,providerandroute.Change
cerberus/caller_fields.py:CALLER_FIELDSallow-list of OpenAI chat-completions fields, includingreasoning_effortandchat_template_kwargs, which carry existing caller-precedence semantics.caller_body()applies the allow-list.non_function_tools()reports any tool type other thanfunction.OpenRouterFusionBackend.build_bodyboth go throughcaller_body().toolsortool_choiceis refused with400/reason: unsupported_tool. Fusion keeps its existing rejection.Tests
tests/test_caller_fields.pycovers both paths.🤖 Generated with Claude Code
https://claude.ai/code/session_01Lj4neZ1qzw7tpiCJ8oedxJ
Generated by Claude Code