Skip to content

Bundle Goose behind a single runtime choice - #7858

Closed
salman1993 wants to merge 11 commits into
mainfrom
codex/bundled-goose
Closed

salman1993 wants to merge 11 commits into
mainfrom
codex/bundled-goose

Conversation

@salman1993

@salman1993 salman1993 commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Show one Goose choice with its existing icon. In internal macOS builds, it uses the pinned executable included with Buzz. Buzz Agent remains the default.

Existing Goose runtime selections use the bundled executable on their next local launch. Saved goose-bundled pilot selections load as goose. Builds without bundling retain the external Goose CLI.

Build goose-acp from a pinned upstream commit using the lean profile with native TLS and keyring support. Resolve the bundled executable from the app, and accept build-supplied provider/model defaults below existing Buzz selections, environment overrides, and Goose file settings. Launch, settings, and model discovery honor existing file settings. Build defaults travel separately from custom harness overrides. The bundled model applies only when the effective provider matches its bundled provider. Remote deployments preserve the existing goose acp command and explicit user settings, without bundled provider/model defaults. Absolute external Goose pins remain supported.

The bundle is pinned to Goose 4dea9b483efbd2541d43500b8ed3c044c65e6d2f, which includes the successful-tool-call warning fix and live model metadata. The online-model-meta feature is enabled, but this revision only initializes it in the full CLI. The lean goose-acp executable still uses the embedded catalog until upstream adds startup initialization.

The existing Goose configuration and credential locations are shared. This pilot does not establish parity for upstream shell cancellation or output limits.

Related issue

Related to #7742

Testing

Onboarding screenshot showing the single Goose choice.

  • just bundled-goose: built the pinned Apple Silicon artifact, about 15 MiB; only system dynamic-library dependencies.
  • With BUZZ_TEST_GOOSE_ACP set to the staged binary and BUZZ_TEST_BIN_DIR set to the built Buzz binaries, cargo test -p buzz-acp real_goose_native_git_shell -- --ignored --nocapture passed. The real Goose process used a scripted local provider and verified signed commits/tags, identity, credential scope, and key cleanup.
  • BUZZ_BUILD_BUNDLED_GOOSE_PROVIDER=databricks_v2 BUZZ_BUILD_BUNDLED_GOOSE_MODEL=test-model cargo test --manifest-path desktop/src-tauri/Cargo.toml --features bundled-goose --lib passed. Focused regressions also cover settings-display precedence for explicit and inherited model/provider choices.

The model-discovery regression was reproduced locally before the fix: a competing catalog entry replaced the bundled default. The strengthened test waits for that entry to appear before checking the default. All four Goose onboarding flows and the full local just ci gate pass after the review fixes. The bundled-feature suite now passes 3,393 tests (19 ignored), including saved pilot selections, discovery subprocess environment, provider/model pairing, and the shared remote deployment fixture. macOS CI runs this suite with populated build defaults.

Review regressions: pnpm --dir desktop test:e2e:smoke onboarding-agent-defaults.spec.ts --grep "bundled Goose|create Goose" passed all four flows. These cover file choices, environment overrides, provider switching, and creation without saved defaults. Removing the provider-pairing fix makes the switching test fail. Isolated native tests read a real Goose config file, verify the discovery child environment, and check launch/display precedence. Independent agent review found no remaining blockers.

The review fixes need a fresh human retest before marking this PR ready. With the existing internal build environment, run just desktop-standalone --features bundled-goose in the PR checkout; no Goose artifact rebuild is needed. Verify that existing Goose settings survive and that switching providers does not retain the bundled Databricks model when there is no explicit/file model override. Then send a prompt using the intended provider.

Signed app packaging, Intel macOS, and live Databricks/relay use still need qualification in the internal build.

Generated with Codex

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

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

🔐 Codex Security Review

Status: review required for the current range.

The current range is 0ee609379004a894e99b449885c37a044f41919e...514c970c288631ee76dc10e22b6f8df825bed263.
A new review must complete for this exact range. When manual authorization
is required, a user with write access must comment exactly
@buzz-security-review 514c970c288631ee76dc10e22b6f8df825bed263 to authorize a new review.
Any previous review applies only to its recorded range.

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
salman1993 added a commit that referenced this pull request Sep 25, 2026
@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 Updated onboarding screenshot.

One Goose choice

Goose uses its existing icon and the bundled executable in internal macOS builds. Buzz remains recommended.

single-goose

@salman1993 salman1993 changed the title Add opt-in bundled Goose runtime for macOS Bundle Goose behind a single runtime choice Sep 25, 2026
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>

# Conflicts:
#	desktop/src-tauri/src/managed_agents/discovery/tests.rs
@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 Reviewed c6741935bb9c5c2efd51e406905751af72cddae3 against the bundled-Goose pilot goal. I found three correctness issues:

  1. [P1] Existing Goose file choices are overridden by build defaults. desktop/src-tauri/src/managed_agents/discovery/catalog.rs:170-180 supplies GOOSE_PROVIDER/GOOSE_MODEL, and readiness.rs:229-230 injects both into every Goose child environment. If an existing Goose agent has its provider/model only in ~/.config/goose/config.yaml, the injected environment wins on its next launch, silently switching it to the internal default. The config surface also ranks these defaults ahead of the file (config_bridge/reader.rs:369-370,529-530). Preserve file values above the build fallback (or inject each fallback only when neither a higher layer nor the file defines it), and test an existing file-configured agent.

  2. [P1] Create-agent validation does not see Goose's bundled defaults. The new defaults reach the catalog definition_env, and the global settings form reads them, but desktop/src/features/agents/ui/AgentDefinitionDialog.tsx:421-445 passes only agent/global/file values into computeLocalModeGate; its required-field check at agentConfigOptions.tsx:736-746 knows nothing about definitionEnv. On a fresh installation without global or Goose file provider/model, Goose launches with build defaults but the create form reports provider/model missing and blocks creation. Feed runtime defaults into the gate and display/model discovery at the same precedence as launch; test fresh Goose creation.

  3. [P2] The global model display can disagree with launch. desktop/src/features/agents/ui/AgentConfigFields.tsx:293-305 returns bundled definitionEnv.GOOSE_MODEL before looking at config.env_vars. If the user sets GOOSE_MODEL in the advanced environment editor, the model control still labels the bundled model as the default, while readiness.rs:253-268 lets the user environment override it on launch. Prefer the user env value (also for GOOSE_PROVIDER) before showing the runtime fallback, and cover this precedence in a UI test.

I did not run the full test suite or signed-app flow; these are source-path findings. The companion packaging changes in squareup/buzz-releases#99 are needed for the installed sidecar and provenance manifest.

@salman1993

Copy link
Copy Markdown
Contributor Author

🤖 Checked current origin/main (b65cff31a) against finding 1. Existing Buzz provider/model selections and user GOOSE_PROVIDER / GOOSE_MODEL environment settings already override Goose's config file. When those overrides are absent, Goose uses its existing file configuration; main has no Goose-specific bundled provider/model defaults.

We will preserve that behavior in this PR: bundled defaults will fill missing values only below the existing Buzz overrides and Goose file settings. Switching to the bundled executable should not itself switch an existing user's provider/model. We will also align settings display and create-agent validation with that precedence, including honoring advanced GOOSE_PROVIDER / GOOSE_MODEL overrides. The internal build's shared Databricks defaults can mask the create-form gap, so the fresh-install failure described in finding 2 is conditional rather than universal.

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 marked this pull request as ready for review September 28, 2026 22:56
@salman1993
salman1993 requested a review from a team as a code owner September 28, 2026 22:56
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 28, 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-30T16:54:36.151211Z 514c970 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: b1c2aa92dd

ℹ️ 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 +30 to +31
if file_value.is_none() && std::env::var(&key).is_err() {
env.entry(key).or_insert(value);

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 Project inherited Goose settings into the effective env

When Desktop inherits GOOSE_PROVIDER or GOOSE_MODEL from its parent process and no Goose file value exists, this condition suppresses the bundled fallback but never copies the inherited value into EffectiveAgentEnv. goose_requirements only checks that map and the config file, so it reports the corresponding field missing and can start the otherwise configured agent in setup mode, even though the spawned child would inherit the value. Insert the inherited value into the effective map at the intended precedence, or make readiness evaluate the same inherited environment as spawn.

Useful? React with 👍 / 👎.

Signed-off-by: Salman Mohammed <smohammed@squareup.com>
Signed-off-by: Salman Mohammed <smohammed@squareup.com>
@salman1993
salman1993 marked this pull request as draft September 29, 2026 21:38
@salman1993
salman1993 marked this pull request as ready for review September 30, 2026 16:44

@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: 514c970c28

ℹ️ 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 +121 to +123
if args.is_empty() {
args.push("acp".into());
}

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 Prefix remote Goose arguments with the ACP subcommand

When a bundled Goose agent has nonempty direct-sidecar arguments, such as --with-builtin developer, remote deployment changes the executable to the external goose CLI but adds acp only when the argument list is empty. The resulting payload runs goose --with-builtin developer rather than goose acp --with-builtin developer, so it starts the normal CLI instead of an ACP process and the deployed harness cannot connect. Prepend acp whenever translating bundled Goose to the remote CLI, while avoiding a duplicate for legacy argument lists that already begin with it.

Useful? React with 👍 / 👎.

let remote_goose = !local
&& cfg!(all(feature = "bundled-goose", target_os = "macos"))
&& matches!(effective_command.as_str(), "goose" | "goose-acp");
let runtime_meta = known_acp_runtime(&effective_command);

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 Limit bundled defaults to the bundled Goose selection

In a bundled build, a custom harness pointing to an absolute external Goose binary such as /opt/homebrew/bin/goose is normalized by known_acp_runtime to the bundled Goose metadata. The local descriptor therefore applies the internal provider/model defaults even though custom catalog entries intentionally expose an empty configuration_defaults map; with no explicit or file settings, the supposedly external harness silently launches with the internal provider and model, and its UI metadata disagrees with spawn behavior. Determine bundled-default eligibility from the selected runtime/catalog entry or canonical bundled command rather than from the executable basename alone.

Useful? React with 👍 / 👎.

@salman1993

Copy link
Copy Markdown
Contributor Author

closing this PR since we decided to bundle goose in the new buzz 1.0 app. just merged here: block/buzz-app#497

@salman1993 salman1993 closed this Oct 1, 2026

This branch was successfully deployed

No deployments
codex-review — 514c970c Deployed Sep 30, 2026 by salman1993 via Run Codex Security Review #6230
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.

1 participant