ac4af582301a4e8a29245dbba767eba31334ddf9
5
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8c733bb362 |
gateway: a bare JSON error line in an event stream is the vendor's error
zRain (Discord #feedback, Windows, v0.1.3039/v0.1.3041) asked
antigravity/gemini-4-argon high. Code Assist answered 200
text/event-stream, a few thinking events, then ended the body with
{"error":{"code":400,"message":"Request contains an invalid argument.","status":"INVALID_ARGUMENT"}}
on a line of its own, no "data:" before it. readSSEAlive and the
passthrough sniffer skip any line that is no SSE field, so the stream
ended with no finishReason and the agent was told "Antigravity: the
reply ended before it was complete" instead of Google's 400.
- sse_bare.go: bareErrors hands such a line (Google's shape, a list
of one, pretty-printed over several lines, OpenAI's {"error":…},
Anthropic's {"type":"error"}) on as the data event it means. Every
other line goes byte for byte, a line under way at once; only a line
starting { or [ waits for its end (held up to 1MB). eventStream wraps
the body with it (passthrough, translated stream and whole reply,
continuation, search), and readSSEAlive wraps every other reader.
- codeassist.go and carriedError take the status the error names
(namedStatus, #4855), so a whole reply's error goes out at 400.
- continuation.go notes that status for routing (namedStatusHeader);
refusal events and Antigravity's own turning away are left as they
were.
- gateway.go: a reply broken off by an error frame that names a 4xx
retryable() calls the request's fault rests nobody, as that 400 does
before the 200.
Plugins: antigravity-cloak only rewrites the request, reads no stream,
so nothing to change there.
Run (mote, at this tree on
|
||
|
|
68ab4c06da |
gateway: a handed-off gateway answers a kept-alive connection's next request rather than closing it under the agent (#3451)
TestRestartHandsTheGatewayOver went red on ubuntu CI at |
||
|
|
e8e317d419 | gateway: a Chat Completions keepalive is a comment line alone, with no blank line after it — Crush (openai-go v2.7.1) failed every reply through magpie that had a keepalive in it with "Agent processing failed: failed to start agent processing stream: unexpected end of JSON input": its SSE reader takes every blank line as an event, data or not, and parses the empty data as JSON. The comment and blank line were ": keepalive\n\n"; now ": keepalive\n", which every reader skips (a blank line with no data is no event in the SSE spec, and openai-go's own reader skips a comment line). TestTranslatedStreamKeepsClientAlive now also wants no event without data (old code: 25). Found while testing every agent CLI through a sandbox magpie: crush run on magpie/codex/gpt-6-astra failed and passes now; claude, codex, gemini, opencode, pi, goose, droid, grok, cline, omp, agy and commandcode answered too. go vet, builds (darwin, GOOS=linux, GOOS=windows) and go test -tags nogui -count=1 ./... under a temp HOME pass but TestProvidersAnswerWhileListsComeIn, a timing test that fails on main without this change too. | ||
|
|
a97643bcc8 | gateway: a translated or relayed stream keeps its client alive while its provider is (#436, congee949: Chat → Responses dropped the upstream's ": keepalive" and Codex hit "idle timeout waiting for SSE" on a live connection) — a reply magpie translates was read event by event and written only when an event had something for the client, so a provider's SSE keepalives, and events with nothing to translate, reached no one, and a reply that thought quietly for five minutes ended in Codex's idle timeout and a retry. Now, whenever the provider is heard from and the client has heard nothing for a second, magpie sends the client a keepalive in its own protocol: response.in_progress again on Responses (Codex's timeout counts events, never a comment — a sandboxed codex 0.159.2 on a fake provider sending only comments timed out, one sending response.in_progress didn't), ping on Anthropic (as Anthropic does; Claude Code's watchdog counts it), an SSE comment on Chat Completions, nothing on Gemini (Google's SDK can't read past one). A provider that sends nothing at all is not covered for, so a dead connection still ends at the client's timeout. A reply relayed from the Claude subscription's bridge, Kiro, Cursor, Devin, search, Qoder, Zed or Command Code is kept alive every 15s while it goes quiet, for up to 5 minutes since its last event. Native passthrough is unchanged, and prompts and headers are unchanged. The routing trace no longer drops a request still going for the 60 finished after it: the oldest finished ones go first, unless more than 120 are going at once. TestTranslatedStreamKeepsClientAlive (the issue's repro: 20ms keepalives, 150ms idle timeout; Chat → Responses, Chat → Anthropic, Responses → Chat), TestRelayKeepsClientAlive and TestTraceKeepsInflight fail without the change; TestTranslatedSilenceStillTimesOut keeps a silent provider uncovered. In a sandbox CODEX_HOME, codex exec through the gateway on a provider sending 6s of keepalives with stream_idle_timeout_ms 2500 answers, and without the change fails with idle timeout waiting for SSE. go vet, go build -tags nogui (darwin, GOOS=linux), GOOS=windows go build, go test -tags nogui ./... pass. | ||
|
|
8fb93f8fc2 |
Make dial a local LLM gateway with preset providers and one catalog
dial now serves OpenAI chat completions, OpenAI Responses and the Anthropic Messages API on 127.0.0.1:3425 and forwards each request to the vendor that serves the model, translating between the APIs when the vendor speaks a different one (streaming, tool calls and reasoning included). Every agent points at that one URL; models are spelled provider/model. Providers are added from presets (vendors, relays, local servers) with just an API key, or as custom OpenAI/Anthropic-compatible endpoints. Keys live in ~/.config/dial/providers.json; nothing is read from the shell environment. Each provider chooses which of its models to expose. Agents get gateway wiring instead of vendor-specific tables: Claude Code via the env block, Codex via a dial model provider plus a model catalog file, OpenCode/Pi/Crush via a dial provider entry; native settings are stashed and restored when a native model is picked again. The Providers page shows the gateway, each provider with the agents on it, an inline editor with model chips, and an add sheet of preset tiles. CLI: dial presets | providers | provider add|key|models|test|rm | models | serve. |