Skip to content

feat(buzz-acp): update base prompt; add buzz context and skills to Pi agents - #7335

Merged
salman1993 merged 7 commits into
mainfrom
smohammed/pi-buzz-context
Sep 4, 2026
Merged

feat(buzz-acp): update base prompt; add buzz context and skills to Pi agents#7335
salman1993 merged 7 commits into
mainfrom
smohammed/pi-buzz-context

Conversation

@salman1993

@salman1993 salman1993 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Summary

  • launch Pi through a private Buzz wrapper so managed Pi agents receive Buzz's base prompt plus the configured thread/channel session model via --system-prompt
  • load the Buzz workspace skill directory with Pi's repeatable --skill flag, making ~/.buzz/.agents/skills/buzz-cli available alongside Pi's normal global skill discovery
  • report Pi and pi-acp installation states separately so setup guidance points to the missing component

pi-acp does not currently consume the ACP session/new system prompt, but its normal new-session and restore paths do honor PI_ACP_PI_COMMAND as the executable used to launch Pi. Buzz reserves that variable and sets it to a private generated launcher. The launcher invokes pi from Buzz's effective PATH, adds --system-prompt <file> and --skill <workspace>/.agents/skills, and forwards pi-acp's RPC and session arguments unchanged. This keeps the integration entirely in block/buzz, without changes to Pi or pi-acp.

How PI_ACP_PI_COMMAND works in pi-acp

PI_ACP_PI_COMMAND selects one executable; it does not accept arguments. Therefore:

# Does not work
PI_ACP_PI_COMMAND="pi --skill ~/.buzz/.agents/skills"

Buzz does not expose this variable as user configuration. It creates a private launcher and sets PI_ACP_PI_COMMAND only on the pi-acp child. Conceptually, that launcher executes:

#!/bin/sh
exec pi \
  --system-prompt "$PRIVATE_SYSTEM_PROMPT" \
  --skill "$HOME/.buzz/.agents/skills" \
  "$@"

Related issue

Follow-up to #7208. No duplicate issue or open PR found.

Testing

  • just ci
  • cargo test -p buzz-acp pi_launcher
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml managed_agents::env_vars::tests
  • cargo test --manifest-path desktop/src-tauri/Cargo.toml managed_agents::discovery::presets::tests
  • pre-push branch checks

No screenshots: the UI change is state-dependent setup guidance only.


Update Sep 4, 13:35: Made PI_ACP_PI_COMMAND entirely Buzz-owned.

  • Managed agent configuration now rejects the variable as a user override.
  • Buzz always launches pi from its effective PATH and rejects inherited values before creating its private launcher.
  • Removed the custom Pi executable discovery path and its internal environment alias.

Update Sep 4, 14:03: Reject inherited PI_ACP_PI_COMMAND values instead of replacing them.

  • Pi startup now fails with an actionable message telling the user to unset the variable.
  • Removed the Pi-specific exception from the generic ACP environment injection path.

Generated with Codex

@github-actions

github-actions Bot commented Sep 4, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

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

@salman1993 salman1993 changed the title Add Buzz context and skills to Pi agents feat(buzz-acp): update base prompt; add buzz context and skills to Pi agents Sep 4, 2026
@salman1993
salman1993 marked this pull request as ready for review September 4, 2026 16:41
@salman1993
salman1993 requested a review from a team as a code owner September 4, 2026 16:41
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 4, 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-04T16:46:56.135752Z 4596cd0 Draft marked ready
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4596cd0c0a

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread crates/buzz-acp/src/pi_launcher.rs
Comment thread desktop/src-tauri/src/managed_agents/discovery/presets.rs
@salman1993
salman1993 force-pushed the smohammed/pi-buzz-context branch from 4596cd0 to f873ebf Compare September 4, 2026 17:13
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 force-pushed the smohammed/pi-buzz-context branch from f82f744 to d431535 Compare September 4, 2026 18:14
@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 Locally verified the Pi integration on PR head d431535:

  • Ran Pi from ~/.buzz with the same --system-prompt and --skill flags against an isolated session.
  • The raw JSONL first user entry contained only the test request—no Buzz base prompt.
  • A live /export showed the in-memory systemPrompt starts with the new Buzz prompt and includes the ## Buzz CLI section.
  • Pi confirmed buzz-cli is available; its loader resolved ~/.buzz/.agents/skills/buzz-cli/SKILL.md with zero diagnostics.

Focused launcher, environment, and Pi preset tests also passed (5 + 44 + 11).

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 enabled auto-merge (squash) September 4, 2026 20:26
@salman1993
salman1993 merged commit 4beffef into main Sep 4, 2026
139 of 142 checks passed
@salman1993
salman1993 deleted the smohammed/pi-buzz-context branch September 4, 2026 21:17
mfethe1 added a commit to mfethe1/buzz that referenced this pull request Sep 4, 2026
…n (5 commits: block#7134 sidebar unread, block#7293 IFC core, block#7335 Pi launcher, block#7338 mention chips, block#7336 video speed)

Conflict: crates/buzz-acp/src/lib.rs — fork session_store init and upstream
pi_launcher/base_prompt block were both added at the same point in main();
resolved by keeping both (fork block first, upstream block second).

Signed-off-by: Michael Feth <mfethe1@gmail.com>
baxen pushed a commit that referenced this pull request Sep 5, 2026
* origin/main:
  fix(desktop): keep packaged frontendDist relative so Windows embeds assets (#7177)
  fix(sidebar): simplify unread indicators and emphasize priority activity (#7134)
  Add generic information-flow control core (#7293)
  feat(buzz-acp): update base prompt; add buzz context and skills to Pi agents (#7335)
  fix(desktop): restore mention chip identity icons (#7338)
  Persist video playback speed preference (#7336)
  Verify ACP relay events before prompt routing (#7010)
  fix(buzz-acp): bound busy-owner hold to prevent cross-channel starvation (#7337)
  feat(desktop): invite owned agents from standalone forums (#7125)
  fix(desktop): authorize remote mentions at publication (#7124)
  fix(acp): rename system tag to agent-instructions (#7332)
  fix(desktop): bind duplicate mention selections to exact recipients (#7133)
  refactor(relay): extract NIP-29 membership authorization (#7285)
  chore(release): release Buzz Desktop version 0.5.22 (#7308)
  feat(desktop): preserve mentions across copy and paste (#7228)
  test(desktop): await Bestie drag and profile hover endpoints (#7294)

Signed-off-by: Fizz <400e8babadcee6a7f420103f10a2849d84c4a9c71d5bd04f3948c814216648a3@buzz.block.builderlab.xyz>
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.

2 participants