Commit History
-
feat: track local-path usage and enrich analytics dashboard
shinmentakezo07- Record server-tool and local-optimization requests in the usage ledger - Relay cache read/creation tokens into Responses usage details - Add cache/reasoning KPIs, request-log pagination, heatmap metric toggle, latency tooltips, and a sticky sidebar in the Admin UI - Rebuild admin static assets for the updated dashboard - Add usage-tracking and cache-token relay tests - Bump version to 4.28.0c860470 -
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 empty reasoning state across native tool turns (#1339)
Unverified signature## Problem Claude tool-only assistant turns omitted `reasoning_content` when a provider used native reasoning replay. DeepSeek V4 requires that field to remain present—even as an empty string—so OpenCode Zen and Go continuations could fail despite valid Claude history. Fixes #1336 Fixes #1338 ## Changes | Before | After | | --- | --- | | Native tool turns without thinking omitted `reasoning_content`. | Native `reasoning_content` tool turns send `""` when no replayable reasoning exists. | | OpenCode coverage injected an internal empty field before conversion. | Zen and Go coverage starts from real tool-only Anthropic history and asserts the final SDK wire JSON. | | DeepSeek owned a private wire-capture helper. | Provider tests share one OpenAI Chat wire-capture helper. | | The behavior was only simulated. | The exact tool-only continuation passed against the real DeepSeek V4 Flash endpoint. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> Thi…81a9761
-
Restore Claude Code client controls for OpenAI Responses (#1311)
Unverified signature## Problem Claude Code sends effort and keep-all context controls that the connected OpenAI provider rejected before upstream I/O. The Responses converter revalidated application-owned effort and could not distinguish inert context edits from active unsupported behavior. Fixes #1310. ## Changes | Before | After | | --- | --- | | Every non-empty `output_config` failed OpenAI Responses preflight. | Application-consumed `output_config.effort` reaches one policy-derived OpenAI `reasoning` object. | | Every non-empty `context_management` failed OpenAI Responses preflight. | Empty edits and exact keep-all thinking edits are omitted as semantic no-ops. | | Structured output, active edits, and unknown controls shared coarse top-level diagnostics. | Unrepresentable controls still fail before I/O with precise nested output paths. | | The current Claude request shape had no end-to-end regression contract. | Core, real-provider, and `/v1/messages` tests lock conversion, immutability, wire paylo…1b6cc04 -
Keep tool names portable across OpenAI transports (#1309)
Unverified signature## Problem OpenAI-compatible upstreams receive Claude tool names unchanged, so names outside the portable OpenAI function grammar can be rejected before inference. Fixes #1307. ## Changes | Before | After | | --- | --- | | Long or non-portable tool names were forwarded verbatim to Chat Completions and upstream Responses APIs. | A shared deterministic codec emits portable aliases while leaving valid names unchanged. | | Upstream aliases could leak into tool validation, recovery, or client-visible SSE. | Structured, heuristic, recovered, and Responses tool calls restore the exact client name before downstream meaning. | | NIM function-name compatibility would require a provider-specific workaround. | The protocol boundary handles every OpenAI transport and composes with NIM's separate argument aliases. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This change makes tool names portable across OpenAI-compatible Chat and Responses transports by …522b31e
-
Add ChatGPT OAuth as an OpenAI Codex provider (#1279)
Unverified signature## Problem FCC supports API-key and local providers, but customers cannot use models included with their ChatGPT subscription. Reusing Codex credentials would also couple FCC to another application's mutable authentication state. ## Changes | Before | After | | --- | --- | | OpenAI subscription access was unavailable. | Customers connect ChatGPT from the local Admin UI with browser PKCE or device code. | | Provider availability came only from static settings. | A process-owned connected account adds, refreshes, and evicts OpenAI models dynamically. | | FCC had no ChatGPT Codex transport. | `openai/<model-id>` uses FCC-owned renewable credentials and neutral Responses conversion. | | Retries and reasoning continuity had no subscription-provider coverage. | Commit-boundary retries prevent duplicate output while encrypted reasoning and tool IDs survive round trips. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This PR adds ChatGPT OAuth and a…9fb95ba
-
Close interrupted tool turns before new user input (#1271)
Unverified signature## Problem The remaining interrupted-session failure in #1269 replayed completed tool output directly before a new user prompt. Strict OpenAI-compatible chat templates reject this `tool → user` sequence. ## Changes | Before | After | | --- | --- | | Shared conversion emitted a user turn immediately after completed tool output. | Shared conversion inserts one neutral whitespace-only assistant boundary before subsequent user input. | | Terminal tool results and already-completed assistant turns had no explicit regression distinction. | Boundaries are added only for `tool → user`; terminal tools and existing assistant completions remain unchanged. | | OpenRouter reasoning replay treated every converted assistant message as source history. | OpenRouter skips the structural boundary when restoring encrypted reasoning details. | | The interrupted resume shape had no permanent live product scenario. | An opt-in provider smoke exercises the exact resume transcript. | <!-- greptile_comment …5a80185
-
Recover MiniMax-M3 native tool calls on NVIDIA NIM (#1246)
Unverified signature## Problem NVIDIA NIM can emit MiniMax-M3's native tool envelope in streamed content instead of OpenAI `tool_calls`. FCC forwarded that markup as assistant text, so Claude displayed control tokens and terminated the request without executing the tool. Fixes #1243 ## Changes | Before | After | | --- | --- | | NIM streamed MiniMax-M3 native tool markup as visible assistant text. | NIM recognizes the exact native signature on tool-bearing requests and converts complete blocks into OpenAI tool-call deltas. | | Native argument markup was untyped and unvalidated. | Recursive objects, arrays, scalars, aliases, and parallel calls are decoded and validated against the accepted request schemas. | | Malformed or incomplete native blocks escaped as successful HTTP 200 content. | Invalid native blocks stay behind the stream boundary and trigger bounded protocol retry or recovery. | | Midstream continuation removed tools and could only recover text. | Tool-protocol continuation retains the origi…a60e7bf
-
Recover Claude sessions from provider context overflow (#1215)
Unverified signature## Problem NVIDIA NIM can report context exhaustion as a 400 `BadRequestError` saying its derived `max_tokens` is negative. FCC treated that as a generic invalid request, so Claude Code could not recognize the smaller upstream context window, compact the conversation, and replay the interrupted turn. LM Studio also encoded Claude's recovery phrase inside provider code instead of reporting a protocol-neutral failure. Fixes #1198. ## Changes - Add one protocol-neutral `context_window_exceeded` execution failure with a non-retryable 400 contract. - Narrowly classify only NVIDIA NIM's negative derived-`max_tokens` signature while preserving the complete redacted provider diagnostic and request ID. - Let the Anthropic serializer alone add Claude's `prompt is too long` compaction trigger; OpenAI Responses keeps a standard invalid-request envelope. - Migrate LM Studio's existing context preflight to the same neutral semantic and document the ownership boundary. - Add provider, protocol, API,…838ef01 -
Coordinate provider recovery under concurrent load (#1205)
Unverified signature## Problem Concurrent transient failures could start independent retry, replay, continuation, and repair loops while holding provider concurrency slots. This multiplied upstream attempts and could delay or strand terminal errors under fan-out. ## Changes | Before | After | | --- | --- | | Retry paths owned separate attempt budgets. | One logical-execution session caps all upstream work at five attempts. | | Concurrent failures backed off independently. | One provider-owned recovery episode elects a single half-open probe while followers coalesce. | | Backoff occupied stream concurrency. | Concurrency is held only while an upstream operation or stream is active. | | Provider catalog calls and stream creation used separate admission paths. | Every upstream operation uses one provider-generation admission controller. | | Cancellation could leave recovery ownership or follower state unresolved. | Cancellation releases permits, transfers probe ownership, and unregisters waiting followers…3a9bf35
-
Report output-limit truncation as incomplete Responses (#1180)
Unverified signature## Problem Responses streams discarded the canonical Anthropic `max_tokens` stop reason and emitted `response.completed`. Codex therefore treated truncated provider output as a successful end and could stop midway without explaining why. Fixes #1178. ## Changes | Before | After | | --- | --- | | The Responses boundary discarded `message_delta.stop_reason`. | The Responses assembler retains the canonical terminal stop reason. | | Output-limit streams ended with `response.completed`. | Output-limit streams end with `response.incomplete` and `incomplete_details.reason=max_output_tokens`. | | Truncated output had no dedicated Responses contract coverage. | Core and API tests cover partial-output and zero-visible-output truncation while preserving response ID and usage. | | The package version was `4.8.6`. | The patch release is `4.8.7`. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This PR reports Anthropic output-limit termination as an incom…3608de3
-
Honor reasoning tiers on numeric-budget providers (#1150)
Unverified signature## Problem FCC preserved named reasoning effort but numeric-budget providers received no intensity unless a client supplied an exact token budget. NIM and llama.cpp therefore treated Low through Max like the same provider default. ## Changes | Before | After | | --- | --- | | Named effort had no FCC-owned numeric meaning. | FCC maps Low, Medium, High, X-High, and Max to 512, 1,024, 2,048, 4,096, and 8,192 tokens. | | NIM received only thinking booleans for named effort. | [NIM](https://docs.nvidia.com/nim/large-language-models/1.15.0/thinking-budget-control.html) receives thinking booleans plus the mapped `reasoning_budget`, retaining its existing retry without rejected budget control. | | llama.cpp forwarded only exact client budgets. | [llama.cpp](https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md) receives the mapped `thinking_budget_tokens` value. | | Named, boolean, and provider-default adapters shared no explicit numeric contract. | Named adapters keep wo…4faabdf -
Keep inline system reminders cache-stable across providers (#1154)
Unverified signature## Problem Inline Anthropic system reminders were forwarded as mid-conversation OpenAI system roles. Compatible provider chat templates could reposition those roles, changing prior prompt tokens and causing periodic full cache misses. Fixes #1152. ## Changes | Before | After | | --- | --- | | Top-level and inline system content both used downstream system roles. | Only top-level system content uses the leading downstream system role. | | Inline system reminders could trigger provider-side prompt retemplating. | Inline system reminders keep their text and position as downstream user messages. | | Provider policies could reinterpret the shared role mapping. | Shared conversion owns one provider-independent role mapping. | | Cache-prefix coverage allowed mid-conversation system roles. | Cache-prefix coverage requires append-only user-encoded reminders. | | The package version was 4.8.0. | The package version is 4.8.1. | <!-- greptile_comment --> <details open><summary><h3>Greptile Su…fe9d430 -
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
-
Add LOG_LEVEL env var to control log verbosity (#1142)
wocessade +1: LastNoobUnverified signature## Problem The server always writes DEBUG logs, producing detailed request traces customers rarely need and allowing rotated files to accumulate without a retention cap. Supervised restarts also need to apply changed logging settings consistently. Closes #1141. ## Changes | Before | After | | --- | --- | | The file sink always starts at `DEBUG`. | `LOG_LEVEL` supports `DEBUG`, `INFO`, `WARNING`, `ERROR`, and `CRITICAL`, with a customer-friendly `INFO` default. | | Structured request traces are emitted at `INFO`. | Structured request traces are emitted at `DEBUG` and remain available for opt-in diagnostics. | | Logs rotate at 50 MB without a retention limit. | Logs retain five rotated files, bounding normal usage to roughly 300 MB including the active file. | | Supervised restarts can keep stale sink and third-party logger levels. | Supervised restarts replace the sink or third-party levels only when their effective settings change. | | The package version is `4.7.2`. | The package v…d1b56bd
-
Preserve mid-conversation system messages through provider conversion (#1125)
Unverified signature## Problem FCC hoisted inline Anthropic `system` messages into the top-level system prompt during request validation. Mid-conversation system messages are position-sensitive, so this applied later instructions retroactively, changed the existing prompt/cache prefix, and prevented provider conversion from seeing the original transcript. ## Changes - Preserve inline `system` messages, content, metadata, and ordering in Messages and token-count requests while keeping the top-level system prompt distinct. - Convert text-only inline system messages to OpenAI Chat `system` messages at the same transcript position; reject unrepresentable inline blocks before streaming instead of silently dropping them. - Remove the lossy normalization path and its unused role enum, and document protocol-model versus target-conversion ownership in `ARCHITECTURE.md`. - Cover API routing, model serialization, cache-prefix stability, text blocks, tool-result ordering, invalid content, and token counting; bump …b12d65f
-
Add Ollama Cloud as a first-class provider (#1106)
Unverified signature## Problem FCC supports Ollama only through a local daemon, so users cannot authenticate directly to Ollama Cloud or discover its hosted models from the Admin UI. Ollama's OpenAI-compatible API also uses the standard `reasoning` field instead of `reasoning_content`, which would otherwise drop thinking output and tool-history reasoning. ## Changes | Before | After | | --- | --- | | `ollama/...` requires a local Ollama server. | `ollama_cloud/...` connects directly to `https://ollama.com/v1` with `OLLAMA_API_KEY`, while local Ollama remains unchanged. | | OpenAI-chat reasoning was hard-coded to `reasoning_content`. | Provider profiles declare their reasoning field, so Ollama streams and replays `reasoning` without a specialized transport. | | Ollama Cloud was absent from configuration, model discovery, docs, and smoke coverage. | The catalog, Admin UI, proxy setting, model picker, README, smoke matrix, and `4.5.0` release metadata expose the provider consistently. | <!-- greptile_com…a8c6fae
-
Fix Auto Mode classifier responses when stream is omitted (#1098)
Unverified signature## Problem Claude Code Auto Mode classifier requests omit `stream`, which means they expect a non-streaming Messages response. FCC treated omission as streaming, returned SSE, and caused Claude to report the classifier model as temporarily unavailable. Fixes #1094. ## Changes | Before | After | | --- | --- | | Omitted `stream` defaulted to streaming SSE. | Omitted `stream` defaults to a complete JSON Message; only `stream: true` selects SSE. | | Classifier side queries received a body without top-level `usage`. | Classifier side queries receive a JSON Message with top-level `usage` while thinking remains disabled. | | Tests encoded FCC's nonstandard streaming default. | Model and HTTP-boundary tests enforce Anthropic's response-mode contract. | | The package version was 4.3.0. | The package version is 4.3.1. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This PR fixes Messages response mode handling when clients omit `stream`. The main chan…f9017b8 -
feat: add vision support for OpenAI chat conversion (#1061)
Fethi AmariUnverified signature## Problem FCC rejects Anthropic user image blocks before vision-capable OpenAI-compatible providers can receive them. This blocks pasted images in Claude Code and IDE clients. Fixes #512. ## Changes | Before | After | | --- | --- | | User image blocks fail during Anthropic-to-OpenAI conversion. | Base64 and URL image sources become OpenAI `image_url` parts. | | Mixed text and image input cannot reach an upstream model. | Mixed content preserves exact block order and text-only behavior. | | Invalid image sources require ambiguous downstream handling. | Missing or unsupported source fields fail explicitly before execution. | | Vision support could require flags or proxy-side downloads. | Conversion stays provider-neutral and performs no network I/O. | | The package remains on `4.1.0`. | The package advances to `4.2.0` with a regenerated lockfile. | | Converter coverage rejects every user image. | Tests cover source mapping, ordering, tool boundaries, validation, and request construct…41faac6
-
Consolidate OpenAI-compatible provider adapters (#1069)
Unverified signature## Problem Sixteen OpenAI-compatible providers were represented by configuration-only subclasses and one factory function each. The sole provider family also lived under a multi-transport namespace that no longer described the codebase, while provider defaults, IDs, and instance caching passed through redundant forwarding layers. ## Changes | Before | After | | --- | --- | | Sixteen provider IDs used configuration-only subclasses. | Immutable OpenAI-chat profiles configure one concrete provider while preserving each provider's request policy. | | Every provider required a dedicated factory function. | Generic profile construction is the default; only eight adapters with real state or algorithms retain factories. | | The sole provider family lived under `providers/transports/`. | `providers/openai_chat/` directly owns shared request, stream, recovery, tool, and usage behavior. | | Provider defaults and IDs passed through forwarding modules, and constructors repeated fallback resoluti…1ad5b9a -
Remove the native Anthropic provider transport (#1067)
Unverified signature## Problem Ollama and llama.cpp still used a parallel native Anthropic transport after the other providers moved to OpenAI Chat. That kept duplicate request, SSE, recovery, model-list, and server-tool policy machinery alive. ## Changes | Before | After | | --- | --- | | Ollama and llama.cpp streamed through provider-specific Anthropic `/messages` adapters. | Ollama and llama.cpp use the shared OpenAI Chat transport. | | Native request serialization, SSE normalization, error mapping, and recovery remained beside the OpenAI path. | Native-only machinery is removed and all providers share one transport lifecycle. | | Routed models carried a capability object solely to permit native server-tool passthrough. | Routing carries only route decisions; FCC handles forced server tools locally and rejects lossy passthrough. | | Ollama discovery used a separate `/api/tags` parser and rejected `/v1` configuration. | Ollama discovery uses `/v1/models` and accepts either root or `/v1` base URLs. | …9a1b3fc
-
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 -
Make provider backoff admission monotonic (#1053)
Unverified signature## Problem Concurrent provider requests could miss or shorten a reactive backoff while waiting for proactive admission. Separate gate commits could also waste quota or release requests as an expiry burst. ## Changes | Before | After | | --- | --- | | Reactive deadlines were checked once and replaced by later backoffs. | Reactive deadlines are rechecked until clear and only extended by later backoffs. | | Proactive capacity was recorded before the final reactive decision. | Conditional commit records proactive capacity only while the reactive deadline is clear. | | The limiter exposed an ambiguous `set_blocked` callback. | Both transport families use the explicit `extend_reactive_block` operation. | | Cross-gate races and wait cancellation lacked deterministic coverage. | Deterministic tests cover conditional commit, extensions, non-shortening, and cancellation. | | The architecture left gate interaction implicit. | The architecture defines monotonic two-gate admission without wasted…ef8766f -
Use installed metadata as the single package version source (#1051)
Unverified signature## Problem FCC runtime surfaces reported stale, unrelated versions, and users could not inspect the installed FCC version without starting the server or scaffolding configuration. ## Changes | Before | After | | --- | --- | | FastAPI/OpenAPI and the web-tools user agent duplicated stale release literals. | Every FCC runtime surface reads installed distribution metadata through one `core.version` owner. | | FCC-owned commands had no side-effect-free version query. | `fcc-server`, `free-claude-code`, and `fcc-init` print the installed version whenever `--version` is present, before any configuration or process work. | | Wrapped Claude and Codex argument handling was adjacent to FCC command behavior. | Claude and Codex launchers remain transparent and pass `--version` to their wrapped clients unchanged. | | A source-only checkout had no explicit fallback contract. | Missing distribution metadata reports `0+unknown`, while malformed installed metadata still fails visibly. | | Version be…4ab63bd -
Canonicalize provider failure and retry ownership (#1046)
Unverified signature## Problem Provider SDK classification, retry policy, canonical failures, and downstream wire errors shared exception types across layers. That blurred ownership and let cleanup or provisional Responses tool failures mask the real provider diagnostic. ## Changes | Before | After | | --- | --- | | Provider failures carried Anthropic wire types and core code classified OpenAI/httpx errors. | Protocol-neutral `ExecutionFailure` values cross layers, providers classify SDK errors, and protocol packages map wire types. | | Provider adapters could author terminal wire events. | The HTTP commit boundary selects non-2xx JSON or a protocol terminal event with one ingress request ID. | | Retry policy and diagnostic handling were spread across core and provider modules. | Providers own the unchanged retry budgets while neutral core utilities own bounded credential redaction. | | Stream cleanup could replace an already-mapped provider failure. | Cleanup records safe metadata and preserves the ca…db883b3 -
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 -
Move protocol models to their protocol owners (#1044)
Unverified signature## Problem Anthropic Messages and OpenAI Responses wire models lived under the inbound API adapter. Neutral protocol and provider code therefore duck-typed requests, obscuring ownership and weakening dependency boundaries. ## Changes | Before | After | | --- | --- | | The API package owned Anthropic and Responses protocol models. | Each protocol package owns and publicly exports its wire models. | | Core and provider request paths accepted `Any` and probed known fields with `getattr()`. | Core, transports, and providers consume concrete `MessagesRequest` values. | | Responses conversion and streaming received a dumped request mapping. | Responses conversion and streaming receive one concrete `OpenAIResponsesRequest`. | | Anthropic request snapshots lived in generic tracing code. | Anthropic request snapshots live with the protocol while generic tracing stays protocol-independent. | | Protocol tests and provider request doubles reflected the old API ownership. | Protocol tests live u…7b3c6de
-
Establish single-owner runtime with stream-safe provider hot swaps (#1036)
Unverified signature## Problem Provider runtime ownership was split between lifecycle code and mutable FastAPI state, so Admin replacements could leak the new runtime, double-close the old runtime, or close providers still serving active streams. The API package also owned concrete process composition, obscuring subsystem boundaries. ## Changes | Before | After | | --- | --- | | FastAPI routes inspected several concrete `app.state` resources. | FastAPI receives one explicit `ApiServices` boundary and stores only `app.state.services`. | | Admin Apply persisted config and directly replaced one runtime reference. | Admin Apply validates a candidate, commits atomically, and publishes it through the single runtime owner. | | Provider replacement could close clients used by active streams. | Generation leases retain old providers until each streaming or non-streaming response finishes. | | Provider generations owned discovery state and model metadata. | `ProviderRuntimeManager` owns one application-lifetime …0602b26 -
Restore protocol-correct provider errors without client retry loops (#1033)
Unverified signature## Problem Provider failures before streaming were converted to HTTP 200 SSE errors, masking typed upstream statuses as malformed proxy responses. This regressed #1026's error visibility while solving client retry loops; fixes #1031. ## Changes | Before | After | | --- | --- | | Pre-start Messages failures returned HTTP 200 SSE errors. | Pre-start Messages failures return typed non-2xx JSON with `x-should-retry: false`. | | Non-streaming Messages could preserve partial content after an internal stream error. | Non-streaming Messages discard partial content and return the mapped Anthropic error. | | Post-start failures could synthesize a successful stop lifecycle. | Post-start failures emit protocol-native terminal errors without a fake success stop. | | Responses failures lacked consistent retry ownership and correlation. | Responses failures retain typed envelopes, retry suppression, response IDs, and request IDs. | | Request IDs were generated independently across layers. | One in…fcd6f91
-
Move runtime packages under src namespace (#1029)
Unverified signature## Problem Runtime modules were published as generic top-level packages like `api`, `cli`, and `providers`. That shape is fragile for PyPI packaging and weakens explicit ownership boundaries. ## Changes | Before | After | | --- | --- | | Runtime code lived in root-level packages. | Runtime code lives under `src/free_claude_code/`. | | Console scripts targeted top-level modules. | Console scripts target namespaced modules. | | Tests and smoke helpers imported old package roots. | Tests and smoke helpers import `free_claude_code.*`. | | Packaging listed six root packages. | Packaging builds the single namespaced package. | | Contracts allowed old root package directories. | Contracts require the src namespace and reject old root imports. | <!-- greptile_comment --> <details open><summary><h3>Greptile Summary</h3></summary> This PR moves the runtime packages into the `src/free_claude_code` namespace. The main changes are: - Console scripts now point to `free_claude_code.*` entrypoi…0d0f0f9