fix(app): open listen streams end cleanly when the server stops, with serving.graceful_timeout (#54)
On HTTP, run() wraps uvicorn.Server.handle_exit while it serves and puts
the listen-ender first in the middleware: when a stop signal lands, each
open subscriptions/listen stream gets a disconnect and a complete response,
so uvicorn no longer cancels it at FastMCP's 2 s and logs an ERROR and a
traceback per listen. Every other request keeps serving.graceful_timeout
(15 s, GRACEFUL_TIMEOUT, --graceful-timeout) to finish, passed as
uvicorn_config['timeout_graceful_shutdown'], which run() now refuses from
the caller. APP-7, APP-8, APP-10, the new APP-15, CMP-4 and config.md say
so. A loopback subprocess test holds it on 3.11 and 3.14.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
docs: CFG-11 and CFG-18, APP-2/3, CMP-2, FAC-11, the config page and the changelog
The spec now says a config loads once, in QuickMCP or before it in
load_config(), and CFG-18 sets out the loader: what LoadedConfig holds,
that QuickMCP(loaded=...) reads nothing again, what it refuses beside
loaded=, and that one load builds one server. The config page shows a
server reading its config before building itself, and the changelog
gets its line.
From the whole-branch review: tests for the lifespan running inside the
components, for QuickMCP's None defaults, and for a register that raises
leaving the load claimed; the register loop's comment back above it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
docs: CMP-2 to 6 and TEL-20 built; the app, config, telemetry, delivery and facade rows; README and changelog
The spec rows say what was built, the components page gains the built-ins'
tables and a component example, and [Unreleased] gains the Added lines and
the BREAKING ones. The whole-branch review's fixes come with them: run()
refuses serving keys in its options, LOG_LEVEL is read case-insensitively,
the telemetry line never shows userinfo however the address is written, a
clash with a built-in's name suggests hooking it, and the runtime masking
and cancellation paths are tested.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
fix(config): mask a leaf that holds a secret-bearing model in the boot line, and mark a bare AliasPath secret where pydantic writes it
A leaf such as list[Cred] was logged through the model's own serializer,
which may reveal the secret: such a leaf is now sensitive and shows as ***
(CFG-13). The schema mark used the loc key, which gives a bare one-step
AliasPath its step; pydantic writes that property under the field name, so
the secret lost its mark and kept its default (CFG-15). _schema_key now
follows pydantic's rule and _key keeps its own, as _alias_key.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
docs: CFG-7 to 10 and 12 to 14, the config page's operator and author sections, APP-2/3, FAC-11, the README and the changelog
The config rows lose (proposed) and say what the code does: literal env and
flag names refused at composition when malformed, duplicated, reserved or
unreadable; sensitive means a secret type; one YAML file, env vars and flags
merged deep over the defaults; provenance and the boot line; every load error
at once, with no value quoted by quick-mcp or pydantic. The config page gains
"Setting the config" for an operator and "Writing a server's config" for an
author. The README passes argv=sys.argv[1:], and [Unreleased] says what a
server writes now.
The whole-branch review's fixes: an error path matches every key a field
accepts, so a secret behind AliasChoices or by-name validation prints no key
below it, and env=/arg= on a field with a non-str alias is refused; a
default_factory model is merged over like a default instance; every YAML
failure and a self-referencing mapping are "is not valid YAML"; tokens after
-- are positionals; the boot line is built only when INFO is on. The plan's
design items 5 and 7 and its Global Constraints record the rules settled.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
docs: the config rows, APP-2/3/8, DI-12, FAC-11, the README and the changelog
The config core's rows lose (proposed) and read as built: sections by key,
one composed strict config, loaded at construction, injected by section, and
one schema written without FastMCP. APP-2/3/8, DI-12 and FAC-11 follow, and
the changelog gets the Added and BREAKING lines.
The whole-branch review's fixes come with it: a sensitive field is kept out
of the repr, today's call shapes are tested through QuickMCP(...),
sections=None and a nested RootModel get errors that say what to do, the
schema warning that printed a default is suppressed, and pydantic's floor
is 2.12, as FastMCP already requires.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Agent: done
spec: config (CFG-1 to CFG-17) and components (CMP-1 to CMP-6), proposed, with the design
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>