Skip to content

v0.16.0

Choose a tag to compare

@github-actions github-actions released this 18 Nov 17:59
· 30 commits to master since this release

This release stops dialing fresh for every exchange — the HTTP transport gains an idle connection pool with keep-alive on by default, and the reasoning echo gains a fourth mode that sends the model only the reasoning from the current turn.

The connection pool and keep-alive

The transport learns to hold sockets open between exchanges: nm_connection_acquire looks up a matching idle connection (same TLS mode, host and port) inside the keep-alive window, and nm_connection_release shelves or closes it on the verdict the response itself makes — HTTP/1.0, Connection: close and a mid-stream drop never reuse (16f5ebc). The policy rides the new keepalive key (default on) with keepalive_idle for the window, and a server's Keep-Alive: timeout hint tightens the window per connection with a 2 s margin (ed6d77f, 16f5ebc). One idle connection is kept per key, older ones closed on a same-key release and the oldest evicted at four slots; the blocking transport is excluded from the pool by construction, and every socket in it is close-on-exec (d2ccbac). On TLS the second exchange rides the shelved, already-handshaken connection — one accept, two exchanges, no second handshake ever runs (33b15c9).

A pool has one failure a fresh-dial-per-round client never sees: the shelved socket was half-dead the whole time, its FIN in flight, and the first send into it succeeds. The redial answers that at the two seams a staleness can actually surface — the head pump's zero-byte EOF and a hard send failure on a shelved connection — by closing the channel, minting a new connection id, and re-entering CONNECTING with the retained request buffer draining after the fresh handshake, all on the same NmConnection so callers see only a would-block (c490660, 3b11bdf). One redial per exchange: a failure after the first response byte stays final, with no redial line and no loop (79d4954). The behavior is pinned against canned servers that serve two exchanges on one accept, driven by the fake clock so the idle window is moved past rather than slept through (66345f5).

The evidence, measured

Every provider this app talks to held a connection open past 120 s of idle on the live wire: ollama.com's Google Frontend and Cloudflare's edge send no Connection field at all and still reuse, ollama v0.40.16 local rode the app's whole chain — /v1/models, /api/tags, two /api/show, two chat rounds — on one connection, and a streamed chat POST is reusable on both opencode and ollama (ed6d77f, 6695ca4). The live proof for this build, ollama:cloud with a tool turn: three exchanges on one conn id, no second TLS handshake, no redial lines, where keepalive off reproduces the fresh-dial-per-round shape from the same key (ed6d77f). The provider API docs each carry their measured persistence section, and README lists both keys.

Transport seams underneath

The pool's foundation is a round of transport hardening: strict framing enforced in the response head, one author for the chunked terminal, one head pump, and the dial collapsed into one function (a018a5e, 20991dd, 8413826, ff35dd9). Writes into a closed peer answer EPIPE instead of dying, under a SIGPIPE guard that keeps the process alive for the error path (36437d6, 6359728), and the request queue serializes one exchange at a time (57b14e9). Every canned test server now answers Connection: close unless a test asks otherwise, so the suite is immune to the keepalive flip (9290073, 18e84ad).

The turn-scoped reasoning echo

The reasoning echo vocabulary gains a fourth mode, turn: echo the trace inside the active turn and strip everything older — an old tool-call message keeps reasoning_content as the empty-string presence placeholder, an old plain answer drops the field, and signature_echo takes the same mode (a2efddc). The vendors' spellings fold in as aliases: current, current-turn, current_turn and interleaved all canonize to turn, and /config reports the canon (bb3f7d1). The turn boundary is the real user message, recorded before it is appended rather than derived from roles, because round-budget nudges, state reminders and tool-image fan-outs are user-role messages that live inside a turn; the strip is one-way, and within a turn every request still extends the previous one byte-for-byte (58c216f). The built-in default stays all, and the first request that carries a field freezes the mode as before; README's echo row now states which setting to leave on which host, with turn a free byte saving on interleaved-native models and off the escape hatch (f777a50).

Dependencies

The coffer pin moves from v0.12.0 to v0.13.0 in the linux and macOS checkouts: v0.13.0 adds DECSCUSR cursor styling and xterm OSC 10/11/12 dynamic colors under the vocabulary the e2e harness already uses, both additive. boba stays at v0.11.2.

Full Changelog

v0.15.2...v0.16.0