All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning (pre-1.0, so minor versions may include breaking changes).
async-bulkhead-llm@3.18.0 to async-bulkhead-llm@3.19.1. This also brings
in 3.18.1, a documentation release, 3.18.2 and 3.19.0. 3.19.1 changes no
code: it removes files from the published tarball that were not part of the
library's build. The tarball in vendor/ is the artifact npm published.
The library fixes below reach Tyr with it.
protectedConcurrent floor when capacity covers them. Before, a
request inside its own class's floor was counted for a moment as a
borrower of shared capacity, and a request decided in that moment could
get 429 concurrency_limit. Token floors were not affected, and no
request was admitted past a limit.Pool.drain and Pools.drain resolve when the last queued request behind
a zero maxConcurrent times out or is aborted. Before, such a drain
stayed pending although nothing was running or waiting.limits from the revision that
admitted the request. The library now reports an admission one microtask
after it decides it, so a limits update can be applied in between. Tyr read
the limits in force when the report arrived; on 3.18.2 and later that would
have counted such a request under captureFailures and recorded no event
for it.
Tyr keeps the limits of each pool's 64 most recent revisions for this.tyr_admission_queue_wait_seconds ends when the slot is granted. The
reservation made in that step and the resumption of the request after it now
count toward tyr_admission_decision_seconds. For a request that does not
queue, that moves one microtask hop from the first histogram to the second.500, a borrowed-slot
deadline, observe mode, runtime limit updates and a bounded drain.
Everything they returned and reported matched, apart from ids, timestamps,
timings, the retry hint and the version.protectedConcurrent floor that capacity
covers is admitted in full.x-admission-revision, its audit
event and its provenance event. On 3.18.0 it was decided after the update
and carried the newer revision.bulkhead.totalAdmitted and bulkhead.totalReleased in /stats do not
count it.maxConcurrent resolves as described above. Tyr's
own shutdown closes its pools before it drains them, which rejects every
queued request, so it was not affected.ghcr.io/janbalangue/tyr-admission-controller, for linux/amd64 and
linux/arm64. The image is tagged with its exact version only; no latest
tag is published. It carries an SBOM and build provenance. 0.36.0 is the
first published version.guides/ hold the reference material that was in the
README. A documentation site built with TypeDoc carries the guides and an
API reference for the modules an embedder uses. npm run docs builds it,
and a Docs workflow publishes it to GitHub Pages from master.engines requires >=22, CI runs Node.js 22 and 24, and the
container image runs on Node.js 24.janbalangue/tyr-admission-controller, where the
repository lives, instead of mofluxhq/tyr-admission-controller.Logger in latchflo.ts, PoolState in retry-hint.ts and
AdvisoryStats in pools.ts. The compiled JavaScript of those three
modules is unchanged. The only test change is the version string one
assertion expects. Configuration, the schema, routes, /stats, /metrics
and audit events are as in 0.35.0.BUILDPLATFORM.README.md#configuration-schema, no longer lands on that section. The
sections are now in guides/.npm pack tarball includes guides/.async-bulkhead-llm@3.18.0.
Nothing is stopped unless it is configured.
pools[].stop.overrunAllowanceTokens stops a request whose token hold
grows more than the allowance above its reservation. While it is set, a
usage report that leaves the pool above its token budget, or a class above
maxInFlightTokens, also stops requests until the rest fit. It requires
inFlightTokenBudget.pools[].stop.takeBackGraceMs stops the requests a limits update left
above the new limits, once the grace period has ended. A request that
finishes inside it is left alone, and a newer update restarts it.shutdown.stopOnDrainTimeout stops the requests still running when
shutdown.drainTimeoutMs elapses, before Tyr closes the remaining
connections. It requires drainTimeoutMs and applies to every pool.503 with
error.type: "admission_stopped", error.cause,
x-admission-reason: stopped and x-admission-stop-cause. Once part of
a reply has been written, the reply is cut. Neither gets a retry hint.createGateway takes the same settings: stop on a pool, and
shutdownStopOnDrainTimeout./stats: limits.stop, and tyr.stop with the configured policy,
stopped and stoppedByCause./metrics: tyr_pool_stopped_total{pool,cause},
tyr_pool_admission_class_stopped_total,
tyr_pool_stop_overrun_allowance_tokens and
tyr_pool_stop_take_back_grace_seconds.settlement: "stopped" and a stopCause.stopped in the shutdown() result and in the drain-deadline log line,
when stopOnDrainTimeout is on.npm run verify:stop, part of release:check. It checks that nothing
changes without a stop policy, then an overrun, a provider's closing usage,
a take-back, a stream stopped before its first byte, the token hold after a
stop, and a SIGTERM shutdown of the built server that stops a request,
answers 503 and exits with code 0.504 idle_timeout, 504 borrowed_admission_deadline or
502 upstream_error. Before, Tyr closed the connection without a status
line, because it treated the reply as started as soon as the provider
answered. Tyr now writes a streamed reply's status line with its first
chunk, which is when it reached the client before as well. A stream that
has delivered a chunk is still cut.progressiveReconciliation.outputSafetyMarginTokens no longer holds more
tokens than it reserved. Before, its first usage report raised its hold to
the whole margin, 256 tokens by default. The difference was counted in
tyr_pool_tokens_overrun_total and could lift tyr_pool_tokens_in_flight
above the budget. The margin is now capped at the request's output
reservation.stop block and without shutdown.stopOnDrainTimeout, no request
is stopped, /stats and /metrics have no stop fields or series, and the
shutdown result has no stopped.
upstream_failure diagnostic for it has
afterHeaders: false. A streamed request with an output reservation
below the safety margin holds fewer tokens while it runs, so the pool's
overrun, refunded and early-released token counters differ for it.stop block:
max(limitsRevision, 1),
because revision 0 cannot carry a stop policy. A pool with
limitsRevision 0 or omitted starts at revision 1, reports it in
x-admission-revision and /stats, and needs revision 2 or higher for
its first runtime update. A pool that starts closed, as a Latchflo-managed
pool does, keeps its configured revision.stop field on a runtime limits update is still ignored. Every update
gets the pool's configured policy. Pool.controller.applyLimits no longer
hands a stop field to the library either.stop block is refused with admissionMode: observe, and an empty
stop block is refused.takeBackGraceMs also stops the requests still
running after a grant has expired. The policy is local configuration:
Latchflo does not send it, and nothing new is sent to Latchflo.overrunAllowanceTokens, a provider's closing usage is no longer
a mid-stream report on that pool. It is absent from
tyr.progressiveReconciliation, and an overrun that only the closing
usage shows is not added to tyr_pool_tokens_overrun_total. The
consumed-token counters include it.429 budget_limit instead of
waiting.tyr_requests_total and tyr_upstream_duration_seconds gain the
outcome value stopped. tyr_pool_work_in_flight and
tyr.restoration.upstreamCapacity.activeAccountingHolds include stopped
requests whose upstream call has not settled.limits.stop.config/tyr.schema.json describes the new settings and states their three
cross-field rules: stopOnDrainTimeout: true needs drainTimeoutMs, an
overrun allowance needs inFlightTokenBudget, and a stop block needs
admissionMode: enforce.TyrRequestOutcome and TyrAuditSettlement gain "stopped", and
TyrAdmissionAuditEvent gains stopCause.Pool.drain and Pools.drain take an optional second argument,
{ stopOnTimeout }.PoolConfig gains stop, Pool gains stopPolicy, GatewayOptions
gains shutdownStopOnDrainTimeout, and TyrPoolStats["tyr"] gains
stop.pools.ts exports StopPolicyConfig, PoolDrainOptions, STOP_CAUSES
and MAX_TAKE_BACK_GRACE_MS.Adapter.createStreamExtractor and of the three
stream extractors receives a second argument, final, which is true for
usage sent with the end of a reply. sse.ts exports the UsageListener
type, and responses-state.ts exports streamResponseFinished.async-bulkhead-llm stays at 3.18.0.async-bulkhead-llm@3.17.0 to async-bulkhead-llm@3.18.0. This also brings
in 3.17.1, which restructured the library internally without changing its
API or behavior. The tarball in vendor/ is the artifact npm published.stop policy on a limits update does not reach the library./stats, /metrics, audit events and the shutdown
drain result are the same as in 0.34.0. The 0.34.0 build on 3.17.0 and this
build were driven with the same 19 requests, covering all three provider
routes, streaming, rejections, a borrowed-slot deadline, observe mode,
runtime limit updates and a bounded drain. Everything they returned and
reported matched, apart from ids, timestamps, timings and the version.control.applyLimits and Latchflo managed mode rebuild each limits snapshot
from the fields Tyr knows, so a stop field on an update is dropped, as any
unknown field already was. The update is still applied.LLMAdmissionLimits.stop, LLMDrainResult.stopped, and stopped and
stoppedByCause under llm in pool stats. Tyr never sets them, and they
are absent from /stats.Pool.controller.applyLimits still hands its snapshot to the library as
given. A caller that passes stop there turns on stops that Tyr 0.34.1
has no handling for, so do not pass it.responsesState
block in the configuration file, or the same option on createGateway,
enables it. It has file, maxEntries (default 10,000) and ttlMs
(default 30 days).
2xx Responses reply that
carries an id and usage, as input_tokens + output_tokens. A request
with store: false and a reply without usage are not recorded.previous_response_id reserves its own
estimate plus the recorded size. The new x-admission-prior-tokens
response header reports that size. It is added after estimation, so
adaptive correction does not scale it, and follow-ups are not used as
calibration samples.422
with error.type: "unknown_previous_response" and
x-admission-reason: unknown_previous_response. The provider is not
called. Observe mode does not shadow this refusal.maxEntries records, drops the oldest first, and drops
each record ttlMs after it was written.persistFailures, and retries a full
rewrite with a delay that doubles from 1 second to 5 minutes. A successful
rewrite saves every record it still holds.422 as an
unknown id.tyr.responsesState counters in /stats and
tyr_pool_responses_state_* series in /metrics: records, recorded,
evicted, expired, follow-ups, prior tokens, refused, and persist failures.priorTokens on the admission audit event of a follow-up, and an audit
event with reason: "unknown_previous_response" for each refusal.npm run verify:responses-state, part of release:check. It starts the
built server from a configuration file, kills it with SIGKILL right after
a reply, and checks the follow-up after a restart.config/tyr.schema.json now accepts retryHint. The runtime has accepted
the block since 0.16.0, but the schema rejected it as an unknown key. A test
now holds the schema's top-level keys to the runtime's list, and the README
field reference lists the retryHint fields.responsesState is configured. Requests, responses,
/stats and /metrics are the same as in 0.33.0, and
previous_response_id is still rejected with 400 invalid_request.responsesState configured:
store: false request without
previous_response_id is still routed by capacity.tyr_admission_rejections_total gains the reason label value
unknown_previous_response, and the audit event's reason can carry it.
These refusals also count as rejected decisions in
tyr_admission_decisions_total and as admission_rejected in
tyr_requests_total. They never reach the pool, so
tyr_pool_rejected_total does not count them.fsync. A record survives a
killed Tyr process, but a host crash can lose the newest records.maxEntries is one bound shared by all callers, not a per-tenant bound.x-admission-prior-tokens and the priorTokens counter report the
recorded size even on a pool without a token budget, where nothing is
reserved.previous_response_id of null is treated as absent.conversation, background: true, stored prompt templates,
item_reference and provider-managed tools are still rejected.TyrAdmissionAuditEvent.reason is now
TyrRejectReason, which adds "unknown_previous_response" to the
async-bulkhead-llm reasons. Pool.prepare takes an optional priorTokens
argument, and Adapter.validate takes an optional
allowPreviousResponseId flag. The other additions are optional fields.async-bulkhead-llm stays at 3.17.0.npm run eval starts a mock OpenAI provider that serves 8 requests at a
time and answers 429 beyond that, a local evaluation-only JWT issuer, and
Tyr with eval/tyr.eval.yaml. It sends the same workload of 3 interactive
callers and 24 batch callers straight to the provider and then through Tyr,
and prints both results with Tyr's per-class admission metrics.npm run eval:serve keeps the stack running. eval/sdk/quickstart.mjs and
eval/sdk/quickstart.py call responses.create(...) and Chat Completions
through Tyr with the OpenAI SDKs and print the selected admission class.npm run eval -- --upstream=openai --model=<model> --confirm-live runs the
workload against OpenAI. At most 40 requests reach OpenAI, each limited to
16 output tokens, and the run stops at the first error that is not a
capacity 429.EVALUATION.md, a checklist from the mock run through observe mode on real
traffic to deployment and readiness.npm run verify:eval runs a short evaluation and fails unless every
interactive request completes through Tyr, the provider rejects nothing
behind Tyr, and Tyr sheds batch work. It is part of release:check and CI.verify:eval and release:check need local ports 8787, 9101, and 9102 free.LICENSE.txt
contains the unmodified license text, NOTICE.txt carries the attribution
notice, and package.json declares Apache-2.0. Latchflo, which managed mode
talks to, remains separately licensed and is not covered.LICENSE.txt, NOTICE.txt and
THIRD_PARTY_NOTICES.txt, and carries the OCI licenses and source
labels. The npm package now includes NOTICE.txt.CONTRIBUTING.md and SECURITY.md.x-korrx-grant-id and x-korrx-controller-epoch response
headers. x-latchflo-grant-id and x-latchflo-controller-epoch carry the
same values.source: "korrx" admission-provenance value. Provenance must
now use source: "latchflo"; the validation error reads
provenance.source must be "latchflo".master. It was configured for main, which this
repository does not use, so only pull requests and tags were checked.eslint.config.mjs. ESLint loads eslint.config.js
first, so the second file never applied.source: "latchflo" since 0.4.0, and no known consumer reads the
x-korrx-* headers. A client that still reads them must switch to the
x-latchflo-* pair.source: "korrx", which Tyr rejects, so their grants are never
applied and managed pools stay fail closed.502 upstream_error responses include a bounded cause: { name, code },
for example ECONNREFUSED, ECONNRESET or UND_ERR_SOCKET. Node's fetch
reports every transport failure as fetch failed; the reason is only on the
error's cause chain, which Tyr previously discarded. The cause message is not
returned because it can contain internal addresses.tyr_upstream_failures_total{pool,provider,code} counts every upstream
failure, including streams torn after headers were sent.tyr.diagnostic.v1 upstream_failure JSON line is written to stderr
per failure. It carries the code, syscall, a flag for whether headers were
already sent, and a detail message bounded to 300 characters. It is emitted
regardless of telemetry.audit.enabled, because without it the transport
reason behind a 502 cannot be recovered. telemetry.diagnosticSink
overrides the sink for embedding and tests.502 upstream_error "fetch failed" could not be attributed. A refused
connection, a reset, and a keep-alive socket closed by the upstream all looked
identical, and nothing recorded which one occurred.async-bulkhead-llm@3.17.0 is unchanged.type and message are unchanged.borrowedAdmissionSlot policy with the explicit
deadline_abandonment release mechanism and a bounded post-admission
deadlineMs.504 borrowed_admission_deadline responses that state the released
local resource, cancellation request, deadline, and unverified upstream
reclamation status./stats and bounded Prometheus
series for local slot releases, upstream cancellation requests, unsettled
admitted work, and per-class borrowed-slot deadline counts.tyr.restoration.admissionSlots.releasedByCause, splitting early slot
returns into deadline (expired lease) and manual (explicit
abandonBorrowedConcurrency()), so a lease configured too tight is
distinguishable from deliberate shedding.verify:borrowed-restoration and integration coverage for split local
slot/token release, protected-class admission after restoration, drain, HTTP,
audit, metrics, and invalid policy rejection.borrowedAdmissionSlotDeadlines: true.verify:vendor-provenance, an online CI check that each vendored
tarball is the artifact npm published for that exact name@version. The
existing offline verify:vendor compares a tarball to its lockfile entry,
and the two can be regenerated together from a local npm pack, so it
cannot detect a pre-release build claiming a released version.async-bulkhead-llm@3.16.0 to async-bulkhead-llm@3.17.0.tyr_pool_borrowed_admission_slot_deadlines_total to deadline expiries.
Only an expired lease aborts the callback signal, so a manual abandonment is
no longer reported as a cancellation request. The local-slot release series
still counts every early return, and the per-class counter keeps counting
every early return because upstream exposes no per-class cause split.async-bulkhead-llm@3.17.0 tarball was a pre-release build missing the
published release's cause split on borrowed-slot abandonment; the
async-bulkhead-ts and yaml tarballs were repacks that differed in
packaging only.shutdown.drainTimeoutMs reports it as outstanding and bounds Tyr's
wait without claiming that upstream execution stopped.unverified, never as reclaimed
capacity. Protecting provider account limits, model queues, or accelerators
still requires an unlent floor or another independently enforceable release
mechanism.borrowedAdmissionSlot retain non-preemptive drain behavior.POST /v1/responses on the configured OpenAI upstream.
The route preserves the native Responses wire shape and shares Tyr's existing
pool selection, identity, admission-class, routing, telemetry, timeout, and
provider-header forwarding pipeline.input,
instructions, max_output_tokens, request-visible function and custom
tools, text/reasoning configuration, and multimodal input_image /
input_file blocks.usage.input_tokens / usage.output_tokens reconciliation
and semantic SSE usage extraction from Responses lifecycle events such as
response.completed.verify:openai-responses executable coverage for projection, raw request
passthrough, OpenAI credential headers, non-streaming and streaming usage, and
conservative hidden-state rejection.previous_response_id,
server-side conversation, stored prompt templates, item_reference,
background: true, and provider-managed retrieval/computer tools. Those modes
can add prompt or execution state that is not visible when Tyr must reserve
capacity before provider invocation; rejecting them avoids presenting an
under-reserved request as token-safe.routingTopology desired-state parsing with strict
version, member-ID, and routable endpoint validation.verify:routing-topology, which exercises the real desired-state parser
and gateway path for dynamic join, removal, stale-revision rejection, and a
replacement Tyr joining under a new identity.routing.capacityAware.instanceId to equal controlPlane.instanceId.routing.capacityAware.peers remain the startup/fallback topology for
standalone Tyr and for older Latchflo controllers that omit routingTopology.routingTopology is received.tyr.admission-provenance.v1, and runtime dependency versions are unchanged
from 0.27.0.tyr_admission_decision_seconds, sourced directly from
async-bulkhead-llm@3.16.0 admission events. It measures synchronous local
admission-decision work while excluding the awaited local concurrency
acquire.tyr_admission_queue_wait_seconds for that concurrency-acquire wait.
Both histograms use bounded pool, outcome (admitted/rejected), and
admission_class labels; model/request/identity dimensions remain excluded.verify:admission-timing coverage for admitted and rejected
counts, exact zero queue wait on a precheck rejection, fine decision buckets,
and observe-mode exclusion.async-bulkhead-llm@3.15.1 to async-bulkhead-llm@3.16.0. The transitive
async-bulkhead-ts@1.0.1 dependency is unchanged._sum / _count are the intended
headline aggregation; histogram buckets are diagnostic rather than a
quantile-based headline.tyr.admission-provenance.v1 is unchanged; this release adds Prometheus
timing only and does not version or extend the provenance record./stats
payload under tyr.admissionProvenance. Events are captured from
async-bulkhead-llm's synchronous admit event after capacity is held and
before Tyr invokes the upstream callback.tyr.admission-provenance.v1 records with a pool-local monotonic
sequence, admission timestamp, Tyr-generated admission ID, priority, optional
admission class, exact limit revision, reserved tokens, immutable applied
limits, and matching Latchflo grant provenance when managed.retained, dropped,
captureFailures, and nextSequence counters so consumers can detect
incomplete proof evidence./stats./stats and audit
evidence; no new Prometheus labels were added.async-bulkhead-llm@3.15.1 and
async-bulkhead-ts@1.0.1.vendor/async-bulkhead-llm-3.15.1.tgz,
vendor/async-bulkhead-ts-1.0.1.tgz, and vendor/yaml-2.9.0.tgz to the
source release archive. The committed lockfile resolves those exact tarballs,
and the Dockerfile copies vendor/ before npm ci; omitting them made clean
Docker builds fail with ENOENT /app/vendor/*.tgz.capabilities.admissionClassOccupancyAck: true to Latchflo registration
so Latchflo 0.11+ can require ordered class-level handoff evidence before
reusing protected capacity ahead of lease expiry.applied acknowledgements now include bounded, deterministic
admission-class occupancy alongside the existing pool occupancy: protected
use, shared borrowing, hard ceilings, and token occupancy when configured.maxConcurrent and maxInFlightTokens values. This lets a control plane
reject stale pre-apply class snapshots while keeping class IDs bounded by the
fixed local table.verify:class-handoff executable verification
for class-only protected-floor restoration.0.25.0. Runtime dependencies are unchanged from 0.24.0.x-tyr-routed-by header on slower hosts.applied acknowledgement with a fresh
post-ack class heartbeat to commit class-only protected-floor restoration
before the old lease expires.capabilities.grantOccupancyAck: true to Latchflo registration and
additive bounded occupancy evidence on successful applied grant
acknowledgements: appliedAt, inFlight, pending, and inFlightTokens
when the pool exposes token occupancy.0.24.0. Runtime dependencies are unchanged from 0.23.0.applied acknowledgement plus a fresh post-ack heartbeat
proves occupancy is within the drain target.lastRequestAt tracking. A
failed heartbeat does not advance class counters, so a later retry carries all
activity since the last heartbeat Latchflo actually accepted.capabilities.admissionClassDemand: true alongside
admissionClasses: true when registering with Latchflo. The then-current Latchflo 0.8.x
ignores the additive capability and nested heartbeat field; a class-demand-aware
allocator can opt into the richer signal without changing Tyr's request path.0.23.0. Runtime dependencies are unchanged from 0.22.0.protectedConcurrent and protectedInFlightTokens. Tyr validates each floor,
the corresponding hard ceiling, and the sum of all floors against the local
physical pool envelope before startup or runtime application.3 and include
protected/borrowed class state plus the shared remainder. Replica selection
predicts protection-layer rejection in addition to global and hard class
ceilings.async-bulkhead-llm@3.14.0 to
3.15.1 and refreshed the bundled offline artifact.tyr_build_info now reports 0.22.0; telemetry smoke verification also checks
that the runtime version constant matches package.json.capabilities.admissionClasses: true when registering
with Latchflo. Latchflo 0.7.0 and newer refuse to enrol an agent into any
pool carrying admissionClassLimits unless the agent declares this, so
every replica in a class-configured fleet previously failed registration
with 400 and never appeared in GET /v1/agents. Combined with the
0.20.1 retry-forever change, the symptom was a healthy-looking but
permanently unready fleet that the control plane could not see. Older
control planes ignore the field.limits.admissionClasses is parsed, validated
(bounded class count, known properties only, non-negative integers,
reserved class IDs rejected), and applied as part of the same atomic
limits transaction as concurrency and token budget. Fleet-wide class
ceilings configured in Latchflo now take effect instead of being silently
discarded in favour of the locally configured table.admissionClasses overrides them. A grant that omits the field leaves the
configured table in force, so control planes predating class-aware
allocation continue to work unchanged.revision_content_conflict rather than being accepted as
equivalent.admission_class_key_mismatch, or admission_classes_not_configured
when the pool has no class table at all). Previously the key-preservation
check inside applyLimits would throw, leaving the grant unacknowledged
until the expiration kill switch zeroed the pool.async-bulkhead-llm@3.14.0 and the vendored async-bulkhead-ts@1.0.1.400/401/403/404/409/422, or a malformed response body). All
three now keep retrying with the existing bounded exponential backoff, so
a transient control-plane blip that happens to return one of those
statuses no longer strands Tyr unready until a manual restart.401 when no bootstrap token is configured now discards the known-bad
token so the next attempt fails fast locally with the existing "bootstrap
token is required" message, instead of resending the same doomed request
to Latchflo forever.agentTokenFile volume) being misclassified as an ordinary
retryable connectivity failure. A freshly issued token now stays valid in
memory even when it cannot be durably persisted, so Tyr no longer
re-registers with Latchflo on every retry solely because of a local
filesystem problem. The failure is now reported through a new
tyr_latchflo_failures_total{operation="persist",reason="persist_error"}
counter instead of the generic retryable/permanent reasons.test/latchflo.test.ts.async-bulkhead-llm@3.14.0. Each configured class can independently cap
active requests and in-flight tokens while remaining subordinate to the
physical pool envelope.x-admission-class, admission-class attribution in structured audit
events, bounded admission_class decision labels, and live per-class
capacity/admission/rejection Prometheus series.scripts/verify-admission-classes.mjs and focused unit coverage for
bounded policy validation, first-match evaluation, class isolation,
class-aware routing, atomic class-limit updates, and Latchflo preservation.async-bulkhead-llm@3.13.0 to
3.14.0 while retaining the progressive-reconciliation API used by Tyr.2. Tyr accepts schema versions 1
and 2, but a class-aware request treats a schema-1 peer without class data as
ineligible rather than assuming capacity.admissionClasses retain 0.19 behavior.async-bulkhead-llm@3.13.0 and its ProgressiveUsageReconciler. Once a
provider reports cumulative usage, Tyr returns already-processed input and
output capacity while retaining a bounded future-output hold.progressiveReconciliation configuration with
enabled, updateStepTokens, and outputSafetyMarginTokens. Budgeted pools
enable the feature by default with a 256-token update step and 256-token
safety floor.async-bulkhead-llm@3.12.0 to
3.13.0. The vendored release artifact uses async-bulkhead-ts@1.0.1.progressiveReconciliation.enabled: false on a pool to retain the
conservative 3.12 behavior: actual input plus the full output ceiling stays
held until final release.TyrDemandReporter, which derives bounded heartbeat deltas from Tyr's
existing pool statistics without adding work to the provider request path.oldestPendingMs is intentionally omitted because Tyr's current bulkhead
statistics expose queue depth but not waiter age. Latchflo's continuous-demand
state still provides starvation aging across heartbeats.GET /_tyr/capacity endpoint and
asynchronous peer snapshot polling with bounded probe deadlines, stale-peer
exclusion, single-flight refreshes, and strict snapshot validation.x-tyr-routed-by and x-tyr-routed-to.routing.capacityAware YAML and JSON Schema configuration, with the
shared secret loaded from an environment variable instead of stored in the
configuration file.502 or 504
response instead of risking a duplicate provider invocation.Retry-After on capacity rejections. Tyr now estimates when the pool
will have room and tells the caller, instead of leaving it to guess with
blind exponential backoff. Emitted for concurrency_limit, queue_limit,
budget_limit, and timeout.x-admission-retry-after-ms alongside it, carrying the precise wait.
This is the header to prefer. Retry-After has one-second resolution, and
most capacity waits under load are shorter than that.retryHint configuration block (enabled, minMs, maxMs,
halfLifeMs, minSamples) and the TYR_RETRY_HINT_ENABLED environment
override.Retry-After
will change its retry timing against Tyr on waits of a second or more.
Shorter waits deliberately carry no Retry-After at all: rounding a 200ms
wait up to Retry-After: 1 would park a compliant client five times longer
than necessary, which is worse advice than the backoff it would have chosen
itself. Those rejections carry only x-admission-retry-after-ms, so a client
that reads neither header behaves exactly as it did before. Set
retryHint.enabled: false to suppress both.minSamples completions, no header is emitted at all — a missing header is
an honest "unknown", which is why async-bulkhead-llm continues to expose
capacity counters and no ETA of its own. The library cannot see how long work
takes; Tyr can, because it proxies it.401 identity
failures, 403 authorization failures, and both distinct 503 contracts:
retryable identity_unavailable verifier outages and shutdown admission
rejection.401; JWKS network,
timeout, HTTP, size, parsing, and unusable-key-set failures now return
503 identity_unavailable without a WWW-Authenticate challenge.503 identity_unavailable; custom authenticators must throw an explicit
TyrIdentityError for 401 or 403 caller failures.identity.jwt and
identity.roles. The default x-tyr-identity-token header keeps identity
credentials separate from provider Authorization headers.GatewayOptions.resolvePriority(req, identity).x-priority is ignored. The legacy trusted-header path is
retained for deployments without first-class identity.tyr.admission-audit.v2 and include
authenticated identity on admitted, observe-bypassed, and rejected decisions.
Identity fields are not added to Prometheus labels./stats and /metrics can now be authorized by an authenticated operator
role; TYR_OPERATOR_BEARER_TOKEN remains available as an alternative.GET /metrics with bounded dimensions
for admission decisions, rejection reasons, gateway outcomes, upstream status
classes, request/upstream duration histograms, pool limits and utilization,
token reservation/reconciliation, readiness, grant expiration, controller
epoch, audit failures, and Latchflo integration failures.tyr.admission-audit.v1 JSON events for admitted,
observe-bypassed, and rejected decisions. Completed admissions include final
provider usage when available and exact grant provenance without placing
request, admission, model, or grant identifiers into metric labels.TYR_OPERATOR_BEARER_TOKEN protection for /stats and /metrics while
leaving /healthz and /readyz available to orchestrators.telemetry.metrics.enabled and
telemetry.audit.enabled, plus environment overrides.createGateway() now also returns its telemetry collector so the built-in
Latchflo managed mode can report bounded integration-failure counters.controlPlane.type: latchflo file configuration with
instance identity, managed pool selection, metadata, retry cadence, bootstrap
credential environment lookup, and persisted rotated agent tokens./readyz; it returns 503 control_plane_not_ready until all managed
pools hold valid, unexpired grants while /healthz continues to report
process liveness.Retry-After support so Tyr remains
observable without synchronizing a fleet against an unavailable control plane.source: "latchflo". Tyr continues accepting the
deprecated "korrx" source and emitting deprecated x-korrx-* aliases.src/index.ts.async-bulkhead-llm to 3.12.0. Latchflo-managed pools are now
required to start at zero concurrency, zero queue capacity, revision zero,
and enforcement mode so startup is fail closed before the first grant.401. Grant acknowledgements are
best-effort and cannot interrupt local expiration scheduling after a grant is
applied; permanent configuration, authentication, and protocol failures are not
retried continuously.source: "latchflo" on immutable admission provenance alongside the
existing source: "korrx". Both are valid; "korrx" is retained for the
Latchflo rebrand transition.x-latchflo-grant-id and x-latchflo-controller-epoch response
headers, emitted alongside the existing x-korrx-* pair with identical
values.AdmissionProvenance.source is now the exported AdmissionProvenanceSource
union rather than the "korrx" literal. Consumers annotating provenance
objects with the literal type continue to compile.provenance.source must be "korrx" or "latchflo". Callers matching the old
message as a substring are unaffected; exact-string matchers must update.x-korrx-grant-id and x-korrx-controller-epoch are deprecated aliases.
They will be removed in a future release once no consumer reads them.source: "korrx" is deprecated. It will be rejected in a future release once
every control plane in the fleet emits "latchflo".This release is intentionally backward compatible rather than a rename. Tyr and
the control plane are deployed independently, and a provenance mismatch throws
out of applyLimits instead of returning a rejection, so the agent never acks,
readiness goes stale, and the expiration kill switch drives pool capacity to
zero. A hard cutover therefore sheds live traffic in either deploy order --
the same failure mode recorded under 0.11.1, when Korrx emitted
source: "korrx" while Tyr still required source: "zab". Accepting both
values removes the ordering constraint entirely.
Recommended rollout:
source: "latchflo", at whatever pace.x-korrx-* to the x-latchflo-* pair.korrx-control-plane 0.2.0.x-korrx-grant-id and
x-korrx-controller-epoch.source: "korrx" but Tyr required source: "zab"./stats.x-zab-grant-id and x-zab-controller-epoch to admitted, bypassed,
and rejected responses whenever the decision revision has Zab provenance.async-bulkhead-llm to 3.11.0.limitRevision directly
instead of reading bulkhead.limits() after admission.maxConcurrent, maxQueue, token budget, and high-priority reserve.limitsRevision, maxQueue, and queueTimeoutMs startup
configuration, plus legacy environment equivalents.control interface from createGateway() with
limits(), stats(), and Tyr-local transactional applyLimits() methods.x-admission-preview-revision, x-admission-revision,
x-admission-outcome, and x-admission-bypass-reason response headers.async-bulkhead-llm from 3.8.0 to exactly 3.10.0.maxConcurrent: 0 is supported at runtime as a fail-fast per-pool kill
switch, while startup configuration still requires a positive initial value.lint / lint:fix scripts,
dependency lock entries, and a required CI lint step.release:check and documented the lint commands in the README.cause when configuration file reads or YAML
conversion fail, and removed an unused test import found by linting.pools-v38.test.ts suite and replaced it with focused
v3.10 coverage.admissionMode: enforce | observe. Observe mode records the
same detailed capacity decision as enforcement while proxying capacity
rejections upstream with a synthetic shadow-... admission ID.createAdaptiveTokenEstimator, enabled by default for budgeted pools and
configurable through adaptiveEstimation / legacy environment variables.x-admission-mode,
x-admission-preview, x-admission-preview-reason, and
x-admission-reserved-tokens./stats, including advisory
decisions, shadow bypasses, race bypasses, and adaptive correction snapshots.shutdown.drainTimeoutMs and
SHUTDOWN_DRAIN_TIMEOUT_MS, returning per-pool outstanding-work snapshots.async-bulkhead-llm to exactly 3.8.0.bulkhead.estimate() is now passed
verbatim to both wouldAdmit() and authoritative admission, including the
v3.8 reserved consistency check.x-admission-id, exposing
async-bulkhead-llm's stable UUID for correlation across client logs,
gateway traces, streaming usage updates, and release events.opaqueMediaInputTokenReservation and legacy
OPAQUE_MEDIA_INPUT_TOKENS configuration. The default remains a conservative
2,048-token surcharge per opaque media/document block; 0 disables it.async-bulkhead-llm from 3.6.0 to 3.7.0.system,
extraInputTokens, and opaqueBlockTokens surfaces instead of a hidden
symbol and a synthetic JSON user message.README.md and updated the documentation for the 3.7 integration.TYR_CONFIG_FILE, including strict unknown-field validation, multi-pool
routing, deterministic rejection of mixed file/environment configuration,
and a safe configuration fingerprint in startup logs.tyr validate --config <path> / npm run validate:config for offline
validation without opening a listener.config/tyr.example.yaml, a JSON Schema, focused configuration tests,
a production Dockerfile, and a file-mounted Compose example.tyr-admission-controller.x-priority: high is no longer trusted by default.
High-priority admission can be derived with GatewayOptions.resolvePriority,
or raw header trust can be explicitly enabled with
trustPriorityHeader / TRUST_X_PRIORITY_HEADER=true only behind a trusted
proxy. This prevents unauthenticated callers from self-assigning reserved
capacity.system,
tools, and tool_choice; OpenAI tool/function schemas and calls,
response_format, prediction, and null-content assistant/tool turns.
Opaque image, audio, document, file, and video blocks now receive a
conservative 2,048-token minimum surcharge while inline binary data is
omitted from literal text estimation.NaN,
fractional, negative, or out-of-range values silently.npm start is compatible with the declared Node.js 20+ engine: it builds and
starts dist/index.js instead of using Node's experimental TypeScript
stripping on src/index.ts. The process banner now says tyr-gateway.npm run smoke and npm run release:check; CI now imports the built
runtime on every supported Node version.async-bulkhead-llm from 3.4.1 to
3.5.0.Requests are now validated before admission. Previously, the JSON
body was cast to Record<string, unknown> without checking it was
actually a non-array object, and toMessages() accepted any array
without validating its elements. This let malformed client input reach
the bulkhead and surface as an infrastructure failure rather than a
client error:
null (or any non-object JSON value) returned 500 internal instead of 400.max_tokens: -1 (or any negative/non-integer/oversized output limit)
was forwarded upstream and came back as 502 upstream_error.content threw content is not iterable deep in
the adapter, surfacing as 502 upstream_error.Each provider adapter (src/adapters.ts) now exposes a validate()
that checks, before the bulkhead ever sees the request: the top-level
JSON value is a non-array object; model is a non-empty string;
messages is an array of valid { role, content } entries (string or
content-block array content, valid roles); output-limit fields
(max_tokens / max_completion_tokens) are non-negative safe integers
below a configured ceiling (maxOutputTokens, default 200,000, see
GatewayOptions.maxOutputTokens / MAX_OUTPUT_TOKENS); Anthropic-
required (max_tokens) and OpenAI-required fields are present; and
stream, stream_options, tools, system, and multimodal content
blocks have valid shapes when present. Shared shape-checking helpers
live in the new src/validation.ts. Invalid client input now returns
400 with error.type: "invalid_request" and an errors array
describing every problem found — never 500 or 502.
An unsupported model now returns 422, not 404. The route
exists and the request body is well-formed; it simply doesn't match any
configured pool. error.type is now "unsupported_model".
Route matching now compares the request's pathname, not its complete
raw URL. Previously /v1/messages?x=1 incorrectly 404'd because the
router compared req.url verbatim against "/v1/messages". Routing now
parses new URL(req.url, base).pathname for matching, so query strings
no longer affect routing.
PoolConfig.budget is now documented as tri-state: omitted (unlimited,
token-aware admission disabled), 0 (a legal "admit nothing" pool — every
budget-gated request is rejected with 429/budget_limit), or N > 0
(the in-flight token ceiling). Previously only the omitted/positive states
were documented. budget: 0 used to throw at construction under
async-bulkhead-llm@3.2.0; the currently pinned 3.3.1 makes it a valid
construction that simply never admits, which the gateway now allows
intentionally (useful for taking a pool out of rotation without deleting
it from config) rather than treating as a footgun to reject. Added a test
pinning that a budget: 0 pool constructs successfully and returns 429
for every request rather than crashing.content-length
header instead of relying on Node's chunked-transfer-encoding fallback.
Previously, a client pipelining multiple requests on a single keep-alive
connection (or any client relying on content-length for response
framing) could misparse where one response ends and the next begins.
This also fixes a latent issue where the documented graceful-shutdown
503/x-admission-reason: shutdown response would send Connection: close, causing the socket to close promptly at that point — see next
item.503/shutdown admission
rejection sends Connection: close, so the connection it arrived on
closes immediately instead of idling out on Node's keep-alive timer.
Previously, shutdown() would not resolve until every connection —
including ones that had already received a final "shutdown" rejection —
had gone fully idle and timed out, needlessly delaying process exit.`
Breaking: upstreamTimeoutMs replaced by two distinct timeouts:
responseTimeoutMs bounds how long the upstream may take to send
response headers (i.e. for fetch() to resolve). Cancelled the instant
headers arrive — it does not bound how long a streaming body may
subsequently run.idleTimeoutMs bounds the gap between consecutive chunks of a streaming
response body. It resets on every chunk received, so a healthy
long-running stream that keeps sending data — no matter its total
duration — is never killed, while a stream that stalls mid-flight is
aborted once the gap exceeds the limit.Previously, a single upstreamTimeoutMs bounded the entire upstream call
end-to-end, which meant a perfectly healthy long-running stream could be
killed simply for taking a long time overall. The env vars
RESPONSE_TIMEOUT_MS and IDLE_TIMEOUT_MS replace UPSTREAM_TIMEOUT_MS
in the default src/index.ts entrypoint. A response-timeout expiry
returns 504 with error.type: "response_timeout"; an idle-timeout
expiry either returns 504 with error.type: "idle_timeout" (if headers
were not yet sent) or terminates the connection outright (if the stream
had already started, since a clean JSON error can no longer be sent at
that point).
Streaming backpressure: the proxy loop now honors res.write()'s return
value and pauses pulling further chunks from the upstream body until the
client's write buffer drains (or the connection closes). Previously, a
fast upstream stream paired with a slow-reading client would let Node
buffer the entire response in memory with no upper bound; now the
gateway's own memory usage for a stream stays bounded by the client's
actual consumption rate.
Graceful shutdown: createGateway() now returns a shutdown() function
that stops the HTTP server from accepting new connections and calls the
new Pools.drain() (backed by async-bulkhead-llm's bulkhead.drain())
to let in-flight requests finish before resolving. New admissions during
drain are rejected with 503 and x-admission-reason: shutdown (already
supported by the existing rejection mapping). The default src/index.ts
entrypoint now listens for SIGTERM/SIGINT and invokes shutdown()
before exiting.
maxRequestBodyBytes gateway option (default 1 MiB) that caps how many
bytes of an incoming request body are buffered before the gateway responds
413 Payload Too Large. Configurable via MAX_REQUEST_BODY_BYTES in the
default env-configured entrypoint. Previously request bodies were buffered
with no upper bound, allowing unbounded memory growth from oversized or
malicious payloads.POST /v1/chat/completions, proxied verbatim to
OPENAI_UPSTREAM_URL. Shares pool/bulkhead admission machinery with the
existing Anthropic route, so a single pool can serve models from either
provider.src/sse-openai.ts),
reading cumulative usage from the final chat.completion.chunk when the
client sets stream_options: { include_usage: true }.openaiUpstreamUrl gateway option — both upstreamUrl and
openaiUpstreamUrl are optional, allowing Anthropic-only, OpenAI-only, or
combined deployments. A route with no configured upstream returns 404.async-bulkhead-llm@3.2.0.POST /v1/messages admission-gated proxy to an Anthropic-shaped upstream,
forwarding auth headers (x-api-key, authorization, anthropic-version,
anthropic-beta) verbatim. The gateway holds no provider keys.max_tokens before running, refunds the surplus as real
usage arrives (including mid-stream), and rejects immediately once the
ceiling is hit.src/sse.ts),
reading Anthropic message_start / message_delta events to correct a
long-running stream's budget hold live.x-priority: high request header.GET /stats for per-pool live stats (budget, slots, refunds) and
GET /healthz for liveness.429 / 503 / 504 rejection responses with an x-admission-reason
header and a JSON detail capacity snapshot — no fabricated Retry-After.test/gateway.test.ts) against mock upstreams.dist from the test glob and scoped the
build output to src only.