feat: docs deep-scan: read the whole of gateway (src + bins + README + - #20
Merged
andrei-hasna merged 3 commits intoJul 29, 2026
Merged
Conversation
docs deep-scan: read the whole of gateway (src + bins + README + docs/) and update all docs to match current behavior — README accuracy, CLI help parity, missing docs pages; PR-first, conventional commits [loop-infinity-300pr] X-Factory-Run: run_dfaf22bfaddb X-Factory-Task: c361f87f-626a-4430-9b56-2ab81b282853
A response-cache hit returns from createChatCompletion immediately after assertBudgetPreflight, so it never reaches normalizeUsage, rateLimit.onUsage, evaluateBudgetPostflight, or the usage ledger append. The README said budget and rate-limit accounting still runs on cache hits, which would lead an operator to believe cached traffic is metered and capped under a hard budget. It is neither. State what actually happens: the budget preflight check and the per-gateway-key request rate limit still run, but a cache hit writes no ledger record and consumes neither budget nor token rate limit quota. Add a regression test pinning that behaviour so the doc claim stays verifiable: four identical requests under an enabled cache, a JSONL ledger, and a hard lifetime maxTotalTokens budget produce one provider call, one ledger line, one onUsage event, and unchanged remaining budget.
The embeddings section of the API contract claimed that providers without an embeddings adapter are skipped. Route filtering only checks the model's `embeddings` capability (src/router.ts routeRejectionReason), never the adapter, so such a candidate is selected and then throws a non-retryable 400 provider_embeddings_unsupported that aborts the request instead of continuing to the next fallback candidate. Document the real behavior and the ordering requirement it implies, including dynamic passthrough ids. The configuration reference stated that `baseUrlEnv` overrides `baseUrl`; providerBaseUrl() returns `provider.baseUrl` first and only falls back to the env var, so an operator following the old text would silently keep sending traffic to the original base URL. Add characterization tests pinning both behaviors so the docs cannot drift again.
andrei-hasna
deleted the
factory/c361f87f-626a-4430-9b56-2ab81b28-d4328922
branch
July 29, 2026 15:38
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.
Objective
docs deep-scan: read the whole of gateway (src + bins + README + docs/) and update all docs to match current behavior — README accuracy, CLI help parity, missing docs pages; PR-first, conventional commits [loop-infinity-300pr]
Verification
Run
run_dfaf22bfaddb· backendcodewith· taskc361f87f-626a-4430-9b56-2ab81b282853🏭 Generated by @hasnaxyz/factory
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.