Skip to content

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

Python

fix: /never picker with two confirms, wait_ms always waits for exit

Cursor Agentd91030734006
diff --git a/AGENTS.md b/AGENTS.md
index ddcd04b1..27d1f0d5 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -72,7 +72,7 @@ Install the tracked hooks once, and the checks run themselves:
scripts/install-hooks.sh
```
-That points `core.hooksPath` at `.githooks/`, whose `pre-push` runs **tier 1** of the internal eval set: `zig fmt`, the 600-line ceiling, test reachability, `zig build`, the unit suite plus a count that may grow and never shrink, the named goal/loop/todo invariants, and SDK drift. It is deterministic and offline (no provider calls, no network, no spend) and takes about 20 seconds warm. A push that only touches docs skips it.
+That points `core.hooksPath` at `.githooks/`, whose `pre-push` runs **tier 1** of the internal eval set: `zig fmt`, the 600-line ceiling, test reachability, `zig build`, the unit suite plus a count that may grow and never shrink, the named goal/loop/todo invariants, SDK drift, plus the TUI / tuiguard legs. It is deterministic and offline (no provider calls, no network, no spend). A warm `fmt`/`reach`/`sdk` subset is seconds; a post-`src` change rebuilds zig and runs the PTY probes, which is minutes (see #641). Prefer `scripts/eval-tier1.sh --only <check>` for a local edit. A push that only touches docs skips it.
```bash
scripts/eval-tier1.sh # run it by hand
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 90f016dc..f92152e8 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -18,9 +18,15 @@ current is part of cutting a release.
- `graff acp` emits mid-turn `session/update`s for thought, text, and
`tool_call` / `tool_call_update` (ADR 0032). Protocol version stays 1.
After `session/new` it advertises `/never` via `available_commands_update`.
-- A user can retire a standing constraint from ACP or the REPL:
- `/never rm <id-or-text>`, or an explicit forget/override in the next
- message (ADR 0033, #638). The model still cannot.
+- A user can retire a standing constraint from ACP or the REPL
+ (ADR 0033, #638). On a TTY, bare `/never` opens a searchable picker
+ (text prominent, id secondary) and requires two confirmations;
+ Esc/Keep leaves the ledger unchanged. `/never rm <id-or-text>` and
+ an explicit forget/override in the next message still work. The
+ model cannot retire a rule.
+- `bash_output` / `agent_output` `wait_ms>0` always waits for exit
+ (10h). Mid-range values like 60s–240s are no longer a bounded
+ deadline (#640).
- Existing Tauri `gui/` is unchanged. No `v0.0.279` tag until asked.
## v0.0.278 (2026-08-26)
diff --git a/docs/adr/0010-background-jobs-wait-for-exit.md b/docs/adr/0010-background-jobs-wait-for-exit.md
index fa875b36..bfa0444c 100644
--- a/docs/adr/0010-background-jobs-wait-for-exit.md
+++ b/docs/adr/0010-background-jobs-wait-for-exit.md
@@ -24,7 +24,9 @@ ceiling) and wakes once on exit. It does not put the model in the wait.
until the next byte of output.
- The old 1–30000 poll values are promoted to the 10-hour cap so a
model that still writes `wait_ms=30000` waits for done.
-- An explicit `wait_ms > 30000` is honored, clamped to 10 hours.
+- Any other positive `wait_ms` (including mid-range "safety timeouts"
+ of 60s–240s) is also the 10-hour cap. The number is not a deadline
+ (#640). Esc still returns a snapshot.
- Do not poll in a loop. One wait covers exit.
## Consequences
diff --git a/docs/adr/0033-user-can-retire-a-standing-constraint.md b/docs/adr/0033-user-can-retire-a-standing-constraint.md
index 48eda9c5..6f946e4a 100644
--- a/docs/adr/0033-user-can-retire-a-standing-constraint.md
+++ b/docs/adr/0033-user-can-retire-a-standing-constraint.md
@@ -15,10 +15,15 @@ under a still-injected `HARD CONSTRAINTS` block (#638).
The model still cannot retire a constraint. The user can, three ways:
-1. `/never` / `/constraint` in the REPL, as before.
+1. `/never` / `/constraint` in the REPL. On a TTY, bare `/never` opens
+ a searchable picker (text prominent, id secondary) and requires
+ **two** confirmations before a tombstone; Esc/Keep at either stage
+ leaves the ledger unchanged. `/never rm <id-or-text>` stays as the
+ power-user shortcut.
2. The same line as an ACP `session/prompt` (intercepted locally; not a
model turn). After `session/new` the agent advertises these as ACP
- `available_commands_update` entries (v1 schema).
+ `available_commands_update` entries (v1 schema). ACP has no TTY, so
+ bare `/never` lists and `rm` retires.
3. An explicit override in the current user message (`forget` /
`override` / `retire` / …) that names an id `pb-…` or uniquely
matches one live item. The ledger is tombstoned and the prefix
diff --git a/docs/adr/README.md b/docs/adr/README.md
index 83e9148f..06f5ee4c 100644
--- a/docs/adr/README.md
+++ b/docs/adr/README.md
@@ -43,7 +43,7 @@ record only when you need the evidence or the edge cases.
| [0030](0030-rlm-late-showcase.md) | Small turns hide `rlm` (and sPTC). Showcase on `--rlm`, a ≥4 native batch, context ≥50% of compactAt, or an explicit load — never on MCP fan-out or the prefix. |
| [0031](0031-xai-hosted-x-search.md) | xAI Responses splices hosted `x_search` onto tools turns. It is not a catalog function; `GRAFF_XAI_X_SEARCH=0` opts out. |
| [0032](0032-acp-streams-mid-turn.md) | `graff acp` streams thought / tool / text `session/update`s mid-turn. The native app is an ACP client; it does not need `graff serve`. |
-| [0033](0033-user-can-retire-a-standing-constraint.md) | Only the user retires a standing constraint: `/never` (REPL or ACP prompt) or an explicit override in the current message. The model cannot. |
+| [0033](0033-user-can-retire-a-standing-constraint.md) | Only the user retires a standing constraint: TTY `/never` picker (two confirms), ACP/`rm`, or an explicit override. The model cannot. |
## When to write one
diff --git a/docs/releases/v0.0.279.md b/docs/releases/v0.0.279.md
index 27c34c68..29ca735e 100644
--- a/docs/releases/v0.0.279.md
+++ b/docs/releases/v0.0.279.md
@@ -50,13 +50,22 @@ The existing Tauri app in `gui/` is unchanged.
`/never` is an ACP slash command (`available_commands_update` after
`session/new`) and is intercepted as a local prompt, so a native/Zed
-user can list and retire rules without the REPL. `rm` accepts an id or
-a unique text fragment. An explicit "forget / override that rule" in
-the next user message tombstones the matching item before the model
-turn (ADR 0033). `note_constraint` stays append-only.
+user can list and retire rules without the REPL. On a TTY, bare
+`/never` opens a `/model`-style searchable picker (constraint text
+first, id second) and asks twice before a tombstone. ACP / pipes keep
+the text list. `rm` accepts an id or a unique text fragment. An
+explicit "forget / override that rule" in the next user message
+tombstones the matching item before the model turn (ADR 0033).
+`note_constraint` stays append-only.
+
+## Background job waits (#640)
+
+Any `bash_output` / `agent_output` `wait_ms>0` waits for exit (10h).
+A model that passes a mid-range "safety timeout" (60s–240s) no longer
+gets `[job N: running]` back mid-job and a second billed hop.
## Tests
Unit suite grows by the ACP translator cases (`kindFor`, thought/text
-chunks, minted tool ids, EventSink) plus the #638 retire/override
-cases. Floor stays **1683** from the 278 ratchet (slack 25).
+chunks, minted tool ids, EventSink) plus the #638 picker/retire and
+#640 deadline cases. Floor stays **1683** from the 278 ratchet (slack 25).
diff --git a/scripts/eval-tier1.sh b/scripts/eval-tier1.sh
old mode 100644
new mode 100755
diff --git a/src/cli.zig b/src/cli.zig
index e46a41f9..293982e7 100644
--- a/src/cli.zig
+++ b/src/cli.zig
@@ -24,7 +24,8 @@ pub const changelog_text =
\\0.0.279
\\ • native Beautiful UI app speaks ACP: thinking and tool chips stream mid-turn (ADR 0032)
\\ • graff acp emits thought / tool_call / text session/update; /never is an ACP slash command
- \\ • a user can retire a standing constraint from ACP or /never rm (ADR 0033, #638)
+ \\ • /never on a TTY is a searchable picker with two confirms; rm and ACP list still work (#638)
+ \\ • bash_output wait_ms>0 always waits for exit — mid-range values are not a timeout (#640)
\\
\\0.0.278
\\ • deleted composer screenshots are not sent: submit keeps [Image #N] / @[path] only (#634)
diff --git a/src/command_catalog.zig b/src/command_catalog.zig
index 31fccf00..fe794248 100644
--- a/src/command_catalog.zig
+++ b/src/command_catalog.zig
@@ -29,7 +29,7 @@ pub const commands = [_]Item{
.{ .name = "/goal", .usage = "/goal [30m] [text|pause|resume|status|clear]", .desc = "set a standing objective and work it autonomously; an optional 30s/30m/2h budget paces the run; pause/resume steering, status shows state, clear removes it" },
.{ .name = "/loop", .usage = "/loop [30m] <prompt>", .desc = "the same autonomous run as /goal, without adopting a standing objective" },
.{ .name = "/review", .usage = "/review <target or instructions>", .desc = "run one isolated read-only review pass; no edits, delegation, or workflows" },
- .{ .name = "/never", .usage = "/never [<text>|rm <id-or-text>]", .desc = "standing constraints that ride every subagent brief and survive compaction; bare lists them, rm <id-or-text> retires one (alias /constraint)" },
+ .{ .name = "/never", .usage = "/never [<text>|rm <id-or-text>]", .desc = "standing constraints that ride every brief; bare opens a searchable picker (TTY) or lists them, rm <id-or-text> retires one (alias /constraint)" },
.{ .name = "/tell", .usage = "/tell <session|all> <text>", .desc = "message a running graff: <session> is a DM (only it hears, any folder); all broadcasts to every graff on this device; /sessions lists who's around" },
.{ .name = "/peek", .usage = "/peek <session>", .desc = "see what a live co-resident session is doing right now (its transcript tail)" },
.{ .name = "/routes", .usage = "/routes [<set>|add <set> <frontier|mid|small> <provider/model>]", .desc = "your own priced model lanes across providers — view the set and which seat wins each lane now" },
diff --git a/src/job_wait.zig b/src/job_wait.zig
index c5f5a0da..926d8bfc 100644
--- a/src/job_wait.zig
+++ b/src/job_wait.zig
@@ -19,13 +19,12 @@ pub const legacy_poll_ms: u64 = 30_000;
/// Map a model-supplied `wait_ms` onto a real deadline.
///
/// * `0` — snapshot now (do not block).
-/// * `1…legacy_poll_ms` — the old poll-loop value; promote to `wait_cap_ms`
-/// so one tool call covers exit instead of bouncing every 30s.
-/// * `> legacy_poll_ms` — honor it, clamped to `wait_cap_ms`.
+/// * `> 0` — wait until exit (or Esc), always `wait_cap_ms`. Mid-range
+/// "safety timeouts" (60s–240s) used to be honored as a bounded
+/// deadline (#640) and bounced the model every few minutes.
pub fn resolveDeadline(wait_ms: u64) u64 {
if (wait_ms == 0) return 0;
- if (wait_ms <= legacy_poll_ms) return wait_cap_ms;
- return @min(wait_ms, wait_cap_ms);
+ return wait_cap_ms;
}
test "resolveDeadline: snapshot stays zero" {
@@ -37,8 +36,9 @@ test "resolveDeadline: the 30s poll signature waits for exit (10h)" {
try std.testing.expectEqual(wait_cap_ms, resolveDeadline(legacy_poll_ms));
}
-test "resolveDeadline: an explicit long wait is honored up to the 10h cap" {
- try std.testing.expectEqual(@as(u64, 60_000), resolveDeadline(60_000));
+test "resolveDeadline: mid-range and huge values are the 10h exit cap (#640)" {
+ try std.testing.expectEqual(wait_cap_ms, resolveDeadline(60_000));
+ try std.testing.expectEqual(wait_cap_ms, resolveDeadline(240_000));
try std.testing.expectEqual(wait_cap_ms, resolveDeadline(wait_cap_ms));
try std.testing.expectEqual(wait_cap_ms, resolveDeadline(wait_cap_ms + 1));
}
diff --git a/src/jobs.zig b/src/jobs.zig
index 0a4c9e91..010918c1 100644
--- a/src/jobs.zig
+++ b/src/jobs.zig
@@ -412,7 +412,7 @@ pub fn jobOutput(gpa: Allocator, io: Io, id: u32, wait_ms: u64) !ToolOutput {
errdefer aw.deinit();
const w = &aw.writer;
if (!job.done) {
- try w.print("[job {d}: running]", .{id});
+ try w.print("[job {d}: running · {d}s elapsed — you are notified on exit; do not call bash_output again]", .{ id, waited / 1000 });
} else if (job.killed) {
try w.print("[job {d}: killed]", .{id});
} else if (job.exit_code) |c| {
diff --git a/src/playbook.zig b/src/playbook.zig
index 1e2c9cc8..01fc0016 100644
--- a/src/playbook.zig
+++ b/src/playbook.zig
@@ -402,4 +402,5 @@ pub fn traceActive(arena: Allocator, items: []const Item) void {
test {
_ = @import("playbook_tests.zig");
+ _ = @import("playbook_pick.zig");
}
diff --git a/src/playbook_glue.zig b/src/playbook_glue.zig
index f86ef15e..58eb1f01 100644
--- a/src/playbook_glue.zig
+++ b/src/playbook_glue.zig
@@ -16,7 +16,7 @@
//! items and nothing else: no retire, no edit, no learned items, no reading
//! back a ledger it could then rewrite. A model that finds a constraint
//! inconvenient has no mechanism to remove it — only the user does, through
-//! `/never rm <id>`. Same shape as the #366 gate: the capability the model
+//! `/never` (picker or `rm`). Same shape as the #366 gate: the capability the model
//! gets is strictly the one that makes it safer to run unattended.
const std = @import("std");
@@ -28,6 +28,7 @@ const ExecResult = @import("tools.zig").ExecResult;
const json_args = @import("json_args.zig");
const prompts = @import("prompts.zig");
const playbook = @import("playbook.zig");
+const playbook_pick = @import("playbook_pick.zig");
const ansi = @import("ansi.zig");
const style = &ansi.style;
@@ -72,6 +73,15 @@ pub fn noteConstraint(agent: *Agent, input: std.json.Value) ExecResult {
return .{ .text = std.fmt.allocPrint(agent.arena, "constraint recorded as {s}. It is now in {s} and rides every subagent, workflow and pipeline brief from here on, in this session and in later ones — you do not need to restate it.", .{ r.id, playbook.path }) catch "constraint recorded", .is_error = false };
}
+fn retireOne(root: *Agent, arena: Allocator, out: *Io.Writer, id: []const u8, needle: []const u8) !void {
+ if (playbook.retire(root.io, arena, id)) {
+ @import("prompt_cache_hud.zig").noteBust(.playbook);
+ refreshRoot(root, arena);
+ try out.print("retired {s} — it no longer rides new briefs (the record stays in the log as a tombstone)\n", .{id});
+ } else try out.print("no live playbook item matching '{s}' — /never lists them (id or unique text)\n", .{needle});
+ try out.flush();
+}
+
fn list(io: Io, arena: Allocator, out: *Io.Writer) !void {
const items = playbook.load(io, arena);
if (items.len == 0) {
@@ -148,7 +158,7 @@ pub fn applyUserOverride(root: *Agent, arena: Allocator, user_text: []const u8)
/// `/never` (alias `/constraint`). Returns false when `line` is neither, so
/// the caller falls through to the rest of the command chain.
///
-/// /never list the live ledger
+/// /never TTY: searchable picker + two confirms; else list
/// /never <text> record a user constraint
/// /never rm <id|text> retire one (id, or a unique text fragment)
pub fn command(root: *Agent, arena: Allocator, line: []const u8, out: *Io.Writer) !bool {
@@ -159,19 +169,18 @@ pub fn command(root: *Agent, arena: Allocator, line: []const u8, out: *Io.Writer
} else return false;
const arg = std.mem.trim(u8, rest, " \t");
if (arg.len == 0) {
- try list(root.io, arena, out);
+ switch (try playbook_pick.interactive(root, arena, out)) {
+ .fallback => try list(root.io, arena, out),
+ .handled => {},
+ .retire => |id| try retireOne(root, arena, out, id, id),
+ }
return true;
}
if (std.mem.startsWith(u8, arg, "rm ") or std.mem.startsWith(u8, arg, "remove ")) {
const needle = std.mem.trim(u8, arg[if (arg[0] == 'r' and arg[1] == 'm') 3 else 7..], " \t");
const items = playbook.load(root.io, arena);
const id = if (playbook.find(items, needle) != null) needle else if (playbook.findByUniqueText(items, needle)) |item| item.id else needle;
- if (playbook.retire(root.io, arena, id)) {
- @import("prompt_cache_hud.zig").noteBust(.playbook);
- refreshRoot(root, arena);
- try out.print("retired {s} — it no longer rides new briefs (the record stays in the log as a tombstone)\n", .{id});
- } else try out.print("no live playbook item matching '{s}' — /never lists them (id or unique text)\n", .{needle});
- try out.flush();
+ try retireOne(root, arena, out, id, needle);
return true;
}
var prov_buf: [32]u8 = undefined;
diff --git a/src/playbook_pick.zig b/src/playbook_pick.zig
new file mode 100644
index 00000000..9c3c4b7e
--- /dev/null
+++ b/src/playbook_pick.zig
@@ -0,0 +1,139 @@
+//! Interactive /never retire picker (#638).
+//!
+//! Bare `/never` on a TTY uses the same fuzzy `listPicker` as `/model`:
+//! constraint text is the row, the id is secondary, type-to-filter, then
+//! two confirmations before a tombstone. ACP, pipes, and tests have no
+//! raw stdin, so `playbook_glue` falls back to the text list. The model
+//! never reaches this path.
+
+const std = @import("std");
+const Io = std.Io;
+const Allocator = std.mem.Allocator;
+
+const Agent = @import("agent.zig").Agent;
+const playbook = @import("playbook.zig");
+const pickers = @import("pickers.zig");
+const tty = @import("term.zig").tty;
+
+pub const Result = union(enum) {
+ /// No TTY / no stdin / empty ledger — caller should print the text list.
+ fallback,
+ /// Picker ran and the user backed out; ledger unchanged.
+ handled,
+ /// Two confirms accepted; caller tombstones this live id.
+ retire: []const u8,
+};
+
+/// Keep-it is index 0 so an accidental Enter leaves the ledger alone.
+pub const keep_idx: usize = 0;
+pub const retire_idx: usize = 1;
+
+const first_confirm = [_]pickers.PickItem{
+ .{ .name = "Keep it", .desc = "Leave this constraint live" },
+ .{ .name = "Retire it", .desc = "Ask once more, then stop applying it" },
+};
+
+const second_confirm = [_]pickers.PickItem{
+ .{ .name = "Keep it", .desc = "Leave this constraint live" },
+ .{ .name = "Retire it", .desc = "Stop applying it to root, subagents, workflows, and pipelines" },
+};
+
+pub fn wantsRetire(choice: ?usize) bool {
+ return choice == retire_idx;
+}
+
+/// Both confirmations must pick "Retire it". Cancel / Keep at either stage
+/// leaves the ledger untouched.
+pub fn confirmed(first: ?usize, second: ?usize) bool {
+ return wantsRetire(first) and wantsRetire(second);
+}
+
+/// Text prominent, id secondary — matches the #638 row contract and the
+/// generic picker's name-outranks-desc scoring.
+pub fn pickRows(arena: Allocator, items: []const playbook.Item) ![]pickers.PickItem {
+ const rows = try arena.alloc(pickers.PickItem, items.len);
+ for (items, rows) |item, *row| {
+ row.* = .{
+ .name = item.text,
+ .desc = try std.fmt.allocPrint(arena, "{s} · {s}", .{ item.id, @tagName(item.source) }),
+ };
+ }
+ return rows;
+}
+
+fn cancelled(out: *Io.Writer) !Result {
+ try out.print("cancelled — playbook unchanged\n", .{});
+ try out.flush();
+ return .handled;
+}
+
+/// Opens the picker when stdin is a TTY. Returns `.fallback` so a pipe,
+/// ACP prompt, or empty ledger still gets the text list.
+pub fn interactive(root: *Agent, arena: Allocator, out: *Io.Writer) !Result {
+ if (root.in == null) return .fallback;
+ const probe = tty.enterRaw(true) orelse return .fallback;
+ tty.restore(probe);
+
+ const items = playbook.load(root.io, arena);
+ if (items.len == 0) return .fallback;
+
+ const rows = try pickRows(arena, items);
+ const pick = pickers.listPicker(root, arena, out, "Constraint ›", rows) orelse return cancelled(out);
+ const item = items[pick];
+
+ const t1 = try std.fmt.allocPrint(arena, "Retire › {s}", .{item.text});
+ if (!wantsRetire(pickers.listPicker(root, arena, out, t1, &first_confirm))) return cancelled(out);
+
+ const t2 = try std.fmt.allocPrint(arena, "Stop applying to root, subagents, workflows, and pipelines? › {s}", .{item.text});
+ if (!confirmed(retire_idx, pickers.listPicker(root, arena, out, t2, &second_confirm))) return cancelled(out);
+
+ return .{ .retire = item.id };
+}
+
+test "pickRows: text is the name, id is secondary" {
+ var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator);
+ defer arena_state.deinit();
+ const arena = arena_state.allocator();
+ const items = [_]playbook.Item{
+ .{ .id = "pb-aaaaaaaa", .text = "never add scroll hints", .source = .user },
+ .{ .id = "pb-bbbbbbbb", .text = "prefer codedb outline first", .source = .learned },
+ };
+ const rows = try pickRows(arena, &items);
+ try std.testing.expectEqual(@as(usize, 2), rows.len);
+ try std.testing.expectEqualStrings("never add scroll hints", rows[0].name);
+ try std.testing.expect(std.mem.indexOf(u8, rows[0].desc, "pb-aaaaaaaa") != null);
+ try std.testing.expect(std.mem.indexOf(u8, rows[0].desc, "user") != null);
+ try std.testing.expectEqualStrings("prefer codedb outline first", rows[1].name);
+ try std.testing.expect(std.mem.indexOf(u8, rows[1].desc, "pb-bbbbbbbb") != null);
+}
+
+test "double confirm: both Retire it, or the ledger stays" {
+ try std.testing.expect(confirmed(retire_idx, retire_idx));
+ try std.testing.expect(!confirmed(keep_idx, retire_idx));
+ try std.testing.expect(!confirmed(retire_idx, keep_idx));
+ try std.testing.expect(!confirmed(null, retire_idx));
+ try std.testing.expect(!confirmed(retire_idx, null));
+ try std.testing.expect(!wantsRetire(null));
+ try std.testing.expect(!wantsRetire(keep_idx));
+ try std.testing.expect(wantsRetire(retire_idx));
+}
+
+test "interactive /never is skipped without a TTY" {
+ var arena_state = std.heap.ArenaAllocator.init(std.testing.allocator);
+ defer arena_state.deinit();
+ const arena = arena_state.allocator();
+ var aw: Io.Writer.Allocating = .init(arena);
+ var root: Agent = .{
+ .gpa = std.testing.allocator,
+ .arena = arena,
+ .io = std.testing.io,
+ .client = undefined,
+ .provider = undefined,
+ .messages = undefined,
+ .sub = false,
+ .label = "test",
+ .out = &aw.writer,
+ .session_name = "",
+ };
+ try std.testing.expect((try interactive(&root, arena, &aw.writer)) == .fallback);
+}
diff --git a/src/subagent.zig b/src/subagent.zig
index 64c312b7..deb12f19 100644
--- a/src/subagent.zig
+++ b/src/subagent.zig
@@ -302,9 +302,8 @@ pub fn agentStatusText(gpa: Allocator, id: u32, done: bool, is_error: bool, usag
);
}
-/// Same wait policy as bash_output (ADR 0010): 0 = snapshot, >0 waits for
-/// exit (legacy 1–30000 values promote to 10h). Inlined so this file stays
-/// at the line cap without importing job_wait.
+/// Same wait policy as bash_output (ADR 0010 / #640): 0 = snapshot, any
+/// >0 waits for exit (10h). Inlined so this file stays at the line cap.
const agent_wait_cap_ms: u64 = 36_000_000;
/// agent_output: fetch a background subagent's status/result. Non-
@@ -312,7 +311,7 @@ const agent_wait_cap_ms: u64 = 36_000_000;
/// bash_output's cursor, a subagent's report is one-shot, not a stream).
/// wait_ms > 0 blocks until the agent finishes (or Esc), not every 30s.
pub fn agentOutput(gpa: Allocator, io: Io, id: u32, wait_ms: u64) !ToolOutput {
- const deadline: u64 = if (wait_ms == 0) 0 else if (wait_ms <= 30_000) agent_wait_cap_ms else @min(wait_ms, agent_wait_cap_ms);
+ const deadline: u64 = if (wait_ms == 0) 0 else agent_wait_cap_ms;
var waited: u64 = 0;
while (true) {
g_agent_jobs.mutex.lockUncancelable(io);
diff --git a/src/test_hooks.zig b/src/test_hooks.zig
index 7e58fc69..a0f03d98 100644
--- a/src/test_hooks.zig
+++ b/src/test_hooks.zig
@@ -117,6 +117,7 @@ const agent_eval_control_tests = @import("agent_eval_control_tests.zig");
// reflector modules are only ever reached through a call, so their tests need
// the hook.
const playbook_glue = @import("playbook_glue.zig");
+const playbook_pick = @import("playbook_pick.zig");
const playbook_reflect = @import("playbook_reflect.zig");
// #391: the pre-compaction note store and its note turn. prompts.zig reaches
@@ -272,6 +273,7 @@ test {
_ = acp;
_ = agent_eval_control_tests;
_ = playbook_glue;
+ _ = playbook_pick;
_ = playbook_reflect;
_ = compact_note;
_ = compact_note_glue;