Add LOG_LEVEL env var to control log verbosity (#1142)
wocessade+1: LastNoob
Unverified signature
d1b56bd
## 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…
Remove the native Anthropic provider transport (#1067)
## 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. |
…
## 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 …
Move protocol models to their protocol owners (#1044)
## 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…
Move runtime packages under src namespace (#1029)
## 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…