-
Notifications
You must be signed in to change notification settings - Fork 4.3k
fix(acp): improve hints in pi agent setup guide #7594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,58 +1,29 @@ | ||
| # Pi adapter integration | ||
|
|
||
| Buzz's Pi preset uses [salman1993/pi-acp](https://github.com/salman1993/pi-acp). | ||
| Requires Node.js 22 or newer. Install Pi and configure its model provider, | ||
| then install the adapter directly from the fork: | ||
| Buzz uses the [buzz-pi-acp fork](https://github.com/salman1993/buzz-pi-acp). | ||
| Install Node.js 22 or newer, configure Pi, and install the latest development | ||
| adapter from the fork's `main` branch: | ||
|
|
||
| ```sh | ||
| npm install -g @earendil-works/pi-coding-agent | ||
| pi | ||
| npm install -g --install-links=true git+https://github.com/salman1993/pi-acp.git#main | ||
| npm install -g --install-links=true 'git+https://github.com/salman1993/buzz-pi-acp.git#main' | ||
| ``` | ||
|
|
||
| Restart Buzz, then select **Pi** as the agent harness. Buzz starts `buzz-pi-acp` | ||
| automatically. Run the same adapter install command again to update it. | ||
| The unscoped `npm install -g pi-acp` command installs the upstream package, | ||
| without these extensions. Use fresh sessions to replace old user-framed | ||
| standing instructions. | ||
| This test setup intentionally tracks `main`; the Desktop runtime catalog pins a | ||
| reviewed adapter revision for users. | ||
|
|
||
| Buzz adds `-- --skill <harness-cwd>/.agents/skills` when launching `buzz-pi-acp`. | ||
| An existing separator and explicit Pi options are preserved. Managed agents | ||
| run from the Buzz nest (normally `~/.buzz`): Desktop sets the `buzz-acp` child | ||
| CWD through `default_agent_workdir()`, and adapters inherit it. The default | ||
| skill directory is that launch workspace's `.agents/skills`. Standalone CLI | ||
| launches use the caller's working directory. | ||
| The path is fixed at adapter launch and applies to every Pi subprocess. | ||
| Make sure `pi` and `buzz-pi-acp` are on PATH, then restart Buzz. | ||
|
|
||
| The full composed session prompt is sent as a replacement string through the | ||
| provisional `session/new.params._meta.systemPrompt` field. Buzz recognizes | ||
| `buzz-pi-acp` by the agent name returned during initialization, regardless of | ||
| protocol version. Upstream `pi-acp` does not receive this fork-specific metadata. | ||
| No custom capability negotiation or legacy Pi prompt fallback is used. | ||
| Session titles continue to use `_meta.sessionTitle`. | ||
|
|
||
| ## Validation | ||
|
|
||
| Activate Hermit from the Buzz repository root, then run the package tests: | ||
| ## Tests | ||
|
|
||
| ```sh | ||
| . ./bin/activate-hermit | ||
| cargo test -p buzz-acp | ||
| ``` | ||
|
|
||
| To exercise the real adapter through Buzz's production session composer: | ||
| Run the ignored real-adapter test with a built fork checkout: | ||
|
|
||
| ```sh | ||
| BUZZ_TEST_PI_ACP=/absolute/pi-acp/dist/index.js \ | ||
| BUZZ_TEST_PI_ACP=/absolute/buzz-pi-acp/dist/index.js \ | ||
| cargo test -p buzz-acp real_pi_preserves -- --ignored | ||
| ``` | ||
|
|
||
| This test requires Node and Pi on PATH. It isolates HOME and Pi settings, | ||
| disables extensions and context files, and uses a synthetic transcript without | ||
| model calls. It inspects Pi's effective prompt through RPC HTML export after | ||
| switching sessions and restarting the adapter. Base, persona, team, core memory, | ||
| huddle, canvas, and the extra skill must each appear once, without another | ||
| session's instructions or Pi's default coding preamble. | ||
|
|
||
| HTML export reports the exporting process's current system prompt. It cannot | ||
| recover a historical prompt from an old transcript alone. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -116,6 +116,8 @@ pub(crate) enum RequirementPayload { | |
| }, | ||
| /// Git for Windows is missing; open Agent runtimes for the installation guide. | ||
| GitBash, | ||
| /// A custom harness command could not be resolved in the current PATH. | ||
| MissingBinary { command: String }, | ||
| } | ||
|
|
||
| impl RequirementPayload { | ||
|
|
@@ -190,6 +192,9 @@ impl RequirementPayload { | |
| RequirementPayload::GitBash => { | ||
| "install Git for Windows (open Agent runtimes in Settings to diagnose)".to_string() | ||
| } | ||
| RequirementPayload::MissingBinary { command } => { | ||
| format!("install `{command}` or add it to PATH") | ||
| } | ||
|
Comment on lines
+195
to
+197
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| } | ||
| } | ||
| } | ||
|
|
@@ -262,13 +267,19 @@ impl SetupPayload { | |
| .requirements | ||
| .iter() | ||
| .all(|r| matches!(r, RequirementPayload::CliConfigInvalid { .. })); | ||
| let all_missing_binary = self | ||
| .requirements | ||
| .iter() | ||
| .all(|r| matches!(r, RequirementPayload::MissingBinary { .. })); | ||
| let any_external = self | ||
| .requirements | ||
| .iter() | ||
| .any(|r| matches!(r, RequirementPayload::CliConfigInvalid { .. })); | ||
|
|
||
| let footer = if has_doctor_requirement { | ||
| "Open Agent runtimes in Settings, install Git for Windows, then re-check and restart the agent.".to_string() | ||
| } else if all_missing_binary { | ||
| "Install the missing binary or update PATH, then restart Buzz.".to_string() | ||
| } else if all_external { | ||
| // All requirements are external config files — Edit Agent cannot | ||
| // help. Don't send the user there. | ||
|
|
@@ -739,6 +750,23 @@ mod tests { | |
| )); | ||
| } | ||
|
|
||
| #[test] | ||
| fn setup_payload_deserializes_missing_binary_requirement() { | ||
| let payload = SetupPayload::from_raw_env_value(Some( | ||
| r#"{"agent_name":"Carol","agent_pubkey":"test","requirements":[{"surface":"missing_binary","command":"buzz-pi-acp"}]}"#.to_string(), | ||
| )) | ||
| .unwrap() | ||
| .expect("missing_binary payload must parse"); | ||
| assert!(matches!( | ||
| payload.requirements.as_slice(), | ||
| [RequirementPayload::MissingBinary { command }] if command == "buzz-pi-acp" | ||
| )); | ||
| let body = payload.nudge_body(); | ||
| assert!(body.contains("install `buzz-pi-acp` or add it to PATH")); | ||
| assert!(body.contains("restart Buzz")); | ||
| assert!(!body.contains("Open Edit Agent")); | ||
| } | ||
|
|
||
| #[tokio::test] | ||
| async fn authorized_workflow_nudge_mentions_effective_owner_not_relay_signer() { | ||
| let agent_keys = nostr::Keys::generate(); | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.