mirror of
https://github.com/block/buzz.git
synced 2026-11-26 11:12:22 +00:00
When a message reaches an agent mid-turn via the goose-native steer path (try_native_steer), the steer body carried only the framing header, the event block, and the closing note — no reply-anchor instruction. The agent's only in-context --reply-to guidance was the stale anchor from its original prompt, so it replied into the old thread even when the steered message was top-level or belonged to a different thread. Observed in the wild: a top-level 'give me a status report' mention was answered inside the agent's old task thread. Every other delivery path already anchors: fresh top-level turns get append_new_thread_reply_instruction, fresh thread turns get append_reply_instruction, and the cancel+merge fallback re-derives the anchor in format_prompt from the last event. Native steer was the only path with no anchor at all. Fix: native_steer_reply_instruction derives the anchor from the steered event's own thread tags — its thread root when threaded, the event itself when top-level — mirroring resolve_reply_anchor, and is appended to the steer body after the event block. No profile lookup is available on this synchronous path, so no agent-to-agent exemption is applied; that matches turn_is_human_facing's documented fail-open policy (unknown identity is treated as human). The instruction is scoped to 'replies to this new message' so in-progress work keeps its original anchor. Tests pin both derivations (top-level anchors to the event, threaded anchors to the steered event's root, never the event id). Co-authored-by: Bradley Axen <baxen@squareup.com> Signed-off-by: Bradley Axen <baxen@squareup.com>