Skip to content

fix(acp): improve hints in pi agent setup guide - #7594

Merged
salman1993 merged 2 commits into
mainfrom
smohammed/fix-pi-adapter-setup
Sep 12, 2026
Merged

fix(acp): improve hints in pi agent setup guide#7594
salman1993 merged 2 commits into
mainfrom
smohammed/fix-pi-adapter-setup

Conversation

@salman1993

Copy link
Copy Markdown
Contributor

Summary

Handle missing Pi adapter setup and update its install guidance.

Related issue

None found.

Testing

No manual testing.

Generated with Amp

@salman1993
salman1993 requested a review from a team as a code owner September 11, 2026 20:09
@github-actions

github-actions Bot commented Sep 11, 2026

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

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

@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-11T20:14:20.459298Z e7ee3be 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.

@salman1993 salman1993 changed the title fix(acp): handle missing Pi adapter setup fix(acp): improve hints in pi agent setup guide Sep 11, 2026

@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: e7ee3be287

ℹ️ 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 on lines +195 to +197
RequirementPayload::MissingBinary { command } => {
format!("install `{command}` or add it to PATH")
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Route missing-binary nudges away from Edit Agent

When buzz-pi-acp is absent, this new variant now reaches the desktop card, but ConfigNudgeCard does not classify missing_binary as informational or Doctor-routed: shouldOpenDoctor is false and informationalOnly omits it, so clicking the card opens Edit Agent. That surface cannot install a binary or repair PATH and does not expose the Pi install guidance added to Agent runtimes; route Pi's missing adapter there, or make generic missing-binary cards non-clickable.

Useful? React with 👍 / 👎.

Comment thread crates/buzz-acp/TESTING.md

@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 e7ee3be287f929136327162e3913be8ec60a7f14 against base e17cdd9d5c7e2b836b4670ae88bb87a79f94337a.

The new enum variant fixes the actual producer/consumer mismatch: Desktop already emits missing_binary, which previously made ACP exit while parsing the setup payload. Two recovery defects remain on the newly reachable path:

P2: Keep the Desktop missing-binary card out of Edit Agent

crates/buzz-acp/src/setup_mode.rs:195-197 now makes this requirement reach ConfigNudgeCard, but Desktop replaces the Rust prose with that card. informationalOnly omits missing_binary, and shouldOpenDoctor returns false, so its trigger opens Edit Agent instead of showing the Pi installation guidance in Agent runtimes. The new Rust test's !body.contains("Open Edit Agent") does not protect the actual Desktop behavior.

Reproduction: start a Pi agent without buzz-pi-acp, mention it, and click its configuration card. It opens Edit Agent, which cannot install the adapter or repair PATH. A focused probe using the exact new Rust fixture and production card function confirmed Open Edit Agent for Carol and an Edit Agent dispatch, with no Settings dispatch. See desktop/src/shared/ui/config-nudge-attachment.tsx:190-220,281-289 and desktop/src/shared/ui/markdown.tsx:1832-1839.

Route recognized preset installation requirements to Agent runtimes, or make the generic missing-binary card informational rather than clickable. Ensure the displayed card includes the necessary recovery instruction. Add coverage at the card consumer, not only the Rust prose.

P2: Tell users to restart Buzz, not only the agent

The new footer at crates/buzz-acp/src/setup_mode.rs:281-282 gives an insufficient recovery action. Desktop's resolve_command caches missing binaries for the app lifetime (discovery.rs:426-452). After an external npm install into an existing PATH directory, restarting the agent reuses cached None and emits the same setup payload again. Both the pair restart command and the frontend stop/start route reach spawn_agent_child without refreshing discovery (runtime_commands.rs:244-315,386-392; managedAgentRuntimeHooks.ts:163-201).

Reproduction: let Desktop classify buzz-pi-acp as missing, install it externally, then restart only the agent without a forced runtime recheck. It remains in setup mode despite the executable now existing. A focused probe of the production cache functions confirmed that creating the missing file does not change resolution until clear_resolve_cache is called.

The smallest fix is to say restart Buzz, matching the new preset install hint. Alternatively instruct an explicit runtime recheck followed by agent restart. No new cache/recovery subsystem is needed.

Non-blocking: crates/buzz-acp/TESTING.md:4-9 calls the adapter pinned but installs #main, whereas the preset uses #86b201e. Align those references for reproducible validation. I confirmed the existing Codex card-routing finding; the documentation-pin comment is a consistency issue, not a demonstrated current install failure. The fork is two commits ahead of the pin, but the verified comparison changes only README.md, not adapter code.

Validation: exact-head source tracing, clean-tree git diff --check, focused production-card and cache probes with dependencies mocked at their boundaries. No full local suites, global npm install, live relay nudge, or native Desktop workflow run. Existing CI covers ACP and Tauri tests, but major test/build checks were unfinished in the one status snapshot; this is not a green-CI claim.

@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.

Changes required. Source-only review of head e7ee3be287f929136327162e3913be8ec60a7f14 against base e17cdd9d5c7e2b836b4670ae88bb87a79f94337a.

The new MissingBinary variant repairs the existing Desktop → ACP serialization mismatch. The intended contract is a recoverable missing-adapter state, with Desktop remaining the sole readiness authority. Two P2 recovery defects remain on this newly reachable path. They are already detailed in the concurrent human-requested review; this automation record does not duplicate its inline findings or adopt its runtime-test claims.

  1. P2: The displayed Desktop nudge still opens Edit Agent and hides recovery instructions. Start an existing Pi agent without buzz-pi-acp, mention it, then click its configuration card. The new requirement at crates/buzz-acp/src/setup_mode.rs:195-197 reaches the card, but computeConfigNudge.ts:42-46 suppresses the Rust prose. desktop/src/shared/ui/config-nudge-attachment.tsx:190-220,281-289 treats missing-binary-only cards as clickable Edit Agent cards; its row at 386-398 only says install/check PATH. Edit Agent cannot perform this installation, and the new Rust prose assertion does not cover the actual card. Make a generic missing-binary-only card informational, or route recognized preset installation needs to Agent runtimes, and show the recovery instruction in the card itself.
  2. P2: “Restart the agent” is insufficient after manual installation. The new footer at crates/buzz-acp/src/setup_mode.rs:281-282 omits the necessary cache refresh. Reproduction: let Desktop resolve buzz-pi-acp as absent, install it externally into an existing PATH directory, then restart only the agent without a forced runtime recheck. desktop/src-tauri/src/managed_agents/discovery.rs:426-452 retains cached None; the stop/start path in managedAgentControlActions.ts:88-106commands/agents.rs:163-282managed_agents/runtime.rs:877-932 reaches readiness without clearing that cache. The agent returns to setup mode. The smallest fix is restart Buzz, matching the new preset hint, or explicitly recheck runtimes and then restart the agent. No new recovery subsystem is required.

Non-blocking: crates/buzz-acp/TESTING.md:4-9 calls its install pinned while using mutable #main; production pins #86b201e. Align the documentation for reproducible validation. The independent adapter/install lane found no additional source-backed install blocker; a live npm installation was not performed.

Validation: exact-head source/diff review on Wes’s Studio; inspected payload producers/consumers, malformed-input fallback, authorization gating, startup/listener/restart paths, discovery invalidation, and Desktop prose/card rendering. Non-card clients retain the prose; no matching specialized nudge consumer was found in the searched mobile/lib and web/src trees. No checkout, build, tests, dependency installation, PR-code execution, or live Desktop workflow was performed by this automation. This is not a green-CI claim.

@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 @wesbillman, the requested fixes are pushed. When you have a moment, could you please re-review? Thank you!

@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.

Re-review: both prior P2 findings are resolved. No remaining source-backed blockers in the reviewed fixes. Reviewed head fee8c88c447db5fe393d6d472229bf31d073d165 against base e17cdd9d5c7e2b836b4670ae88bb87a79f94337a, focusing on changes since e7ee3be287f929136327162e3913be8ec60a7f14.

  • Desktop recovery route fixed. config-nudge-attachment.tsx:57-79,204-234,285-303,400-413 routes missing-binary cards to Agent runtimes, labels that action correctly, and visibly renders the recovery instructions. The fix reaches the actual card rather than relying on Rust prose that Desktop hides.
  • Restart guidance fixed. crates/buzz-acp/src/setup_mode.rs:281-282 and the rendered Desktop row now instruct users to install/update PATH, then restart Buzz. That satisfies the agreed recovery contract despite the existing negative command-resolution cache. No cache redesign is needed.
  • Documentation discrepancy resolved. crates/buzz-acp/TESTING.md:4-16 explicitly distinguishes the development adapter on main from the reviewed revision pinned for Desktop users and supplies the Node/Pi/PATH prerequisites.

This resolves the two P2s from the previous source review. The added Desktop tests import the production routing/copy helpers; direct source inspection confirms the card consumes them. Independent Desktop review returned the same disposition.

Validation: exact-commit source/diff inspection on the Studio and clean git diff --check. No checkout, builds, tests, dependency installation, PR-code execution, live npm install, or native Desktop workflow was performed. The tests were inspected, not run; no green-CI claim. This is a non-approval review comment, not a GitHub approval.

@salman1993
salman1993 enabled auto-merge (squash) September 11, 2026 21:49

@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: both prior P2 recovery findings are resolved. Reviewed head fee8c88c447db5fe393d6d472229bf31d073d165 against base e17cdd9d5c7e2b836b4670ae88bb87a79f94337a, focusing on the remediation since e7ee3be287f929136327162e3913be8ec60a7f14 and consuming the existing exact-head re-review.

The contract remains recoverable missing-adapter setup, with Desktop as the sole readiness authority. No new readiness/cache subsystem is needed.

  • Desktop recovery route fixed. desktop/src/shared/ui/config-nudge-attachment.tsx:57-79,204-234,285-303,400-413 routes missing-binary cards to Agent runtimes, supplies the matching visible/accessibility action label, and renders installation/PATH/restart guidance in the actual card. The fix does not rely on prose that Desktop suppresses. The new tests import the production routing/copy helpers, and source inspection confirms the component consumes them.
  • Restart guidance fixed. crates/buzz-acp/src/setup_mode.rs:270-282,753-768 and the Desktop row now say restart Buzz, addressing the existing app-lifetime negative resolution cache. The current producer emits missing-binary as a single requirement (readiness.rs:433-441); hypothetical mixed payloads do not justify expanding this repair. Desktop serialization, ACP deserialization, and the existing frontend requirement validator agree on missing_binary plus command.
  • Documentation discrepancy resolved. crates/buzz-acp/TESTING.md:3-16 explicitly distinguishes development main from the pinned user-facing runtime catalog. The production install pin is unchanged from the earlier reviewed head.

Validation: exact-commit source/diff inspection on Wes’s Studio and git diff --check for the stated base/head. Independent Desktop source review integrated. Reused prior evidence for unchanged listener authorization/reconnect behavior and adapter installation; no fresh broad investigation of those paths. Non-card clients retain the corrected prose; remote deployment is outside this host-readiness change (docs/remote-agents.md:595-611). No checkout, build, tests, dependency installation, PR-code execution, live npm installation, or native Desktop workflow was performed. Tests were inspected, not run; no green-CI claim. This is a non-approval review comment.

salman1993 and others added 2 commits September 12, 2026 12:59
Amp-Thread-ID: https://ampcode.com/threads/T-01a091db-fdb0-70de-a926-3863bb37dd2d
Co-authored-by: Amp <amp@ampcode.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 force-pushed the smohammed/fix-pi-adapter-setup branch from fee8c88 to e719cd8 Compare September 12, 2026 17:02

@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 remaining source-backed blockers in the missing-binary recovery change. Reviewed head e719cd85e91e9f0ef2ba5d571224571a852a3207 against base f3940ff21e8b6050ff617c645578aefa45db7e9f.

The contract remains recoverable missing-adapter setup, with Desktop as the sole readiness authority. Both earlier P2 findings remain resolved at this head; this review also consumed the prior remediation review.

  • Producer/consumer agreement: Desktop’s existing missing_binary + command payload now deserializes in ACP, survives sentinel serialization, and matches the Desktop validator (runtime/setup_payload.rs:78-81, crates/buzz-acp/src/setup_mode.rs:119-120,232-239,303-308, configNudge.ts:168-169). The setup listener retains its existing authorization and mention gates; no adapter process is started on this branch.
  • Actual Desktop recovery: the rendered card routes to Settings → Agents, supplies the matching visible/accessibility label, and displays install/PATH/restart Buzz instructions (config-nudge-attachment.tsx:67-79,204-234,285-303,400-413). The destination includes runtime installation guidance and “Check again.” The Rust prose also says restart Buzz (setup_mode.rs:281-282), matching the app-lifetime negative command cache. Current readiness emits missing-binary alone (readiness.rs:433-441), so hypothetical mixed payloads do not require new machinery here. Independent frontend source review returned clear and was integrated.
  • Adapter guidance: the pinned fork revision resolves to 86b201e835d7bdb87d623da561aa916c95dc8925; its package declares the buzz-pi-acp executable and build packaging. Development docs now explicitly distinguish mutable main from the user-facing pin. The added regression tests call the production parser/routing/copy functions, and the card consumes those helpers.

Validation: exact-head source/diff inspection on Wes’s Studio and git diff --check for the stated base/head. Checked startup → readiness payload → ACP listener → Desktop card and discovery refresh, plus the pinned adapter’s package/build metadata. Non-card clients retain the corrected prose; no specialized nudge consumer matched the searched mobile/lib and web/src trees. Remote deployment and external CLI authentication behavior are outside this local missing-binary repair.

No checkout, builds, tests, dependency installation, PR-code execution, live npm installation, or native Desktop workflow was performed. Tests were inspected, not run; no green-CI claim. This is a non-approval review comment.

@salman1993
salman1993 merged commit 6c35e82 into main Sep 12, 2026
78 of 80 checks passed
@salman1993
salman1993 deleted the smohammed/fix-pi-adapter-setup branch September 12, 2026 17:40
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