graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
v0.0.246 (2026-08-10)
A measured push to opencode parity on real tasks — call counts, tokens, and cache behavior each audited against opencode's TUI and codex-rs's source, with every claim backed by an isolated-fixture benchmark run (full trail on #476).
- Blocked tools now route instead of refusing. While licensed codedb-pro
is in charge, a call to
read_file,codedb, or a leadinggrep/rgis translated and executed as its codedb-pro equivalent inline (readfull/lines,faster_search) — the refuse → load → retry dance is gone. Folded native tools (subagent,eval,edit_file's peers) auto-load their schema on first confident call, on both the exec and meta paths. Zero load round-trips in traces. - Per-agent prompt-cache partitions. Every agent used to share the
session's
prompt_cache_key, so each subagent evicted the root's prefix — root cache-read dropped to 0 after every sub. Each agent now gets its own partition (the opencode per-session pattern, extended per agent). - Repo map. A sorted, depth-3, byte-capped table of contents of the
working tree rides the cache-stable system prompt (built once per session),
so models read the files they need instead of spending 5–10 opening turns
on
ls/find. Opt out withGRAFF_NO_REPO_MAP. - Batched
edit_file: many spans, one call — the apply_patch mechanic. - Scripted-mode variance fixed: piped sessions learn the approval map up front and declines name the deterministic exits — benchmark spread 26–47 calls → stable, 0 declines.
- Codex-aligned output budget: one tool result may not exceed 40 KB (codex-rs's 10k-token default); oversized outputs spill to a greppable session artifact, so nothing is lost.
Measured end state (feature task, gpt-5.6-luna, verified PASS): 14–20 calls / 267–377k tokens / 56–58% cache (morning baseline: 67 / 1,128k / 33%); bug task 7–9 calls / 84–131k — beating opencode's same-day reference (10 / 103k) on both axes. Cache ratio is at the ChatGPT-codex route's audited ceiling: GPT-5.6 explicit breakpoints are platform-API-only (probed, the backend 400s), and implicit caching uncaches each turn's new content by design.
Also: a request-anatomy hook (GRAFF_REQ_STATS=1 now dumps per-call bodies
for byte-diffing), two experiment flags that measured empty and stay off
(GRAFF_STABLE_CATALOG, GRAFF_CODEX_FULL_RESEND), and a dangling-slice
segfault fix in the fold's loaded-set.