The ceilings on connections from other machines, the deadline for a
request's headers, the budget of the bodies in flight and the refusal of
a compressed body are said where clients read about the proxy's
refusals, with the variable of each and how to raise one for a gateway.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every guard reads the body as it comes, and a body sent with a
Content-Encoding (gzip, deflate, br) reads as no JSON to each of them, so
each let it pass: an engine or a front that decodes it would take what no
guard had seen. A body in any coding but identity is now refused with a
415 and Accept-Encoding: identity, before it is read; no client of this
port compresses its body. The cockpit's outcome list knows the new line.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGLang's video processor (qwen_vl.py, v0.5.21) takes its
VIDEO_TOTAL_PIXELS from the environment variable VIDEO_MAX_PIXELS; the
guard read VIDEO_TOTAL_PIXELS, a name the engine never reads, so the two
could not be set alike. The guard now reads VIDEO_MAX_PIXELS, with the
engine's default.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The wall's allow list refused Ollama's /api/tags and /api/show,
SageMaker's /ping and the root as operator routes, though SGLang v0.5.21
only reads there (a model list, a model card, an empty 200, "is
running"). They are client routes now. /encode and /classify stay out:
they run the model outside the size guard, and /v1/embeddings and
/v1/classify, which it guards, are a client's way there.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where a wedge is possible, a body the engine's count cannot take is
judged at one byte a token, and /v1/responses' input and /generate's
image_data, video_data and audio_data carry their media as base64: one
photo was a token per byte and refused as too long. Those media are now
priced by _media_tokens, as everywhere else in the guard (an image by its
header, a video by its ceiling), and only the rest of the body is judged
by its size.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGLang v0.5.21 serves the counting handlers at /v1/tokenize and
/v1/detokenize too, which the ceiling of the bare routes missed. And the
size guard, to decide on a nominated prompt, handed its text whole to the
engine's /tokenize, up to MAX_BODY_BYTES, the very load that ceiling keeps
from the engine. A prompt whose text alone is past COUNT_BODY_MAX_BYTES,
over four times the largest window a lane serves, is now refused as too
long without a count, on the relay path and System One's alike.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Only a chat or /generate stream proved that the engine takes the rid the
proxy imposes, and the proof was dropped at every engine restart: a box
served by Claude Code alone never had it, and each abandoned /v1/messages
answer was drained for up to DRAIN_MAX_S. Until an answer says otherwise,
the active unit named in PROXY_HOLD_UNITS starting its engine with
SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1, on its command line or in the
launcher it runs, is now the proof. vLLM's lanes do not set it and keep
the drain.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The budget was taken whole on the Content-Length before a byte was read
and kept to the end: a key holder announcing large bodies and sending
nothing held all of it, and every other body, loopback's included, got a
503. A body at or under BODY_SMALL_BYTES (1 MiB) is now always read and
holds none of it; a larger one takes its bytes as they arrive, a step at
a time, and is refused when no room is left, except the oldest one being
read, which waits up to BODY_WAIT_S for the room the others give back, so
two bodies read at once never both lose.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No key is asked before a request's line and headers are in, and
CLIENT_IO_S (900 s) bounded each read, not the whole: four addresses at
their ceiling of silent or trickling connections shut the port to every
other peer on the network, with no key. A connection from the network now
has CLIENT_HEADER_S (30 s, settable) in all until its headers are in, a
byte at a time or not, then CLIENT_IO_S again. Loopback is unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sampling guard judged a body once, before the hold that waits for a
restarting engine, against the vocabulary of the engine that was there,
and the request then went as it was to the engine that came back, which
can be another lane: an id the old lane held and the new one does not
took it down. After a hold, the body is judged again, against a
vocabulary learned since the hold began; an answer in a stream the hold
opened is an error event of that stream.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine's counting routes generate nothing, so the oversize guard
never measured them and only MAX_BODY_BYTES (256 MiB) bounded what they
handed the engine's tokenizer. Past COUNT_BODY_MAX_BYTES (16 MiB, over
four million tokens of prose) they now get a 413 before the body is
read. /v1/messages/count_tokens, which Anthropic clients send their
whole conversation to, keeps MAX_BODY_BYTES.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The sampling guard stood down when the served vocabulary could not be
learned (a busy, paused or restarting engine, or one that answers the
probe), refusing only negative ids, so an id past the vocabulary, which
takes the scheduler down for every client, was relayed on trust. An id
under the smallest vocabulary of the lanes the proxy fronts (Kolibri's
128,000) still goes; one at or past it gets a 503 with Retry-After until
the vocabulary is known.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Scoring asks the engine for token_ids_logprob itself, from
label_token_ids, so a score request batched with any other is the mixed
batch that kills the scheduler (sglang#34719), the reason the field is
refused on /generate. /v1/score was relayed with nothing read; a non
empty label_token_ids is now refused with a message naming the route.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy believed the engine's Anthropic route ignores x-override-rid,
so an abandoned Claude Code answer was drained, decoding for nobody for
up to DRAIN_MAX_S (900 s). In v0.5.19, v0.5.21 and the flash nightly that
route builds its request through the chat route's
_convert_to_internal_request, which applies the header. The proxy now
imposes its rid on /v1/messages and aborts with it once a chat stream has
proven that the engine honours it; an Anthropic stream, whose msg_ id is
no rid, never decides that proof.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MAX_BODY_BYTES capped one body and nothing capped them together: each is
read whole and parsed again by the guards, so a few legitimate bodies
near the cap reached the unit's MemoryMax=1G at once, where the kernel
killed the proxy and every stream in flight. Past BODY_BUDGET_BYTES
(384 MiB) a body is not read and gets a 503 with Retry-After; a body
arriving when none is in flight is always read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A body the engine's count routes could not take (native /generate
fields, /v1/responses' input) was judged by the 2.5 bytes a token
average, so a body of digits, one token each, went past the limit
uncounted, into the zone the engine queues and never admits. The native
/generate shape is now counted (ids count themselves, text is a prompt)
and what still cannot be counted is judged by the one byte a token bound
where a wedge is possible; elsewhere the average decides as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The oversize guard charged a video a flat 4,096 tokens, where SGLang's
own video sizing (768 frames, VIDEO_TOTAL_PIXELS) lets one cost about
88,000, and a body of a dozen video URLs is a few kilobytes that the
byte estimate never nominated for a count. Where a wedge is possible,
each video part now adds its ceiling to the nomination and to the count,
so such a body is counted and refused as too long; lanes whose engine
refuses past its own window keep the flat budget and see no change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
/v1/score takes token ids in query (List[int]) and items
(List[List[int]]), which index the embedding as input_ids do, but the
route was not in SAMPLE_GUARD_ROUTES, so a negative id or one past the
vocabulary went to the engine unread and could take the scheduler down
for every client. The route is now guarded like the others; text items
are left alone whatever their characters.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
urllib's default handler followed an engine redirect on a GET, resending
the engine's key, and the answer went out under the path the caller had
asked for, the one that decides the /server_info masking: /server_info/
came back 307 to /server_info, was followed, and was relayed unmasked.
Engine redirects are now relayed with a Location that points back at the
proxy, and the masking ignores trailing slashes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every connection held a thread and a descriptor for up to CLIENT_IO_S
(900 s) before its request line was read, with nothing counting them, so
any peer reaching the port without a key could exhaust the descriptors
and lock every client out. Connections from other machines now count
against a ceiling per address (PROXY_MAX_CONN_PER_ADDRESS, 64) and one
for the network (PROXY_MAX_REMOTE_CONN, 256), and past either the new
connection is closed before a thread starts, as the cockpit's relay does.
Loopback is not counted, so clients on the box keep the port.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behind the identity wall the proxy signs every relayed request with the
engine's own key, so any listed client key could reload or update the
weights, start the profiler, pause or slow the engine, flush its cache or
abort every request, as the operator. A listed key now reaches an allow
list (everything under /v1/, the native generation routes, counting,
server info, health and metrics) and gets a 403 elsewhere. The cockpit
calls the engine's operator routes on 127.0.0.1:30000 directly.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Bolt's template reads enable_thinking and medium_effort, and no reasoning effort:
a reasoning_effort of none sent to the engine as it came left the answer inside
the reasoning, its content null (measured, 2026-10-15). On the Nemotron lane the
proxy says each level in those words, none and minimal off, low and medium the
shorter reasoning, high and above the default; a request that names
enable_thinking keeps its choice, and every other lane gets its request as it
came. Its unit holds requests for this lane too while it boots.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
v6.39 noted that the engine has neither of SGLang's info routes and asked them no more until an
engine started again. A proxy told no unit to watch (PROXY_HOLD_UNITS unset) sees no start: when
an SGLang lane took the port after Kolibri, every read of its pool went vLLM's way and found no
vLLM gauge, so the guard kept the vLLM engine's pool, too large a limit for this engine. The
short cut holds only while the engine read last says it is vLLM, and the read that finds another
one drops what was read from the vLLM engine (invalidate_pool): the next read asks /server_info.
_server_info falls back to /server_info when no route is noted, since served_models can learn
the engine changed before a pool read does. Found in review, 2026-10-14, and in the review of
the fix the same day; the test fails on the commit before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the Kolibri lane (vLLM), every read of the pool began with /server_info and /get_server_info,
two 404s, and the hold's probe asked /server_info each time it looked. The proxy now notes that
the engine has neither, reads vLLM's own facts at once, and probes /health there, which on vLLM
generates nothing; any new engine (a restart, a lane switch) is asked again. The test fails on
v1.29.1 (four 404s for two reads; two now).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The production checks run after the update to v1.29.0 sent the key twelve ways through the
proxy, and "Bearer <key> " (a space after it) passed on a Qwen lane and got a 401 on the Kolibri
lane. The spaces around a header's value are not part of it (RFC 9110, 5.5) and SGLang reads it
so; the proxy forwarded the header as it came, and vLLM's own check, like the lane's middleware,
compares the value exactly. The proxy now forwards the client's value without the spaces and
tabs around it; two spaces inside are still refused everywhere. The tests' fake vLLM checks the
key as vLLM does, and the test fails on v1.29.0. Measured on the box with the new proxy beside
the production one: 24 of 24 answers as on the Qwen lanes, against 22 through v6.37.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The clients set up for the Kolibri lane send "none" for "off" (pi, opencode's none variant,
omp's minimal), and Kolibri's template takes it. The Qwen templates refuse it ("Unexpected
reasoning effort none", a 400), and the proxy let it through as a level SGLang's enum knows:
a client left on kolibri-1 broke on the next Qwen lane, against docs/clients.md's promise
that a client set up for one lane keeps working on another (found in review, 2026-10-14).
On SGLang, "none" (top-level or in chat_template_kwargs) is relayed as enable_thinking
false, the way those templates turn thinking off; on vLLM and on any doubt the body goes
as it came. It is decided again after a hold, with the rename. The test fails on the code
before for the Qwen lanes and passes for Kolibri on both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two findings of the review (2026-10-14), both reproduced. A pool read that failed on the
way to the engine dropped the lane's facts, the request went out with no engine noted, and
a client that left was handled as on SGLang: an /abort_request vLLM answers 404, then a
drain of up to DRAIN_MAX_S while vLLM kept generating; _open now reads which engine serves
when nothing says it. _shut_upstream took the answer's socket number and shut down a
duplicate of it: the pump can close the answer in between, and the number then belongs to
whatever socket opens next, which was shut down instead; the connection now keeps its
socket object (a closed one has no number left). Both tests fail on the code before. Two
more pin what the suite let mutate: the engine's middleware opens /health and /metrics
exactly, not /healthz or /metricsx, and a proxy that names no unit drops the vocabulary
when another engine names itself.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
route_model_name read the cached pool to learn which engine serves. One failed read of
/v1/models drops the names and keeps the pool, and the pool then named nothing: vLLM
answered 404 to every request under another name until the pool expired. The vocabulary
probe named "probe" until something had read the names, which vLLM refuses with a 404
before it looks at logit_bias, and the guard went 60 s without a vocabulary right after
every switch. Both now read the names (served_models, kept 600 s); with nothing answering,
the probe is not sent and the failure is kept as before. Two tests fail on the code before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in review and reproduced against a fake vLLM, each with a test that fails on the
proxy before it: a request held through Kolibri's boot went with its old model name
(the rename ran once, before the hold), and so did the first request after a switch
nobody asked about (the last lane's facts stayed 600 s); the rename now runs on every
attempt, after the unit's start is looked at. A client leaving a stream during its
prefill reached vLLM only with the first token: close() waited for the pump's read, so
the socket is shut down first, through the answer's own descriptor (urllib asks
Connection: close, and the connection gives its socket up). The engine a request went
to is noted when it goes, so a dropped fact no longer sends an abandoned Kolibri
stream down SGLang's /abort_request and drain. A unit that starts again drops the
vocabulary and the rid rule learned of the engine before. /invocations is renamed too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the reference box the Kolibri lane's first stream logged "this engine ignores
x-override-rid (start it with SGLANG_ENABLE_REQUEST_HEADER_OVERRIDES=1)": a wrong lead,
since on vLLM the rid is never used and closing the connection stops the request.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Kolibri lane runs vLLM 0.29.0, and four things the proxy assumed of SGLang are not true
there, each measured against the real engine on 2026-10-14:
- no /server_info: the pool is the kv_cache_size_tokens label of /metrics' cache_config_info
and the window /v1/models' max_model_len (without them every body past 256 KiB was held
as "not measured yet" for good);
- a model it does not serve is a 404: a body naming another model gets the served one, so a
client set up for one lane keeps working on this one (SGLang bodies are never touched);
- a closed connection stops the request (no /abort_request): closing replaces draining;
- the vocabulary probe needs the served name and reads vLLM's wording (128,000 tokens).
What was learned of one engine (vocabulary, x-override-rid) is dropped when another names
itself; System One says it needs a Qwen lane. PROXY_HOLD_UNITS names the Kolibri unit.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The canary was sent when the fast collector's last load read, seconds old, said idle: a
client's 77,887-token prompt that started in that gap had it queue behind a 58-second prefill
and time out, a failed probe the wedge rule counts and an abort the Traffic view counted
(reference box, 2026-10-11). The cockpit now reads the engine's load again right before the
probe and stays out when a request runs; a read that fails leaves the probe to go as before.
The engine's auth rule opens /health, /ready and /metrics by prefix; the proxy's door had
/health and /metrics, so /ready got 401 through the proxy and 200 from the engine. The door
opens /ready the same way (proxy v6.36); /readiness, not under /ready, still needs the key,
as at the engine. SECURITY.md and docs/clients.md updated.
Tests: the canary stays out for a client that started since the last read, and goes when the
read fails; /ready passes the door, /readiness does not. The first and the third fail on
v1.26.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The pool, the window and the names the proxy reads from the engine were kept 600 s and
dropped only by a request that found the engine gone. After a switch made while no request
came, a lane that boots in less than 600 s served its first minutes under the stopped lane's
facts: the 27B (about 7 min to boot on the reference box) refused every prompt past the
flash lane's 250,000 ceiling for up to 2.5 min, and /v1/systemone answered as the flash
(2026-10-08). The units PROXY_HOLD_UNITS names are now asked for their invocation id when
those facts are read, at most every 2 s, and a new one, which systemd gives every start,
drops them. A proxy that names no unit, or a systemd that does not answer, keeps them their
600 s. The hold tests' systemctl answers that question with ids that never change.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
sglang#36333 is about a request left running after its client disconnects; SECURITY.md,
docs/clients.md and a proxy comment gave it as the reason a prompt past the pool wedges
the scheduler. The wedge was measured on the reference box (2026-08-29).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Without the identity wall, the engine's key is the port's one gate (README), and a
request without it still had its body read whole and, when large, counted by the
engine on the proxy's own key before the engine's 401. The proxy now applies the
engine's own rule first (measured on the live engine: bearer in any case, one space,
the key exactly) and answers the engine's own 401, before the body and before an
Expect: 100-continue invitation; /health and /metrics stay open. The test harnesses
decide which key their proxy holds, whatever HOME holds: those that give it one
present it, as every real client does, and those whose clients send none give it
none (the CI's offline step gives HOME a key). The cockpit knows the new outcome.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Where the engine accepts a prompt past the share of its pool this guard lets through
(the 27B lane: 863,638 accepted, 794,552 usable, measured 2026-10-08), a body is
nominated by its bound, one byte a token, not by the 2.5 average that let digit-heavy
text through uncounted; nothing under 200 kB was looked at, whatever the pool. Where
the engine's window is under that share (the flash lane), it refuses past it itself and
the average nominates as before: counting there was measured at +115 ms for a lone
300 kB prompt and +1.65 s for eight at once. A body the engine cannot count is judged
as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a batch that mixes a request asking for token_ids_logprob with one that does not,
the served 27B build (v0.5.19) fills a bare list for the one that did not ask and
calls .tolist() on every entry: its scheduler dies (sglang#34719, open). Refused at the
top of a /generate body and in the parameters of /vertex_generate, the only places the
engine reads it; a value the engine treats as absent passes, the OpenAI routes are not
touched.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The admission slot was released on whatever _systemone_calls named at release time.
Rebound while a call was in flight (only tests do), the new door was credited with a
slot it never gave and served a call it had to refuse: the admission-cap test failed
about one run in five once every System One request read the pool. The call now gives
its slot back to the door it took it from; a deterministic test fails on every run
without that.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy writes its own Server and Date (send_response) and relayed
the engine's beside them: uvicorn's `server: uvicorn` and `date` came
next to the proxy's, two of each on every relayed answer, which RFC 9110
(5.3) does not allow. aiohttp refuses such an answer by default in
3.13.4 and in its strict mode since then, and a LiteLLM gateway in front
of the proxy failed with "Duplicate 'Server' header found." (issue #39).
The engine's two are no longer relayed (RESPONSE_DROP, as the cockpit's
agent relay already has). The headers of the requests sent to the engine
are unchanged, which adding the two to HOP, as the issue proposed, would
not have kept. tests/test_proxy_answer_headers.py reads the header block
of a relayed GET, a generation whole and streamed, and an error of the
engine: its four tests fail on v6.32, and four hand-made mutants (either
relay path, Date alone, every engine header dropped) are caught.
Checked on the reference box's flash lane: through v6.32 every relayed
answer had two of each (ten routes, /v1/responses included) and LiteLLM
1.104.0 under strict aiohttp gave the issue's error; through v6.33 none
had, and LiteLLM answered, streamed or not. Claude Code, opencode,
Hermes Agent and pi each read a file with a tool and answered from it
through both. The 29 test files that read keepalive-proxy.py pass.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGLang's /server_info repeats the engine's whole command line in
launch_command, the API key included, and the proxy took out only the
key fields (api_key, admin_api_key, at the top and in every internal
state). Behind the identity wall, a named client could read through the
proxy the one secret the wall keeps from it; without the wall the
caller already holds it.
Every string of the answer now goes through mask_secrets: the value of
--api-key, --admin-api-key and --ssl-keyfile-password, in any form a
command line gives it, and the engine's own key wherever it shows (not
looked for by value under 8 characters, which no real key is and which
would garble unrelated strings). ssl_keyfile_password joins the key
fields.
Found by the flash audit of 2026-10-03; checked on the reference box:
through the proxy the key was in launch_command and in no other answer
(/v1/loads, /v1/models, /metrics, /model_info). The fake engine now
answers as the real one does; the server-info test and two new ones
fail against v6.31.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SGLang sends a stream's status and headers with its first chunk, after
the queue and the prefill (_handle_streaming_request, in the images of
both lanes). The proxy relayed them when they came, wrote nothing
before, and did not watch the caller of a stream meanwhile. With eight
agents whose contexts outgrew the KV pool (2026-10-03), requests waited
past opencode's 300 s for headers; opencode gave up and sent them again,
and every request it gave up on stayed queued in the engine until its
turn, had its prompt computed for nobody and was aborted at the proxy's
first write: 704 in a night, 163 requests in the queue at the end.
Until the engine answers, the caller of a stream is now watched as the
caller of a non-streamed answer was (that watch's ending is shared, as
_end_upstream): its leaving aborts the request by rid where the engine
allows it and closes the upstream, which SGLang sees within 4 s. Past
KEEPALIVE_S from the request going out, the stream is opened (200 and
its headers, as a hold opens it) and role 1's keepalives go into it;
past MAX_SILENCE_S without the engine's first byte the request is
dropped, as a silent stream is. A quick answer stays the relay's,
headers and status included.
tests/test_proxy_engine_withholds_headers.py: 10 tests against a fake
engine that holds its headers back as SGLang does; 7 fail on v6.30.
Measured with the real opencode 1.18.32 and on the flash lane: see the
CHANGELOG entry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
omp's default dialect sends the effort twice, at the top of the request
and in chat_template_kwargs. SGLang takes the chat_template_kwargs copy
first (serving_chat.py pops it and sets request.reasoning_effort when it
is not None), but validates the top-level one against its own enum, so
the template's lean, omp's default level here, was a 400 on every
request (omp 18.4.9, 2026-10-01). The proxy now drops the top-level copy
when SGLang would refuse it and chat_template_kwargs names a level: the
level that applies is the one that would have applied. A null there,
which SGLang skips, is filled as an absent one is (the v6.18 move), and
a top-level level SGLang accepts is left alone.
Checked against the flash lane, streamed and not: a top-level lean beside
a chat_template_kwargs lean, high or null, and a value SGLang refuses
beside lean, were a 400 through v6.29 and are answered through v6.30;
the five other shapes (lean alone, at the top or in chat_template_kwargs;
high beside lean or null; a refused value alone) answer the same through
both. omp 18.4.9 in its default dialect: a 400 through v6.29, "pong"
through v6.30.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The proxy's fuzz suite failed about one run in ten on its relay
simulation, on v1.20.5 already (2 of 15 runs; 1 of 15 on v1.21.0), and
it failed the check of pull request #30. A caller that closed before the
last byte of its body left the proxy a short read, and the proxy sent
the engine what had come: of 300 requests closed with a reset at once
after sending, 11 were read short and sent on all the same. No engine
can serve that, so nothing was generated from one, but no request
should go out so: the proxy now ends it "CLIENT GONE before its body"
and asks the engine nothing.
The suite's own engine also fell over a body cut short, which is what
an engine sees when the proxy closes its side as a request goes out,
its caller gone, by design: it now counts that as the request it never
had, and still requires that a caller who left never gets a whole
answer. Over 30 runs each the simulation no longer fails, on either
proxy. tests/test_proxy_short_body.py pins the short read; two of its
three tests fail on v1.21.0.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Issue #26 reported a 27B engine dying about once a day with "CUDA error:
operation not permitted", systemd starting it again 17 s later, and the
fear that the restart lands in the window sglang#40948 blames for a DGX
Spark frozen 9.5 h. Measured on the reference box: a crashed engine's
memory is back 2 to 5 s after it dies, about 15 s before the restart.
engine-preflight.sh runs before every engine (27B, flash, image, video)
and refuses a start while what is left of an engine holds GPU memory,
while the driver holds more than 16 GiB that no process accounts for,
or while nvidia-smi does not answer; systemd tries again every 15 s.
The proxy (v6.28) holds a request while its engine comes back, through
a restart's stop half too, up to 1200 s: a streamed one gets its 200
and the keepalives at once. On a 503, opencode gave up after 151 s and
Claude Code after 325 s; both wait on a held stream (900 s measured).
An engine's mid-stream cut is passed on as a cut: the error event sent
in its place made Claude Code retry without a stream, give up on it
after about 330 s, and end with no answer.
The cockpit restarts an SGLang server left without its scheduler, once
it has been so for 2 min (COCKPIT_ZOMBIE_RESTART), tells one crash of a
serving lane from a boot that keeps dying, and says why a start waits
or was refused.
Tested end to end on the reference box: the flash lane's server sent
SIGQUIT under the real opencode and Claude Code, twice. The runs found
four faults the unit tests could not (a zombie probe docker refused, a
watched boot read as a boot again, a restart that ended the waits, the
cut's error event), each fixed with a test that fails without the fix.
After 632 to 1,068 s held, both clients got their whole answers.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The review's sub-agent reports were each verified by hand against the
installed SGLang before anything was changed; what they got wrong was
dropped.
keepalive-proxy:
- the guards judged the raw JSON value, but the engine's pydantic models
coerce 999999, "999999" and 999999.0 to the same int before the
scheduler runs, so a crash shape typed as a string sailed through the
ceiling and the token-id refusals (_engine_int, checked against the
installed build field by field);
- /vertex_generate also judged parameters.sampling_params, which the
scheduler spreads into its SamplingParams (stop_token_ids and n were
reachable there; top_logprobs_num is not, and the guard does not
over-refuse it).
- the version moves to v6.27 and says what the second pass found.
dashboard:
- num_inference_steps is bounded server-side on the video lane (1 to 100,
as the image lane already does) instead of trusting the page's slider;
- the stop message no longer promises a 5 s cut the unit never makes (it
waits up to 60 min); the curl preview no longer prints a task the
server refuses;
- the video lock hand-off now carries the timeout with the call that
timed out instead of re-reading a global a test could already have
restored; the vacuous download assertion in the async test is now a
real one.
installers:
- install-image.sh starts the lane that was serving again after its smoke
test even when that lane was the video or the llamacpp one;
- install-video.sh refuses a VIDEO_BIND=0.0.0.0 that would put a keyless
generator on every interface.
Every change is held by a test that failed before and passes after; the
full offline suite (proxy, dashboard, installers) and ruff F,E9 are
green.
S4: a key spelled with a JSON \u escape ("\u0074op_logprobs") carried
none of the bytes the guards scanned for, so the ceiling and the token-id
refusals were skipped; any escape in the body now forces the parse.
S5: the sampling and logprob guards also cover /v1/responses, /invocations
and /vertex_generate, read input_ids as a batch of lists, read
sampling_params as a list, read prompt as token ids on /v1/completions,
and the oversize guard reaches /generate and the other non-/v1/
generation routes.
S6: the TLS handshake no longer runs in the accept loop (one silent
connection parked every other client behind its timeout); it now runs in
the connection's own thread on its own budget, and a handshake that dies
leaves one journal line, no traceback.
Each change is held by a test that failed before and passes after; the
full offline suite and ci-local are green.
./install.sh --with-video adds text-to-video with joint video-and-audio
(MiniMaxAI/MiniMax-H3, pinned rev), driven like the other three lanes:
switcher, stop, start. The unit serves the cookbook's MiniMax-H3 recipe
exactly as upstream wrote it (fl2va variant, no placement flags, loopback
behind the cockpit's Video tab, which holds the async call to completed
and refuses outside the cookbook's bands). Measured on the reference box:
boot 11 min, 4 s 480P in 592 s with download proven (h264 + aac stereo,
inspected), fl2va conditioning proven from a keyframe.
Each addition comes with the tests that hold it; the whole offline suite
and ci-local.sh are green with and without it.
/v1/messages/count_tokens no longer meets the size guard (it generates nothing, and a client
counts to learn the conversation no longer fits). The pool read waits up to 20 s instead
of 4: /server_info waits on a scheduler busy with a long prefill chunk, and the timeout
made a big prompt a false 503. A refusal sent before the body was read (413, 401) is
followed by a half-close and a bounded drain, so the kernel's reset no longer destroys it,
and Expect: 100-continue is refused before the body is sent. log() escapes line breaks and
controls, so a client's pattern cannot write lines of the proxy's own shape. A System One
answer falls back on the resolved lane name, not the caller's alias.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>