Skip to content

Add Pi agents with local model discovery - #216

Merged
salman1993 merged 5 commits into
mainfrom
codex/pi-harness
Sep 24, 2026
Merged

salman1993 merged 5 commits into
mainfrom
codex/pi-harness

Conversation

@salman1993

@salman1993 salman1993 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Why

Buzz can run locally configured Pi agents, but needs to preserve the selected provider/model and discover extension-provided models before starting an agent. This adds Pi through the existing agent-control and model-picker paths.

What

  • Offer Pi as a harness and browse provider-qualified models from local Pi configuration, including extensions.
  • Save the exact provider/model pair, retain custom IDs, and warn about incomplete or unlisted selections. Catalog discovery and launch share selection validation, rejecting unsupported commas, leading dashes, and oversize provider/model IDs while preserving namespace slashes in model IDs.
  • Show progress inside the model dropdown and cap its visible results area at 320px, retaining scrolling and search across the full catalog.
  • Resolve Pi, Node, workspace, arguments and environment consistently for catalog lookup and ACP launch; cancel lookup processes when their request ends.
  • Keep catalog discovery prompt-free with a restricted argument set while preserving adapter-supported arguments for runtime.

How

Native discovery runs a short-lived Pi RPC process and requests only its available-model catalog. It reuses the model host's existing ticket and cancellation ownership. Credentials remain native; discovery neither saves settings nor starts a Buzz agent.

Risk

Goose #214 is merged. This PR is rebased onto main and contains only the Pi layer. Pi relies on locally installed pi, buzz-pi-acp and Node, and an invalid custom model can fail only on the first message.

Testing

  • After the review fix, the installed-Pi native catalog probe returned 112 models across four providers. The catalog regression rejected custom/a,b only after the fix; boundary coverage also preserves valid namespaced IDs.

  • The existing Chromium/WebKit model-picker journey now checks bounded popup geometry, scrolling and searching beyond the initial visible results using an opt-in 20-model fixture. No browser cases were added or removed.

  • On the earlier Goose-based snapshot 0d138b8, the opt-in native probe used the installed Pi through the production context (including Advanced arguments) and returned 112 models across four providers without sending a prompt.

  • Before the rebase, an actual ACP session/new probe reported the requested provider-qualified model and catalog without sending a relay message or inference prompt.

  • No browser cases added or removed. CI exposed a custom buzz-agent path incorrectly inheriting bundled provider choices; executable-name fallback is now limited to Goose and Pi. The component regression failed before the repair and passed afterward. The existing model-picker journey passed in Chromium and WebKit, including the controlled-frame Escape boundary. The migrated component assertion waits for the shared combobox's deferred opening; an immediate assertion failed before that correction.

  • Deferred: native desktop create/edit → save → restart → first-message round trip, real provider authentication/inference, signed release packaging and internal extension provisioning. Ready to try locally, not fully validated for live use.

Generated with Codex

@salman1993
salman1993 added this pull request to stack #217 September 24, 2026 15:32
Base automatically changed from codex/goose-harness to main September 24, 2026 18:14
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 marked this pull request as ready for review September 24, 2026 18:46
@salman1993
salman1993 requested review from a team, comp615 and wesbillman as code owners September 24, 2026 18:46
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 24, 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-24T18:51:31.473335Z 6cafab4 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: 6cafab476f

ℹ️ 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 src-tauri/src/pi_models.rs Outdated
Comment on lines +97 to +101
if [provider, id]
.iter()
.any(|s| s.is_empty() || s.len() > 512 || s.chars().any(char::is_control))
|| provider.contains('/')
{

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 Reject catalog IDs that runtime cannot launch

When a Pi extension returns a provider or model ID containing a comma or beginning with -, this parser accepts it, so Browse exposes it and the editor can save it; however, PiContext::adapter_args rejects those same values during Start as an invalid provider/model ID. Validate catalog entries with the runtime's selection constraints so every selectable catalog result can actually launch.

Useful? React with 👍 / 👎.

@salman1993

Copy link
Copy Markdown
Contributor Author

screenshots from testing:

Screenshot 2026-09-24 at 2 59 42 PM Screenshot 2026-09-24 at 2 59 32 PM

@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 requested: one P2 catalog-to-launch contract defect. Reviewed head 6cafab476f68fc40c2e6f4db18c5d37f5557a1b6 against base 8842b3ac05862e069ab0adf2f30e11a3af084042, integrating independent UI, runtime, and process-lifecycle reviews.

I independently confirm the existing catalog-ID finding, rather than opening a duplicate thread. A catalog entry such as provider custom, model a,b passes parse_response, is selectable and saveable, but fails PiContext::adapter_args before launch. Leading-dash values have the same mismatch. The merge criterion is consistent supported-selection validation at the catalog boundary, with regressions proving rejected runtime values are not offered as selectable models. Preserve valid namespaced IDs.

No additional material blocker found in provider/model persistence, stale lookup fencing, or subprocess/ticket ownership. Current required CI is green: 2,871 frontend tests, native/tool integration, and Chromium/WebKit journeys. Broad suites were not rerun locally. Earlier installed-Pi/ACP probes predate the rebase; desktop create/edit → save → restart → first message, real authentication/inference, and signed packaging remain unverified, not proven by synthetic CI.

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>

@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: previous P2 resolved; no remaining code blockers found. Reviewed head 834a82be7b9d09def8d391c666c385e8eed5bc4e against base 8842b3ac05862e069ab0adf2f30e11a3af084042, focusing on changes since 6cafab476f68fc40c2e6f4db18c5d37f5557a1b6.

Catalog discovery and adapter launch now share selection validation, including persistence-compatible byte limits. The original comma/leading-dash mismatch is closed, with regression coverage preserving namespaced IDs. The new dropdown progress and bounded scrolling changes have no material finding after independent review. A focused isolated Chromium/WebKit probe confirmed loading text remains accessible in the popup and the outside status is aria-hidden until dismissal.

Required CI is green, including native/tool integration and Chromium/WebKit journeys. Broad suites were not rerun locally. Real desktop save → restart → first-message behavior, provider authentication/inference, and signed packaging remain unverified. This supersedes my previous changes-requested verdict; no approval is being submitted.

@wesbillman
wesbillman dismissed their stale review September 24, 2026 19:35

Carl: the original P2 is fixed at 834a82b. Verified re-review #216 (review) finds no remaining code blockers. Withdrawing the obsolete blocking verdict; no approval submitted.

@salman1993
salman1993 merged commit 46820f1 into main Sep 24, 2026
12 checks passed
@salman1993
salman1993 deleted the codex/pi-harness branch September 24, 2026 20:03
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