Skip to content

refactor(buzz-acp): point agents at buzz --help instead of a command table - #7586

Merged
salman1993 merged 1 commit into
mainfrom
smohammed/base-prompt-cli-pointer
Sep 11, 2026
Merged

refactor(buzz-acp): point agents at buzz --help instead of a command table#7586
salman1993 merged 1 commit into
mainfrom
smohammed/base-prompt-cli-pointer

Conversation

@salman1993

@salman1993 salman1993 commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Summary

The ACP base prompt carried a Group | Key commands table for the buzz CLI — a second copy of a surface that already documents itself, with nothing tying it to the parser. It had already drifted: 16 of the CLI's 23 groups (missing emoji, gifs, notes, patches, media, moderation, pack) and 50 of the 91 subcommands under the groups it did list. The adjacent exit-code line stopped at 4; the CLI has a 5th (5 = write conflict, NIP-33 LWW).

#7584 was the prerequisite: buzz --help now renders the full command tree — every group, its subcommands, and their descriptions — in one invocation (199 lines, 13 KB), generated from clap's own command definition, so it cannot drift. buzz -h still prints the group-level summary. Pointing the prompt at --help was not viable before that, because discovering buzz messages send cost a second call and discovering buzz canvas set exists cost a third.

So this replaces the table with a pointer to buzz --help, fixes the exit codes, and adds the one CLI ergonomic that --help does not make obvious (--format compact is a global flag that goes before the subcommand). Everything after the table is kept verbatim — it is the non-discoverable semantics --help cannot express: multiline content through stdin, the BUZZ_AUTH_TAG requirement for agent drafts, --channel on pr open, the link field, mention and assignment rules.

…table

The base prompt carried a `Group | Key commands` table — a second copy of
a surface that already documents itself, and one nothing ties to the
parser. It had already drifted: it listed 16 of the CLI's 23 groups
(missing `emoji`, `gifs`, `notes`, `patches`, `media`, `moderation`,
`pack`) and 50 of the 91 subcommands under the groups it did list. The
adjacent exit-code line stopped at 4; the CLI has a 5th (write conflict).

Now that `buzz --help` renders the full command tree in one invocation
(#7584, generated from clap's own definition so it cannot drift),
replace the table with a pointer to it, fix the exit codes, and note
that `--format compact` is a global flag. Everything after the table is
kept: it is non-discoverable semantics `--help` cannot express.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 requested a review from a team as a code owner September 11, 2026 16:52
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-11T16:55:43.855576Z 3bc265d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 44c1cc7df8e0067c9d578a93ad8e4393304422b3...3bc265df8ace4812b03902d4c3f40fb5095a5520.
A new review must complete for this exact range. When manual authorization
is required, a Block organization member must comment exactly
@buzz-security-review 3bc265df8ace4812b03902d4c3f40fb5095a5520 to authorize a new review.
Any previous review applies only to its recorded range.

@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 Reviewed exact head 3bc265df8ace4812b03902d4c3f40fb5095a5520. No actionable findings.

Verified independently: the full buzz-acp package suite passes (933 unit tests + 9 integration tests), the generated root help contains all 23 command groups, nested help renders flags/examples, and global --format compact works only before the subcommand. FastValidator separately built the release CLI and ran the full buzz-cli package suite (473 passed).

Static inspection confirms CliError::Conflict maps to exit code 5; a live write-conflict path was not exercised. CI was still running when this review was posted.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

Reviewed head 3bc265df8ace4812b03902d4c3f40fb5095a5520 against base 44c1cc7df8e0067c9d578a93ad8e4393304422b3.

No actionable code findings. This is a comment review, not an approval. This assessment is my source review; the additional delegated review lane was cancelled before returning a result.

  • The prerequisite #7584 is the exact base. The root CLI parser installs the recursive clap-generated command tree, handles help before command/auth execution, and supports the documented root-level placement of --format compact. CliError::Conflict maps to exit code 5.
  • All instructions after the removed table are byte-identical to base, preserving draft authorization, stdin/newline handling, channel routing, links, mentions, and assignment semantics. Modern and legacy ACP delivery still consume the same embedded base prompt. The reported 13 KB / 199-line help fits the exact-head shell’s 50 KiB / 2,000-line inline-output threshold.
  • Validation: source tracing and a direct base/head suffix comparison were performed locally. The author reports exact-head passes for the full ACP package (933 unit + 9 integration tests) and CLI package (473 tests) in this comment; those are author-reported results, not my own runs. I did not build this head, run broad suites, or exercise a live write conflict. The installed CLI predates the help-tree change, so its help-only probes are not exact-head runtime evidence.

Separate merge/validation notes: DCO is green and the commit has the matching sign-off. At the check snapshot, CI was still running and the security review remained required for this exact range; a completed Codex code-review summary does not clear that security gate. No inline Codex findings were returned. The available PR evidence does not establish completion of the full local just ci gate required by AGENTS.md:112; package-test passes are narrower. These are validation/process caveats, not discovered code defects.

@wesbillman wesbillman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Carl, an automated reviewer, commenting via Wes’s GitHub account.

REVIEW CLEAR: no actionable defects found.

Reviewed head 3bc265df8ace4812b03902d4c3f40fb5095a5520 against base 44c1cc7df8e0067c9d578a93ad8e4393304422b3.

  • The prompt now directs agents to the CLI’s authoritative command tree, consistent with the agent-first product direction. Full-tree help is already present in the base; the updated exit codes and root-level --format compact placement match the implementation.
  • Traced the compiled default through modern/legacy ACP prompt composition and checked custom/disabled-base behavior. The existing owner-approval, routing, mention, assignment, and multiline-content rules are byte-identical to the base. Independent CLI-contract review also found no blocker.
  • Validation was source-only on Wes’s Mac Studio, using exact-SHA source and diffs. No checkout, build, tests, or PR-code execution. Relay persistence, protocol handling, and native UI are unchanged and outside this one-file prompt review; no runtime or model-behavior guarantee is claimed.

@salman1993
salman1993 enabled auto-merge (squash) September 11, 2026 17:39
@salman1993
salman1993 merged commit e17cdd9 into main Sep 11, 2026
139 of 142 checks passed
@salman1993
salman1993 deleted the smohammed/base-prompt-cli-pointer branch September 11, 2026 18:07
rileycrane pushed a commit that referenced this pull request Sep 12, 2026
* origin/main:
  Configure ACP session scope per agent (#7578)
  refactor(buzz-acp): point agents at buzz --help instead of a command table (#7586)
  feat(buzz-cli): render an agent-friendly command tree in --help (#7584)
  fix(avatars): scale agent squircles from normalized paths (#7307)
  fix(mobile): bind same-name mentions to exact selected identities (#7385)
  fix(desktop): isolate quota backoff and reuse channel discovery rosters (#6998)
  test(desktop): isolate login-shell probe measurements (#7570)
  feat(git): add default-branch management to relay and CLI (#7562)
  fix(acp): integrate the Buzz Pi adapter fork (#7552)
  fix(markdown): align mention chip wrapping (#7501)
  fix(relay): reject presence updates when Redis storage fails (#7532)
  fix(desktop): let inbox title and message author names truncate under narrow panes (#7550)
  fix(buzz-acp): report missing models without retrying (#7538)
  fix(desktop): require a Codex adapter with Astra support (#7427)
  fix(desktop): order unnamed roster members by full canonical npub (#7503)
  fix(mobile): standardize public-key identity display on npub (#7493)
  fix(desktop): npub identity controls across profile, agents, and workflows (#7489)
  fix(desktop): npub identity displays for mention, member, and workflow surfaces (#7495)
  fix(desktop): shared npub identity foundation (canonicalNpub, PubKey gate, strict parser) (#7488)
  fix(mobile): render push notification sender identity as npub (#7494)

Signed-off-by: Sol <478bb5a31222ea2b28a3d1afb8b1d598940628f19c2a87efc3c4b822299eeec6@buzz.block.builderlab.xyz>

# Conflicts:
#	desktop/src-tauri/src/commands/media_download.rs
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.

3 participants