Skip to content

fix(acp): add publish-send safety net to base system prompt - #4710

Open
azure5100 wants to merge 1 commit into
block:mainfrom
azure5100:fix/agent-response-publish-safety-net
Open

fix(acp): add publish-send safety net to base system prompt#4710
azure5100 wants to merge 1 commit into
block:mainfrom
azure5100:fix/agent-response-publish-safety-net

Conversation

@azure5100

Copy link
Copy Markdown

Problem

Agents under the ACP harness sometimes produce complete responses but fail to publish them via buzz messages send. The output exists in local stdout but never reaches the Nostr relay — users see the agent as unresponsive.

Root cause: the current design relies solely on prompt-based behavioral constraints with no harness-level safety net. Every agent type (Claude Code, Codex, Grok, OpenCode) is susceptible.

Closes #4709

Changes

Two additions to crates/buzz-acp/src/base_prompt.md (+15 lines):

1. CRITICAL banner at top of file

Placed immediately after the intro, before any CLI reference. Makes it unavoidable:

**CRITICAL — Read this first:** Your reasoning and tool calls are invisible to
other users. The ONLY way anyone sees your response is if you call
`buzz messages send`...

2. "Before Ending Your Turn" sentinel at bottom

A checklist-based gate the agent hits at the end of every session:

  • Was someone waiting on an answer?
  • Did you finish delegated work?
  • Did you find something worth reporting?
  • Are you blocked and need input?
  • Nothing to communicate? → Silence is correct.

Design: "first and last" reinforcement — banner on session start, checklist before turn end.

Future work

A harness-level safety net (L3) is proposed in #4709 — after session/prompt returns, the harness checks whether the agent published any events to the target channel and auto-publishes a fallback if not. That's a separate, larger change (~50-100 lines Rust in buzz-acp).

🤖 Generated with Claude Code

Agents occasionally produce complete responses but fail to call
`buzz messages send`, leaving output in local stdout instead of
publishing it to the relay. This is a structural gap — the current
design relies solely on prompt-based behavioral constraints with
no harness-level safety net.

Add two reinforcements to base_prompt.md:
- A CRITICAL banner at the top of the file, before any other content,
  making explicit that nothing reaches the channel without an explicit
  publish call
- A "Before Ending Your Turn" sentinel at the end with a checklist
  covering the five cases (answer expected, work done, found something,
  blocked, nothing to say)

Design intent: "first and last" — the agent sees the banner on session
start and is intercepted by the checklist before ending every turn.

Related: block#4709

Signed-off-by: azure5100 <710782721@qq.com>
@azure5100
azure5100 requested a review from a team as a code owner August 4, 2026 11:44
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.

ACP harness: agents silently fail to publish responses (no safety net for missed buzz messages send)

1 participant