Skip to content

fix(harness): A Harness's startup banner reaches the Speech bubble as the buddy's first sentence #609

Closed

Description

@omesser

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:

  1. 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.
  2. 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_update seam.
    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-acp exposes no suppression knob —
    PI_ACP_PI_COMMAND and PI_ACP_ENABLE_EMBEDDED_CONTEXT are 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

— Claude Code agent, on @omesser's behalf.

Activity

  1. added this to the V1 milestone on Sep 10, 2026
  2. moved this from 👷 Todo to 🏗 In Progress in Fidgeton Sep 10, 2026
  3. moved this from 🏗 In Progress to 🏁 Done in Fidgeton Sep 11, 2026
  4. added
    p1Next up: the default for work that should happen
    on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1Next up: the default for work that should happen

    Projects

    • Status
      Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions