Commit History
-
feat: add usage tracking with live throughput rates and analytics dashboard
shinmentakezo07 +1: ClaudeTrack per-request token usage (input/output/cache/reasoning) plus full prompts (capped at 64 KB) in a JSON ring buffer at ~/.fcc/usage.json, captured through a transparent UsageTrackingStream over the executor stream. Expose GET /admin/api/usage and a new Usage page in the admin UI with KPI cards, token mix, volume area chart, top endpoints, routing sankey, and hourly heatmap, auto-refreshing every 10 seconds. Throughput rates use a trailing 60-second live window on both backend and frontend so they track real-time traffic and decay to zero when idle; tokens/second counts output tokens only, tokens/minute counts input plus output. Bump 4.25.0 -> 4.27.0. Co-Authored-By: Claude <noreply@anthropic.com>e8f2acc
-
Preserve gateway model identity in Anthropic responses (#1270)
Unverified signature## Problem FCC replaced the stable gateway model selected by Claude Code with the provider-facing model when serializing Anthropic responses. Claude then persisted an ID absent from FCC's `/v1/models` catalog, so later sessions warned that the model could not be restored and fell back. This partially addresses #1269. ## Changes | Before | After | | --- | --- | | Provider streams, local optimizations, and local server-tool responses exposed the routed upstream model. | Every Anthropic response path receives and emits the original gateway model while upstream requests retain the provider model. | | Traces labeled the routed upstream ID as the gateway model. | Routing, execution, provider, and token-count traces preserve both identities accurately. | | No contract guarded model identity across routing and response serialization. | Tests cover executor handoff, upstream request bodies, Anthropic `message_start`, local optimizations, and server tools; the patch version is `4.12.10`. | <…82e8d6e
-
Make reasoning policy provider-neutral and client-aware (#1148)
Unverified signature## Problem FCC reduced reasoning to global and route booleans, mixing client intent, configuration, provider wire capabilities, output visibility, and history replay. That discarded named client efforts, encouraged model-name checks, and made provider behavior inconsistent. ## Changes | Before | After | | --- | --- | | Admin exposed global and route thinking toggles. | Admin exposes **Off**, **From client**, **Low**, **Medium**, **High**, **X-High**, and **Max**; Fable, Opus, Sonnet, and Haiku also expose **Inherit**. | | Request intent was repeatedly reduced to a boolean across routing and providers. | The application boundary resolves one immutable `ReasoningPolicy` with independent control, named effort, and exact positive token budget. | | Provider adapters could infer reasoning behavior from upstream model names or versions. | Provider profiles translate only documented provider-wide wire capabilities; architecture and contributor rules prohibit model-specific reasoning branche…dc04eee
-
Make response stream lifetimes explicit (#1060)
Unverified signature## Problem Client disconnects and response-start send failures could abandon a prefetched provider stream and its generation lease. Re-yielding iterators and response-proxy middleware left no owner that closed the complete body chain before runtime release. ## Changes | Before | After | | --- | --- | | Starlette body iteration indirectly owned stream cleanup and lease release. | One FCC streaming response surrounds the real ASGI send, closes the body transitively, then releases the lease exactly once. | | The prefetched first-frame generator could not close its tail before replay began. | An explicit closeable replay iterator owns the prefetched tail in every commit state. | | Tracing, execution, Responses conversion, and native transport transforms re-yielded inputs without closing them. | Every retained transform closes its direct input; redundant transport wrappers are removed while provider construction failures remain deferred. | | Function-style correlation middleware proxied …4aecccf -
Introduce a typed application boundary for provider execution (#1045)
Unverified signature## Problem The HTTP adapter owned model routing, provider execution, and runtime-facing contracts, so API handlers depended on provider implementation types. Provider preflight also discovered private request builders dynamically, obscuring the boundary that must fail before streaming begins. ## Changes | Before | After | | --- | --- | | `api/` owned model routing and shared provider execution. | `application/` owns routing and a settings-independent `ProviderExecutor`. | | API handlers accepted `BaseProvider` callbacks. | API handlers consume the narrow structural `ProviderPort`. | | `BaseProvider` discovered `_build_request_body` dynamically. | Both transport families implement explicit abstract preflight, with LM Studio composing context validation. | | Request leases, task control, and provider model metadata had adapter/provider owners. | Application-owned ports and immutable values define those cross-package contracts. | | Boundary direction was implicit. | Architecture contra…d29db6e