Repository navigation
Description
Problem
A Harness can put text into the reply that the model never wrote, and ai-buddy
speaks it.
Measured against Pi through pi-acp in #607. On the first turn of a fresh
session, Pi's startup banner — pi v0.85.1 plus every local
~/.agents/skills/*/SKILL.md path, roughly 1.6 KB — arrives as the first
agent_message_chunk, ahead of the model's answer. note_update
(src-tauri/src/acp_wire.rs:741) appends every text chunk to one string, and
prompt returns the concatenation (:288). So the banner is simply part of
the reply.
Two things follow, and the second is the one users see:
parse_proposal(crates/core/src/director.rs:468) reads the first
non-empty line and requires a single-token identifier. It gets
pi v0.85.1, so the turn does not parse as a Behavior proposal.- A reply that does not parse falls back to being spoken. The buddy's first
sentence after attaching Pi is a version string and a list of the user's
file paths.
A resumed session has no banner and parses fine, which is why #607's earlier
run missed it.
Not a prompt problem
The banner is emitted before the model is asked anything. Framing, examples and
format instructions cannot reach it. That makes it a different failure from
#244's contract breaks, where the model itself invented a Behavior name, and
from the empty-reply case in #597 where a reasoning model spent its budget
before answering. It is the same family — bytes that are not the answer being
treated as the answer — but this instance is the Harness's own output.
Direction, not a decided fix
Trace before choosing. Candidates, roughly in increasing order of blast radius:
- Tolerate a preamble in
parse_proposal: scan for the first line that
looks like a Behavior name rather than demanding line one. General, and it
fixes every Harness that ever prepends anything. Risk: a Behavior name
mentioned inside prose gets promoted to the proposal, so it needs a real rule
about what counts, not just "the first identifier-shaped line". - Drop leading chunks that are not the answer at the
note_updateseam.
Needs a rule for what "not the answer" means on a wire that does not mark it. - Ignore the first turn's leading chunk on a fresh session only, since the
banner is a fresh-session artefact. Narrow and cheap; also the most likely to
silently eat a real first sentence. - Something Pi-specific, last resort.
pi-acpexposes no suppression knob —
PI_ACP_PI_COMMANDandPI_ACP_ENABLE_EMBEDDED_CONTEXTare its only env
inputs — and a rule keyed to one Harness's banner text will rot.
Whatever is chosen, an unparsed reply becoming speech is the behaviour that
turns this into a visible bug. That fallback is worth looking at directly.
Done when
- A fresh Pi session's first turn does not put the banner in the bubble
- The same turn parses as a Behavior proposal, or fails for a reason that
is not the banner - A Harness that prepends something else is no worse off than today
- A test that fails if the behaviour regresses, with a real captured banner
rather than a paraphrase of one
Context
- feat(harness): Reach the Pi coding agent through the pi-acp community adapter #607 has the measurement, the probe output and the install steps.
- spike(director): Tell a model's reasoning from its final answer, and size the reply budget from the contracts #597's spike answered the neighbouring question on the Completer lane and is
merged asdocs/research/reasoning-versus-the-final-answer.md. Its framing —
read the wire's own markers rather than guessing — is worth reading first. - ADR-0025 draws a Harness's thinking separately from its answer; ACP marks a
thought chunk distinctly. A banner is neither, and nothing on the wire says so.
— Claude Code agent, on @omesser's behalf.
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity