graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
fix: -p first_out was the call-2 stdout pulse
Cursor Agent706db7619e6b
diff --git a/docs/adr/0046-flash-omits-default-effort.md b/docs/adr/0046-flash-omits-default-effort.mdindex 5fe6b09a..37a237fb 100644--- a/docs/adr/0046-flash-omits-default-effort.md+++ b/docs/adr/0046-flash-omits-default-effort.md@@ -40,5 +40,25 @@ interactive-length essays on every `-p` turn.- Flash SWE first-token wait is gateway TTFT, not a thinking tax.- `/effort` remains the only way effort moves (ADR / `effort_route`:no auto-flip).+- `-p` writes `calling <model>` to stderr at start and drops the+ call-2 stdout pulse. Eval `first_out` is no longer "time to model+ call 2"; stdout stays the answer.- Revisit if a named flash model needs default thinking — pin it inthe catalog, do not restore a global medium default.++## Confirm (2026-08-29, after this revision)++`run-20260829-041235.jsonl`, Codegraff `glm-5.3-flash`, `--suite swe+-j 6`. No `reasoning_effort` on the wire. Local boot is 7ms; a+`pong` one-shot is 6.1s / 10 out (gateway TTFT). Pi `first` 0.6s is+still the JSONL `session` line.++| | pass | wall | first | out |+|---|---:|---:|---:|---:|+| ADR 0045 | 3/6 | 1353s | 6.9s | 15k |+| after (thinking off) | 3/6 | 1247s | 6.7s* | 21k |++\*first was the call-2 stdout pulse. `validated` 164s / 46k / 10 →+**57s / 11k / 4**. `json-stream` and `cookie-store` still SIGKILL at+300s after that pulse. `label-sort` finished (174s) but still fails+the hidden check. Do not steal Pi's heap.diff --git a/src/session_run.zig b/src/session_run.zigindex acbf4f3b..d755e66e 100644--- a/src/session_run.zig+++ b/src/session_run.zig@@ -125,6 +125,9 @@ pub fn runOneshotPrompt(gpa: Allocator, io: Io, arena: Allocator, root: *agent_mroot.in = null; // gate: deny instead of prompt; ask_user: self-decideroot.out = null; // tool progress → stderr; stdout carries only the answerroot.stream_quiet = true;+ // stderr only: same class of "process is live" as Pi's JSONL session line.+ // Eval first_out used to wait for the call-2 stdout pulse (ADR 0046).+ std.debug.print("calling {s}\n", .{root.provider.model});const ultracode_msg = try shapes.applyUltracodeSteering(arena, prompt_text, prompt_text, prompts.ultracodeActive(root));if (ultracode_msg.explicit) {tracer.note("ultracode", prompt_text[0..@min(prompt_text.len, 120)]);diff --git a/src/turn_chrome.zig b/src/turn_chrome.zigindex db90078d..d8fa0412 100644--- a/src/turn_chrome.zig+++ b/src/turn_chrome.zig@@ -39,11 +39,16 @@ pub fn emitRetryNotice(io: Io, class: []const u8, attempt: usize, max_attempts:/// Count this inner-loop request, pulse from call 2, optionally pause if a/// non-zero cap is set. Returns pause text or null to proceed. Never pauses-/// when the cap is 0.+/// when the cap is 0. `-p` / unattended skip the pulse: it was landing on+/// stdout and eval `first_out` was "time to model call 2", not boot (ADR 0046).+pub fn shouldPulseTurn(unattended: bool, json_mode: bool, sub: bool, call_n: u64) bool {+ return call_n >= 2 and !sub and !json_mode and !unattended;+}+pub fn beforeRequest(self: *Agent) !?[]const u8 {self.model_calls_this_turn += 1;const cap = max_turn_model_calls;- if (self.model_calls_this_turn >= 2 and !self.sub and !main_mod.json_mode) {+ if (shouldPulseTurn(main_mod.unattended, main_mod.json_mode, self.sub, self.model_calls_this_turn)) {var buf: [120]u8 = undefined;const text = formatTurnPulse(&buf, self.model_calls_this_turn, cap, self.tool_calls_this_turn);if (text.len > 0) tool_pulse.emitNotice(self.io, "{s}", .{text});@@ -78,3 +83,11 @@ test "formatTurnPulse omits a denominator when the cap is unlimited" {try std.testing.expectEqualStrings("· turn still going · model call 3 · 11 tools", formatTurnPulse(&buf, 3, 0, 11));try std.testing.expectEqualStrings("· turn still going · model call 3/64 · 11 tools", formatTurnPulse(&buf, 3, 64, 11));}++test "one-shot and --json do not pulse turn chrome onto stdout" {+ try std.testing.expect(shouldPulseTurn(false, false, false, 2));+ try std.testing.expect(!shouldPulseTurn(true, false, false, 2));+ try std.testing.expect(!shouldPulseTurn(false, true, false, 2));+ try std.testing.expect(!shouldPulseTurn(false, false, true, 2));+ try std.testing.expect(!shouldPulseTurn(false, false, false, 1));+}