Files
buzz/crates
Michael Neale cca05c0ae1 feat(buzz-agent): restore AGENTS.md hints and load_skill on the goose loop
The swap documented both as losses (B1/B2 in fa8166e60). Restore them by
keeping the old buzz-agent modules and wiring them into goose, rather than
using goose's own equivalents, which don't fit:

* goose's hint loader keys off GOOSE_HINTS_FILENAME (.goosehints); our repos
  ship AGENTS.md. hints.rs (directory-chain walk + ~/AGENTS.md + skill
  discovery under .agents/skills, .goose/skills, .claude/skills) is kept and
  its output injected via extend_system_prompt("buzz_hints") at session
  build — system_prompt_extras survive override_system_prompt, so this works
  with the persona path too.

* goose's skills platform extension is never loaded (Agent::with_config
  loads zero extensions; build_agent only adds the harness's mcpServers).
  builtin.rs / load_skill is kept and registered as a goose *frontend*
  extension: goose advertises the tool, and we answer the calls in-process.

The frontend-tool wiring had a deadlock in the first cut: it listened for
MessageContent::ToolRequest, but goose strips frontend calls out of the
normal ToolRequest flow (reply_parts.rs categorize_tools) and yields a
dedicated FrontendToolRequest variant instead, then BLOCKS the reply stream
on tool_result_rx.recv() until handle_tool_result is called. The handler
never matched, so the first load_skill call hung the turn forever — this is
what the hung `cargo test --test skills` processes on this machine were.
Now:

* serve_frontend_tool matches FrontendToolRequest, answers every yielded
  request exactly once (unknown tool name gets an error result rather than
  silence — goose is already blocked on the id), and skips only the Err
  parse case, where goose does not block (tool_execution.rs:181 yields
  inside the Ok arm only).

* emit_content announces FrontendToolRequest to the desktop as a tool_call
  update; its result comes back as a plain ToolResponse, and an update for
  a never-announced id would break the announce→terminal pairing that keeps
  the UI spinner honest.

The skills integration test drives the full path over stdio against a fake
SSE provider: AGENTS.md content and the skill name/description index must
reach the system prompt, the skill BODY must not (that is the point of
load_skill), load_skill must be advertised, and the turn must complete —
a broken frontend-tool path fails by hanging, so the turn completing IS the
assertion.

53 buzz-agent tests green; fmt + clippy -D warnings clean.

Signed-off-by: Michael Neale <michael.neale@gmail.com>
2026-07-28 15:17:28 +10:00
..
2026-07-27 14:18:24 -04:00