Merge - #99
Open
imranq2 wants to merge 1057 commits into
Open
Conversation
…ce CACHING.md documentation
…iguration for plugin support
…r count in Docker configuration
…marketplace' to 'plugins'
…egration and enhance .gitignore for cache management
…tings and increase Gunicorn worker count
…n options and enhance comments for better understanding
…n-ai-skills-framework and cyclopts
….0.60 and 1.2.0 respectively
Co-authored-by: aikido-pr-checks[bot] <169896070+aikido-pr-checks[bot]@users.noreply.github.com>
support plugin marketplaces
…onment variables for marketplace integration
…n and bedrock_transport field scope
BAI-315 Document Bedrock transport options
…hinking toggle on native transport
BAI-316 Add MODEL_ROUTING_QWEN_ENABLE_THINKING env var
…ey're recorded instead of surfacing as unhandled 500s
BAI-317 Make native Bedrock connect/read timeouts explicit env vars
…nippet Opening marker used <<< instead of >>>, matching docs/coding_model_router.md convention.
BAI-318 Move model_routing_guide.md from language-model-gateway-configuration
…gn docs router.py's and coding_model_router.md's docstrings claimed this router is deployed per-user/local, which justified an otherwise-spoofable custom-header user_id fallback. That assumption no longer holds (shared multi-tenant deployment) -- flagged as a known gap rather than silently left stale. Also fixes a pre-existing bug in pre-commit-hook (line 12 executed $GIT_PROJECT_ROOT as a command instead of cd-ing into it, breaking every commit in this repo since the initial commit) and adds the design spec and implementation plan for a session-savings statusline endpoint, to be implemented task-by-task on this branch.
…ons/{session_id}/savings
format_savings_line() now wraps all field-access and formatting in try-except, returning None silently on any TypeError, ValueError, AttributeError, or KeyError. This ensures the statusline command never prints a raw error string or traceback that would break Claude Code's UI, regardless of whether the gateway returns wrong field types (total_savings_usd as string, tier cost_usd as non-numeric, tiers as non-dict, etc.). Add 3 test cases covering the previously-crashing malformed-type inputs.
Adds a Prerequisites/Setup/Troubleshooting walkthrough (absolute path, chmod +x, manual test before wiring into settings.json, restart requirement) and ties MODEL_ROUTING_GATEWAY_URL to the same gateway_url local var as ANTHROPIC_BASE_URL in the claude-router() shell function, so the two env vars can't drift apart when swapping between local and production.
Corrects the collection-name default (usage_sessions -> model-router-sessions) in SessionSavingsReader/SessionSavingsRouter and their docstrings, plus stale usage_sessions and curl references in the session-savings-statusline design doc and plan doc. No runtime behavior change: api.py already passes the correct env-var-driven collection name to both reader and writer.
…g a repo clone Moves claude_code_statusline.py into language_model_gateway/static/, which is already copied into the runtime Docker image and mounted at /static by create_app() -- so it's now downloadable via $MODEL_ROUTING_GATEWAY_URL/static/claude_code_statusline.py with no new route, no Dockerfile change, and no new auth surface. Updates the test's file path accordingly and rewrites the docs/model_routing_guide.md setup walkthrough to curl the script instead of cloning this repo.
Adds a shell function alongside claude-router() in the ~/.zshrc snippet that downloads the statusline script from the gateway, chmods it, and prints the exact settings.json snippet (with resolved absolute path) to add -- automating the manual curl/chmod/realpath steps in the Statusline setup walkthrough. The manual steps stay documented as the explicit alternative for anyone who wants to see what the function does.
…and remove spoofable usage-attribution fallback Guards claude_code_statusline.py's main() against valid-but-non-dict stdin payloads, corrects misleading second-terminal-tab troubleshooting advice in model_routing_guide.md, and removes the unverified X-Model-Routing-User-Id custom-header fallback in router.py._get_auth_info since it let any caller attribute usage/cost to another user's identity on this shared multi-tenant router. Usage attribution now requires a verified OIDC token; the session-savings endpoint's session_id-as-capability design is confirmed necessary (Claude Code never exposes its OAuth credential to subprocesses) and its exception is now tracked in BAI-320.
The parenthetical after "saved" showed each tier's actual cost with no label, reading as if it broke down the savings total instead of being a separate cost figure. Prefixes it with "costs:" and shows the serving provider per tier (Anthropic/AWS), sourced from a new backend field now persisted in the session rollup alongside the existing per-tier model name.
…rsation Group-dropping under context pressure only ever protected the last message when it was literally role=="user" — a conversation resumed right after a tool call (Read, Bash, AskUserQuestion, etc.) ends in a "tool" message instead, so nothing stopped every remaining group from being dropped down to just the system message. Every backend this router talks to (Bedrock Converse, Bedrock Mantle/Qwen chat templates) rejects a conversation that doesn't start with a user turn, producing the "ValidationException: A conversation must start with a user message" error. Group-dropping now stops at the last group that starts with role=="user" and can never cut past it, even if still over budget afterward.
BAI-319 add session-savings statusline for model routing
_apply_output_budget_cap floored max_tokens at 1024 unconditionally, even when the undroppable message tail (protected by BAI-321's last- user-group rule) left less than 1024 tokens of headroom -- guaranteeing input+output exceeded backend_max_context_tokens and got rejected by Bedrock/Mantle with "maximum context length" ValidationException. Clamp the floor to actual headroom instead of blindly forcing 1024.
The output-cap log line always printed the margin-based formula parenthetical, even when the new hard_headroom clamp produced a different safe value, misleading debugging of a recurrence.
BAI-322 clamp output-token floor to hard context headroom
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.
No description provided.