Skip to content

feat: docs deep-scan: read the whole of gateway (src + bins + README + - #20

Merged
andrei-hasna merged 3 commits into
mainfrom
factory/c361f87f-626a-4430-9b56-2ab81b28-d4328922
Jul 29, 2026
Merged

feat: docs deep-scan: read the whole of gateway (src + bins + README +#20
andrei-hasna merged 3 commits into
mainfrom
factory/c361f87f-626a-4430-9b56-2ab81b28-d4328922

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

  • policy source: base dce573d (immutable commit — agent-proof)
  • ⚠️ GATE-INTEGRITY: agent touched verify-bearing config — REVIEW (src/cli/index.ts)
  • containment: env — allowlist env, non-login shell, run-scoped HOME (registry auth seeded for install)
  • install: pass
  • typecheck: pass
  • build: pass
  • test: pass
  • doctor (ci): ok — 11 checks passed (1 advisory)

Run run_dfaf22bfaddb · backend codewith · task c361f87f-626a-4430-9b56-2ab81b282853
🏭 Generated by @hasnaxyz/factory


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

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
andrei-hasna merged commit add5710 into main Jul 29, 2026
2 checks passed
@andrei-hasna
andrei-hasna deleted the factory/c361f87f-626a-4430-9b56-2ab81b28-d4328922 branch July 29, 2026 15:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant