Skip to content

fix(prompt,jobs): narrate in-band, ask via ask_user, no wake for an exit already read (ADR 0061) - #727

Merged
justrach merged 2 commits into
mainfrom
fix/gemini-flash-harness
Sep 3, 2026
Merged

fix(prompt,jobs): narrate in-band, ask via ask_user, no wake for an exit already read (ADR 0061)#727
justrach merged 2 commits into
mainfrom
fix/gemini-flash-harness

Conversation

@justrach

@justrach justrach commented Sep 3, 2026

Copy link
Copy Markdown
Owner

What changed

  • headsup_note: the heads-up text goes in the same response as the tool calls it introduces; a command that can run for minutes is announced with what it waits on.
  • work_note + the ask_user tool description: a choice for the user is an ask_user call with the choices in options; a menu written in prose renders no picker and waits for nothing.
  • job_notify.dismiss: bash_output returning a finished job's status, and bash_kill reporting a dead job, drop that job's queued exit notice (an id the pump has not queued yet is remembered so record skips it once). The hosted-sink job_completed event still fires.
  • job_notify.printRunning: a blocking bash_output wait interrupted with Esc reports the time actually waited instead of the 10-hour deadline sentinel ("36000s elapsed").
  • Prompt golden updated; the lean/unattended prompt tests move to prompt_lean_tests.zig to stay under the 600-line ceiling.
  • ADR 0061 records the two-trajectory comparison that motivated this.
  • Second commit, CI: build.zig links libc explicitly on the graff exe, its unit-test module, and the TUI exe; workspace_switch.zig compares paths as printed on Windows, whose CRT has no realpath(3). Main has been red on the Linux and Windows jobs since the Workspace switch can report the wrong active worktree #721 commit with "dependency on libc must be explicitly specified in the build command".

Why

On one interactive trajectory the model answered every step with bare function calls and no text, so a multi-minute hook run read as a hang, and it ended a blocked push turn with a lettered menu in prose instead of an ask_user call. Independently of the model, every background job it had already waited on still woke it with "unread output via bash_output", which it answered with a snapshot that returned "(no new output)".

Verified: zig build test green on 0.16.0 and the CI-pinned 0.17-dev (1911 pass, 1 skip); tier-1 fully green on the second push (all 18 PTY probes); x86_64-linux-gnu and x86_64-windows-gnu cross-builds clean.

…xit already read (ADR 0061)

Two interactive trajectories on the same build showed one model answering
every step with bare function calls and no text, then ending a blocked push
turn with a lettered menu of options in prose instead of an ask_user call.
Around that, every background job the model had already waited on with
bash_output (or killed with bash_kill) still woke it with "unread output via
bash_output; do not poll", which it answered with a bash_output snapshot
that returned nothing; and an Esc during a blocking wait rendered the
10-hour deadline sentinel as "36000s elapsed".

- headsup note: the heads-up text rides in the SAME response as the tool
  calls it introduces, and a command that can run for minutes is announced
  with what it waits on.
- work note + ask_user description: a choice for the user is an ask_user
  call with the choices in options; a menu in prose renders no picker and
  waits for nothing. ask_user is in every root catalog and self-decides
  with no human attached, so the instruction is safe in -p.
- job_notify.dismiss: bash_output returning a finished job's status, and
  bash_kill reporting a dead job, drop that job's queued notice; an id the
  pump has not queued yet is remembered so record() skips it once. The
  hosted-sink job_completed event still fires.
- job_notify.printRunning: an interrupted wait reports what it waited.
- prompt_snapshot_tests golden updated; the lean/unattended tests move to
  prompt_lean_tests.zig to stay under the 600-line ceiling.
CI on main has been red on Linux and Windows since the #721 workspace
switch started calling std.c.getcwd and std.c.realpath: "dependency on
libc must be explicitly specified in the build command". macOS links
libc implicitly and never noticed.

- build.zig: link_libc on the graff exe, the unit-test module that roots
  the same main.zig, and the TUI exe (the TUI tests already had it).
- workspace_switch.zig: the Windows CRT has no realpath(3); on Windows
  realpathOs compares the path as printed. The cases it resolves
  (/tmp vs /private/tmp, a symlinked worktree parent) are POSIX ones.

Verified with x86_64-linux-gnu and x86_64-windows-gnu cross-builds (both
clean; the Linux test binary compiles) and the native macOS suite.
@justrach
justrach merged commit 61b6acf into main Sep 3, 2026
6 checks passed
@justrach
justrach deleted the fix/gemini-flash-harness branch September 3, 2026 03:09
justrach added a commit that referenced this pull request Sep 3, 2026
…Streamdown and prompt recall

Both sides rewrote the native harness after the 285 tag: origin landed
follow-tail scrolling, the prompt queue, frame-rate ACP paint and the
ChatBubbles/ChatEmpty split; this branch landed the Streamdown renderer
and ArrowUp prompt recall. Resolution keeps origin's harness and scroll
model, the Streamdown Markdown.tsx (its remark pipeline supersedes the
hand parser's ordered-list and caret fixes), and threads the recall
history through the composer and the empty state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant