Repository navigation
Releases
v26.11.26
chore: Release v26.11.26 (#285)
- Roll Unreleased into v26.11.26: auth.* identity values stay inside a plain
SQL literal (GHSA-r36p-v9m5-4f8q), OIDC accepts valid tokens again (#273),
and the task guides (#272) - Stamp the plugin, every SKILL.md and the reference docs' version header
v26.11.25
chore: Release v26.11.25 (#267)
- Roll Unreleased into v26.11.25
- Stamp the Claude Code plugin version
- Note that duckdb_extensions() is refused in templates under restricted
v26.11.23
fix: Serialise Crow's Server::stop() so SIGTERM cannot run it on two threads (#250)
- The stop poll in APIServer::run called app.stop() without stop_mutex_, racing APIServer::stop()
- try_lock in the poll; startup-window guarantee unchanged
- Shutdown tests assert the acceptor is closed exactly once
- Closes #249
v26.11.21
chore: Release v26.11.21 (#240)
- Roll Unreleased into v26.11.21
- Stamp the Claude Code plugin version
v26.10.31
Merge pull request #210 from DataZooDE/claude/gracious-brahmagupta-552ilv
chore: Prepare release v26.10.31
v26.10.2 — safer configuration: env variables are enforced, dead keys are reported, and the docs match the code
Upgrade notes — four changes can stop an existing config from starting
server:block is an error. flAPI never read it. Usehttp-port/http-host,--port/--host, orFLAPI_PORT/FLAPI_HOST.template.environment-whitelistis now enforced for YAML files. An unlisted{{env.NAME}}stops startup and names the variable. An empty or missing whitelist allows none. A top-levelenvironment-whitelist:is an error; it belongs undertemplate:.- Included files are covered too.
{{env.NAME}}inside an{{include}}d file is now substituted and checked. Anauth.usersentry with an empty username or password stops startup. - Spaced references are substituted.
{{ env.NAME }}in YAML now works instead of staying literal.${NAME}is still not supported.
Added
- Unknown top-level keys in
flapi.yamlnow log a warning, with hints for near-misses such asrate-limitvsrate_limitandhttpsvsenforce-https. flapi packvalidates the config first and writes no bundle if it is invalid (--skip-validationopts out).
Fixed
--validate-configaccepts MCP prompt files, and every shipped example now validates.- The config dump shown when a config fails to load no longer prints passwords from the environment.
GET /api/v1/_config/environment-variableslists the variables that match whitelist patterns.flapi_create_endpointnow saves the endpoint, acceptstemplate-sourceandconnection, and the endpoint serves and survives a restart.flapi_delete_endpointremoves the endpoint's YAML file.flapii project initgenerates a config flAPI actually reads.- Three
mcp.*settings that did nothing now warn that they are ignored. - Docs and examples no longer show
${VAR}or a top-levelhttps:block, neither of which flAPI reads.
Docker
:latest now points to the latest release.
v26.09.26 — a failed start exits cleanly, and a clean stop releases the cache
A reliability release: flAPI now reports a failed start honestly instead of crashing or claiming success, and a clean shutdown really does release its cache.
Behaviour changes to know before upgrading
- A server that fails to start now exits
1. A port already in use used to log the error and then exit0, so systemd would not restart it and a Kubernetes container showedCompleted. Anything that treats exit0as "started" will see the difference — that is the point. heartbeat.paramsnow takes effect. They were documented but never passed to the template. If you set them, your heartbeats start using them.
Fixed: a startup failure now exits non-zero instead of dumping core, or lying
Two startup failures were reported wrongly, and both matter to whatever supervises flAPI.
A database that cannot be opened — most often the DuckLake or DuckDB cache file still locked by
the previous process during a restart — used to abort: exit 134 (SIGABRT) with a core dump
of the ~77 MB binary. A crash-looping container filled its disk with core dumps of a recoverable,
operator-fixable condition. It now logs the reason and exits 1:
[error] Database initialization error: Error creating database, Details: Failed to attach
DuckLake catalog: ... Could not set lock on file ".../cache.ducklake":
Conflicting lock is held in .../flapi (PID 3534350) by user jr.
[error] flAPI cannot start until the database can be opened.
Other shapes that land here: an unreadable duckdb.db_path, a cache file on a volume that has
not mounted yet, bad attach credentials.
A bind failure now exits 1 as well, where it used to exit 0. the server could not start: bind: Address already in use was logged and the process then reported success, so systemd would
not restart it and a Kubernetes container went Completed rather than CrashLoopBackOff — the
reason visible only to whoever read the logs.
Genuinely unexpected exceptions still abort, which is what the handler is for.
Fixed: a clean shutdown now releases DuckLake and flushes the database
On SIGTERM, flAPI is meant to detach the DuckLake catalog and checkpoint the database before
exiting, so the next process can take the cache lock straight away and starts from a flushed file.
That work used to run in a place where it could not be relied on: it never appeared in a real
shutdown log, and on a failed startup the same code crashed. It now runs while flAPI is still
fully alive — after in-flight requests have drained — and says so:
[info] Received SIGTERM, shutting down...
[info] Detached DuckLake catalog: cache
[info] Checkpointed database
Long-running MCP tasks still executing at SIGTERM do not delay this: they are interrupted,
and the process exits promptly.
Fixed: heartbeat.params now reaches the template
An endpoint's heartbeat: block has always accepted params, and the configuration reference
documented them, but they were never passed on — every heartbeat ran the template with no
parameters. They now arrive exactly like request parameters:
heartbeat:
enabled: true
params:
status: active # the warm-up renders {{params.status}} as "active"If you set heartbeat.params, your heartbeats will start using them. A heartbeat still runs
the endpoint's full request path — template, validators and query — whether or not the endpoint
is cached.
v26.09.23 — a slow query no longer blocks everything else, and auth.* works over MCP
Two things you can feel immediately: a slow query no longer blocks every other
request on the same instance, and auth.* finally works in MCP templates. The
rest of this release is data-loss and disclosure fixes in the cache and the MCP
surface — several of them silent, which is why they are worth reading.
Upgrade notes first
flapiiand the VSCode extension must be updated together with the server.
The config service's endpoint slug encoding changed; an older CLI will404
on every config command.- MCP endpoints whose templates filter on
auth.*will return different
results. That is the fix — they were returning too much or too little. - Every
flapi_*MCP config tool now requires the config-service token.
SendAuthorization: Bearer <token>. {{cache.previousSnapshotTimestamp}}is now the cursor column's own type,
not a timestamp, and is absent when no watermark can be read.
Added: a slow query no longer blocks other requests
Crow runs a request handler on the io thread that owns its connection, so one slow query held
that thread for the whole query and every other connection assigned to it waited — including
GET /health/live, which is how a stalled instance is supposed to report itself.
Measured on one ~6.5s query with 40 concurrent probes and a single io thread:
| probes blocked | stall reported | worst probe | |
|---|---|---|---|
| before | 40 / 40 | 0 / 40 | 5.04s |
| after | 0 / 40 | 40 / 40 | 0.005s |
Handlers now run on a bounded worker pool and the response is completed back on the connection's
own thread. The queue is bounded on purpose: when it is full the request is answered 503 rather
than queued behind work the client stopped waiting for. Set FLAPI_DISABLE_HANDLER_OFFLOAD=1 to
go back to the old behaviour.
SIGTERM is now handled properly alongside it: in-flight requests are drained before the process
exits, and queued-but-not-started work is abandoned after a bounded budget so a backlog cannot
hold a container open. A query that is already executing is still waited for — flAPI does not
cancel it — so a genuinely hung backend can still delay shutdown until your platform's grace
period expires. Bounding that needs query cancellation and is not in this release.
Fixed: auth.* was empty in every MCP template
The documented multi-tenant pattern
{{#auth.username}}WHERE tenant = '{{ auth.username }}'{{/auth.username}}worked over REST and rendered nothing over MCP, because the MCP path never injected the
authenticated caller's identity. In that conditional form the filter disappeared entirely and an
authenticated caller received every tenant's rows; written unconditionally it compared against
'' and returned none. Both were silent.
auth.username, auth.roles, auth.type, auth.email and auth.authenticated now render the
same on REST, MCP tools/call and MCP resources/read. A caller still cannot declare its own
identity — __auth_* sent as an argument is discarded on every surface.
If you have an MCP endpoint whose template filters on auth.*, its results will change. That
is the point: it was returning too much or too little before.
Fixed: cache retention destroyed other endpoints' history
Every cached endpoint shares one DuckLake catalog, but keep-last-snapshots and
max-snapshot-age are configured per endpoint — and the expiry ran catalog-wide. One endpoint
reaching its retention limit expired every other endpoint's snapshots, discarding their
time-travel history and resetting their incremental watermark. flapii cache gc did the same, and
against a hardcoded one-day cutoff that ignored your configuration entirely.
Retention now only expires snapshots belonging to its own cache table, and never one that another
table shares — so an endpoint may keep more history than you asked for, and will say so in the
log, rather than deleting a neighbour's data. It also always keeps the newest snapshot, which is
where the incremental watermark is read from, and applies keep-last-snapshots across the table's
whole history rather than across the already-expired subset when both keys are set.
Retention is disabled, with a warning, for a cache table whose name is ambiguous — two schemas
holding the same table name — because DuckLake's catalog exposes no schema name to tell them
apart and expiring the wrong one would delete another endpoint's data.
Fixed: incremental refresh dropped rows written while it ran
{{cache.previousSnapshotTimestamp}} was the instant the previous refresh committed. That
refresh read your source earlier than that, so any row written in between was never read by it —
and was then excluded by the next refresh too. On a continuously written source, every refresh
permanently dropped the rows written during its own execution, and reported success.
With a cursor: configured, the watermark is now max(<cursor column>) over the rows actually
cached. Rows above it are exactly the rows not yet loaded.
Two consequences worth knowing:
- The value is the cursor's own type, not a timestamp.
WHERE updated_at > TIMESTAMP '{{...}}'
stays right for a timestamp cursor; an integer or string cursor needs quoting to match. {{cache.snapshotTimestamp}}is a different value (still the commit time) and must not be
used as a watermark.
Fixed: credentials came back from MCP dry runs and errors
A _dryRun tool call returns the rendered SQL, and MCP is unauthenticated by default. Connection
passwords, whitelisted environment variables ({{{ env.API_KEY }}}) and credential-valued request
defaults were all returned verbatim — and so were the ones a database error quoted back, which is
a path no _dryRun flag is needed to reach.
All three sources are redacted now, in previews and in error messages, on every surface that
returns one: REST responses, MCP tools/call and MCP resources/read all scrub the same set.
(REST was leaking the same way, through the same mechanism, for any endpoint without an auth:
block.) Where a value is too short to replace without corrupting the surrounding SQL, the preview
is withheld and says so rather than being silently mangled.
Fixed: MCP config tools that reported success without doing anything
Eleven flapi_* config tools returned confident results for work they never performed:
| Tool | What it returned |
|---|---|
flapi_expand_template |
a hardcoded SELECT * FROM data WHERE 1=1 |
flapi_test_template |
"Template test passed", for a query it never ran |
flapi_update_template |
success, with the file on disk untouched |
flapi_refresh_cache |
"Cache refresh has been scheduled" — nothing was scheduled |
flapi_run_cache_gc |
"Garbage collection triggered" |
flapi_refresh_schema |
"schema_refreshed" |
flapi_get_cache_audit |
invented audit records |
flapi_get_cache_status |
three fields of static YAML, while promising snapshot history |
flapi_get_environment |
an empty list, always |
flapi_get_filesystem |
an empty tree |
flapi_get_schema |
"tables": null |
Every one of them had a working REST handler that the adapter was constructing and then
discarding. They now call it, so the MCP and REST surfaces cannot disagree — an agent asking
whether a cache refreshed gets the real answer, and one asking to expand a template gets that
endpoint's own SQL.
flapi_get_project_config also reported version 1.0.0 for every build; it now returns the real
project configuration.
Every flapi_* tool now requires the config-service token, matching the REST route it
delegates to. Twelve of them were classified "read-only discovery" and left unauthenticated, which
was harmless only while their bodies returned hardcoded data — once they were wired to the real
handlers, three of them became unauthenticated disclosures: flapi_get_environment returns
environment values, flapi_expand_template returns rendered SQL, and flapi_test_template
executes any endpoint's template. If you call these tools, send
Authorization: Bearer <config-service-token>; with no config service configured they now decline,
which is correct.
flapi_test_template also runs the endpoint's own validators before executing, so it is no longer
a way around the constraints the endpoint itself enforces. flapi_run_cache_gc requires path —
its "all endpoints" form never worked — and every tool now declares its arguments in tools/list,
so an agent can discover them instead of guessing and getting an error.
Fixed: smaller disclosures on the same theme
GET /api/v1/_config/healthis the one config-service route without a token, and it
published every storage backend's path and its raw error text. A path can carry an inline
credential or a signature. Unauthenticated callers now get status, scheme and latency; the
detail needs the token.- A connection property literally named
pw,key,passorsasis now recognised as a
credential. Recognition is whole-key, sopassenger_count,sort_keyandkeywordare still
ordinary columns and are not redacted out of your SQL. - flAPI warns at startup (
CREDENTIAL_TOO_SHORT_TO_REDACT) when a configured credential is
under four characters. Such a value cannot be scrubbed without corrupting the SQL around it, so
error detail and dry-run previews are withheld for every endpoint using that connection — with
nothing in the response to say why. Now you are told once, at startup, and can lengthen it. - The incremental cursor watermark is validated against its declared type before the next
refresh interpolates it into SQL. A cached value that does not look like itscursor.typemakes
the refresh fall back to a full load and log why, rather than being pasted into a query. - Cache retention fails closed: if the catalog cannot be read, nothing is expired. It
previously proceeded on a partial answer.
Fixe...
v26.09.20 — SQLite attachments no longer wedge, and readiness notices a stalled request
Fixed: a concurrent read and write wedged a SQLite attachment
A GET issued at the same moment as a POST against a DuckDB SQLite attachment deadlocked the
two against each other. Two requests were enough, and it reproduced every time. The
attachment could then stop answering for good while the process, DuckDB, /health/live and every
other connection stayed perfectly healthy — so the instance kept accepting traffic it could no
longer serve, with nothing in the logs to say why.
Serialising only the writes does not help: the pair that wedges is a reader and a writer. flAPI
now runs one query at a time on any connection whose init contains an
ATTACH ... (TYPE sqlite). Nothing else is affected — parquet, BigQuery, Postgres and DuckLake
traffic still runs fully in parallel, because the lock is per connection and only taken for
connections that need it.
Measured: 19 of 20 concurrent read+write pairs failed before, 20 of 20 pass now.
The cost is real — concurrent requests to a SQLite-backed endpoint queue rather than overlap — so
you can override the detection in either direction:
connections:
my-backend:
serialize-access: true # an unrecognised backend with the same problem
read-only-snapshot:
serialize-access: false # a SQLite attachment you have measured and want parallelAdded: readiness fails while a request is stalled
stall-timeout-s: 60 # 0 disablesGET /health returns 503 {"status":"stalled"} once the oldest in-flight request outlives the
budget, with requests.in_flight and requests.oldest_ms in the body. This measures the symptom
rather than probing each backend — a probe against a wedged connection blocks too, leaking a
thread per health check — so it catches any stall, whatever caused it.
The default is deliberately high: flAPI's answer to a genuinely long query is the MCP Tasks
extension, so a synchronous request still running after a minute is pathological rather than
slow. Liveness deliberately still passes — the process is fine, and killing it rather than
draining it turns a stall into an outage.
Known limitation
A handler runs on the Crow io thread that owns its connection, so a slow synchronous query blocks
other connections landing on that thread — GET /health included. Readiness can therefore be
blocked by the very stall it reports: with one ~5 s query in flight, 39 of 40 health requests
answered 503 stalled in under a millisecond and one waited out the query. A hung probe is still
treated as a failed probe by Kubernetes and Cloud Run, so the instance does leave rotation — but
by timeout rather than by the documented response. Tracked in
#120.
Install
pip install flapi-io==26.9.20or grab a binary below. Full notes: CHANGELOG.md
v26.09.19
docs: changelog for v26.09.19
Leads with the tracing.endpoint correction, because that is the one that cost
users something: every published example used a base URL, which posts to '/'
and is rejected silently.
Co-Authored-By: Claude Opus 5 [email protected]