Skip to content

graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs

Python

merge: origin/release/v0.0.285 with native follow-tail and queue

Rach Pradhana2472789a9ba
diff --cc CHANGELOG.md
index 0112eacf,05ac97c8..1bdb7be8
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -10,18 -10,24 +10,24 @@@ The release workflow uses a tag's secti
hand-written `docs/releases/<tag>.md` wins if present), so keeping this file
current is part of cutting a release.
-## v0.0.285 (2026-09-01)
+## v0.0.285 (2026-09-03)
-- Next cut after tagged [v0.0.284](docs/releases/v0.0.284.md). No tag
- until asked.
-- `#717` (yxlyx): Codex WS `type:error` retires the socket immediately
- and keeps a one-request marker for the bounded diagnostic. Re-anchor
- only when the rejected body actually sent `previous_response_id`.
- Unparseable Responses envelopes no longer copy raw bytes into
- `last_api_error`. Follow-up hardening for `#692` / `#693`.
-- TUI mid-turn steer / `/btw` now bakes composer `[Image #N]` chips into
- the queued payload as `@[path]`. Previously only the typed text was
- queued, so the follow-up turn dropped the pixels.
-- Native + TUI: tools stream with the answer instead of landing as a
- wall on top. Native pins the scroller (no WKWebView jitter),
- interleaves chips at the text cursor, and collapses a settled batch
- to “Explored N”. TUI drops the Thinking row once tokens arrive and
- paints the live stream as the reply; codedb folds as “Looked up N
- items”. `scrollback.zig` stays under 600 via `TUI/livetail.zig`.
+- Native transcript follow-tail only while the reader is at the bottom.
+ Scrolling up mid-stream no longer yanks the thread (#724).
+- Follow-ups typed while a turn is running queue and drain in order when
+ it ends. The composer stays usable; stop stays on an empty draft.
+- Native tools interleave with the answer instead of stacking above it;
+ settled tool batches fold; ACP patches paint once per frame.
+- `#721`: `workspace` switch stars and reports the process cwd.
++- `#717`: Codex WS `type:error` retires the socket immediately and keeps
++ a one-request marker for the bounded diagnostic. Re-anchor only when
++ the rejected body actually sent `previous_response_id`. Unparseable
++ Responses envelopes no longer copy raw bytes into `last_api_error`.
++- TUI mid-turn steer / `/btw` bakes composer `[Image #N]` chips into the
++ queued payload as `@[path]`.
+- TUI streams the live answer instead of a Thinking placeholder while
- tokens arrive.
++ tokens arrive; codedb folds as “Looked up N items”.
+- 284 stays published as-is. This is not a retag.
## v0.0.284 (2026-09-01)
diff --cc docs/releases/v0.0.285.md
index 0be9ae9a,fc0f1948..eca03c24
--- a/docs/releases/v0.0.285.md
+++ b/docs/releases/v0.0.285.md
@@@ -1,86 -1,64 +1,108 @@@
-# v0.0.285 (2026-09-01)
+# v0.0.285 (2026-09-03)
-Next cut after [v0.0.284](v0.0.284.md) merged to main. No GitHub tag
-until asked. Download / notarization ids land after the build.
+Next cut after [v0.0.284](v0.0.284.md). The headline is the native app
+behaving like a chat you can actually read: scrolling up while the
+agent is writing no longer yanks the transcript, follow-ups typed
+during a turn queue instead of vanishing, and tool rows land in the
+answer instead of as a wall on top.
-## Codex WS error-frame recovery (#717)
+284 stays published as-is. This is not a retag.
+
+## What this cut is
+
+graff is still one static Zig binary that turns the AI subscriptions you
+already pay for into an agent on your machine — same `Agent` type on the
- line REPL, the fullscreen TUI, `graff acp`, and the native GUI. 285 is
- the native/TUI polish that landed after the 284 tag:
++line REPL, the fullscreen TUI, `graff acp`, and the native GUI. 285
++closes the gaps those surfaces hit after the 284 tag:
+
+- scrolling the native transcript during a stream was impossible — every
+ token pinned the viewport to the tail
+- sending a follow-up while a turn was running was a no-op
+- tool chips rendered as a stack above the answer
+- `workspace` switch could star the wrong tree and report a stale cwd
++- a Codex WS `type:error` could leave a dead socket and an unbounded
++ diagnostic
++- TUI steer / `/btw` dropped composer image chips
+- the TUI hid the live answer behind a Thinking placeholder
+
+Those are all closed.
+
+## Scroll away while it writes (#724)
+
+The native thread followed the tail with a large near-bottom magnet, so
+a short scroll never escaped — the next token jumped you back. Follow
+now pins only while the reader is actually at the tail. Scrolling up
+pauses it; returning to the bottom resumes. The pin uses the scroller
+offset, not `scrollIntoView` (that realigned the whole WKWebView every
+frame).
+
+## Queue a follow-up while a turn is running
-yxlyx's [#717](https://github.com/justrach/codegraff/pull/717), replayed
-onto this tip (its original base was 283-era `main`). `#692` / `#693`
-already treat a generic WebSocket `type:error` as a terminal API
-response. Three edges were still loose:
+The composer stayed disabled for the whole turn, so the next prompt was
+dropped. It now stays open. Enter with text queues the line (shown above
+the bar, removable). Queued prompts drain in order when the turn ends.
+An empty draft still shows stop.
-- The transport kept the dead socket until the Responses parser ran, so
- a lower-level caller could reuse it.
-- Chain recovery keyed off retained `codex_prev_id`, even when the
- serialized body had omitted `previous_response_id` (property change
- or full-resend experiment).
-- An unparseable Responses envelope was copied into `last_api_error`,
- which can echo request or authentication-adjacent bytes.
+## Tools in the answer, not a wall on top
-A short-lived `ws_api_error_pending` marker separates transport cleanup
-from later formatting: the socket closes on the error frame, and the
-parser still traces a bounded diagnostic. Re-anchor now requires the
-rejected wire body to contain `previous_response_id` *and* a recognized
-chain error (`shouldReanchorRequest`). Unparseable bodies use the same
-`failureDiagnostic` path as structured provider failures.
+Tool chips and text now follow the wire order instead of dumping every
+tool first. Settled batches fold; the live row stays open. ACP patches
+coalesce to one paint per frame so a long thread does not re-parse
+every settled markdown block on each token.
-Generic errors stay terminal. Only a recognized chain error on a
-request that actually used the chain rebuilds.
+## Workspace switch reports the process cwd (#721)
-`agent.zig` stays at the 600-line ceiling: the new field replaces a
-tightened scratch-arena comment.
+`workspace` could star a tree the process had not entered, and the
+status line could disagree with cwd. Switch now compares real paths and
+reports the process cwd after enter.
+
++## Codex WS error-frame recovery (#717)
++
++`#692` / `#693` already treat a generic WebSocket `type:error` as a
++terminal API response. Three edges were still loose: the transport kept
++the dead socket, chain recovery keyed off a retained id even when the
++body omitted `previous_response_id`, and an unparseable envelope could
++copy raw bytes into `last_api_error`. The socket now closes on the
++error frame; re-anchor requires the rejected body to contain
++`previous_response_id` and a recognized chain error; unparseable bodies
++use the same bounded diagnostic as structured provider failures.
+
+ ## TUI steer carries image chips
+
+ A follow-up typed while a turn is running (`Enter` to queue, or `/btw`)
-copied only `input.getValue()`. Composer chips live on `Model.images`,
-not in that string, so the queued line was text-only and the next turn
-never staged `@[path]` pixels. Queueing now prefixes the same `@[path]`
-markers a normal send uses, clears the chips, and an image-only Enter
-queues the chip instead of treating empty text as “force interrupt”.
++used to copy only the typed text, so composer chips never reached the
++next turn. Queueing now prefixes the same `@[path]` markers a normal
++send uses. An image-only Enter queues the chip instead of treating
++empty text as interrupt.
++
+## TUI live answer
-## Tools stream with the answer
+While tokens arrive, the TUI shows the live answer instead of a
- Thinking placeholder. `codedb` rows use the lookup family so they are
- not a blank Read chip.
++Thinking placeholder. `codedb` rows fold as “Looked up N items”.
-Folded from `main` after the 285 branch (`0fb41c0`, `1632b0d`).
+## Tests
- Suite floor stays the 284 ratchet. Native follow-tail and prompt-queue
- helpers are covered in the native unit suite.
-On the native app, tool chips used to stack as a wall above the
-reply, and `scrollIntoView` jittered WKWebView. The thread scroller
-is pinned; chips interleave at the text cursor they landed on; a
-settled batch collapses to “Explored N”; markdown list numbers stay
-with the source.
++Suite floor is **1909**. Native follow-tail and prompt-queue helpers
++are covered in the native unit suite. This fold also adds the #717
++re-anchor case (rejected body must have sent `previous_response_id`).
-On the TUI, once tokens arrive the pending Thinking row goes away and
-the live stream paints as the assistant reply. `codedb` folds as
-“Looked up N items”. Live-tail helpers moved to `TUI/livetail.zig` so
-`scrollback.zig` stays under the 600-line ceiling.
+## Downloads
-## Tests
+All six CLI archives, the curl installer, and checksums:
+
+| File | Platform |
+|---|---|
+| [graff-aarch64-linux.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-aarch64-linux.tar.gz) | Linux arm64 |
+| [graff-aarch64-macos.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-aarch64-macos.tar.gz) | macOS Apple Silicon |
+| [graff-aarch64-windows.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-aarch64-windows.tar.gz) | Windows arm64 |
+| [graff-x86_64-linux.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-x86_64-linux.tar.gz) | Linux x86_64 |
+| [graff-x86_64-macos.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-x86_64-macos.tar.gz) | macOS Intel |
+| [graff-x86_64-windows.tar.gz](https://github.com/justrach/codegraff/releases/download/v0.0.285/graff-x86_64-windows.tar.gz) | Windows x86_64 |
+| [install.sh](https://github.com/justrach/codegraff/releases/download/v0.0.285/install.sh) | curl installer |
+| [SHA256SUMS](https://github.com/justrach/codegraff/releases/download/v0.0.285/SHA256SUMS) | checksums for the six archives |
+
+```bash
+curl -fsSL https://github.com/justrach/codegraff/releases/download/v0.0.285/install.sh | bash
+```
-This fold adds `shouldReanchorRequest requires a rejected
-previous_response_id request` and tightens the `#692` reuse case
-(socket is null, marker is set, transport ladder is untouched). The
-`#402` source pin now covers the redacted unparseable path. Suite
-floor is **1909** (this cut's suite count).
+GitHub also attaches the usual source zip/tarball for the tag.
diff --cc src/cli.zig
index 8675bfbd,453d69c6..022b121f
--- a/src/cli.zig
+++ b/src/cli.zig
@@@ -22,11 -22,10 +22,12 @@@ pub const changelog_text
\\What's new
\\──────────
\\0.0.285
+ \\ • native transcript stays put when you scroll up mid-stream; return to the tail to follow again (#724)
+ \\ • follow-ups typed while a turn is running queue and send when it ends
+ \\ • native tools land in the answer, not as a wall on top; settled batches fold
+ \\ • workspace switch stars and reports the process cwd (#721)
- \\ • TUI streams the live answer instead of a Thinking placeholder
+ \\ • Codex WS type:error retires the socket immediately; last_api_error stays bounded (#717)
- \\ • chain re-anchor only when the rejected body sent previous_response_id
+ \\ • TUI steer / /btw queues composer image chips with the text, not text alone
- \\ • tools stream with the answer (native chips + TUI live reply; codedb “Looked up N”)
\\
\\0.0.284
\\ • ACP turns stage GUI @[image] attachments as native vision blocks — pasted images reach the model