-
Notifications
You must be signed in to change notification settings - Fork 4.5k
goose2 distribution bundling #8911
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
Open
jamadeo
wants to merge
16
commits into
main
Choose a base branch
from
jamadeo/goose2-bundle-config
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 12 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
bc58026
distro config
jamadeo 98f7148
just providers for now
jamadeo 859a497
name
jamadeo 361978b
update
jamadeo 584320e
Merge remote-tracking branch 'origin/main' into jamadeo/goose2-bundle…
jamadeo 3db4794
rm empty
jamadeo 3b20157
version YAGNI
jamadeo f1f4ec4
dev, examples, feature flag
jamadeo 00ff795
format
jamadeo 39962c7
dont need this
jamadeo 001a90f
additional config
jamadeo 78e708f
clippy
jamadeo 64dfee2
Merge remote-tracking branch 'origin/main' into jamadeo/goose2-bundle…
jamadeo 91518d0
rm test that sets env
jamadeo f70136b
feedback
jamadeo 1dafea4
Merge remote-tracking branch 'origin/main' into jamadeo/goose2-bundle…
jamadeo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| # Goose2 distro bundles | ||
|
|
||
| A Goose2 distro bundle is an optional app-specific package of configuration and policy that the Tauri shell loads at startup. | ||
|
|
||
| ## What a distro bundle is | ||
|
|
||
| A distro bundle lives under `ui/goose2/distro/` in development, and is bundled into the packaged app as a Tauri resource in production. | ||
|
|
||
| Current supported files: | ||
|
|
||
| - `distro.json` — distro manifest | ||
| - `config.yaml` — optional Goose config passed to `goose serve` | ||
| - `bin/` — optional executables or helper scripts prepended to `PATH` for `goose serve` | ||
|
|
||
| ## How it is discovered | ||
|
|
||
| The Tauri app resolves the distro bundle in this order: | ||
|
|
||
| 1. `GOOSE_DISTRO_DIR`, if set | ||
| 2. bundled Tauri resource dir at `resource_dir()/distro` | ||
|
|
||
| In development, `just dev` and `just dev-debug` automatically export `GOOSE_DISTRO_DIR` to `ui/goose2/distro` when that directory exists. | ||
|
|
||
| ## Manifest shape | ||
|
|
||
| Example: | ||
|
|
||
| ```json | ||
| { | ||
| "appVersion": "development", | ||
| "featureToggles": { | ||
| "costTracking": false | ||
| }, | ||
| "security": { | ||
| "providerAllowlist": "databricks" | ||
| } | ||
| } | ||
| ``` | ||
|
|
||
| ### Fields | ||
|
|
||
| - `appVersion?: string` | ||
| - optional app version tag supplied by the distro | ||
|
|
||
| - `featureToggles?: Record<string, boolean>` | ||
| - optional UI/product flags controlled by the distro | ||
| - currently supported: | ||
| - `costTracking` | ||
| - `false` hides cost UI in the token/context usage surfaces | ||
| - omitted behaves as enabled | ||
|
|
||
| - `security?: { providerAllowlist?: string, extensionAllowlist?: string }` | ||
| - optional policy controls | ||
| - currently used: | ||
| - `providerAllowlist` | ||
| - comma-separated provider ids | ||
| - limits visible model providers in Settings | ||
| - limits visible Goose model options in the chat model picker | ||
|
|
||
| ## Runtime effects | ||
|
|
||
| When a distro bundle is present, Goose2 does two kinds of things with it. | ||
|
|
||
| ### Frontend behavior | ||
|
|
||
| The frontend loads `get_distro_bundle` during app startup and stores the manifest in Zustand. | ||
|
|
||
| Today it uses that manifest to: | ||
|
|
||
| - filter model providers shown in provider settings via `providerAllowlist` | ||
| - filter Goose model options shown in the chat input model picker via `providerAllowlist` | ||
| - hide cost UI when `featureToggles.costTracking === false` | ||
|
|
||
| ### Backend / shell behavior | ||
|
|
||
| When the Tauri shell launches the long-lived `goose serve` process, it applies the distro bundle like this: | ||
|
|
||
| - prepends `distro/bin` to `PATH` when present | ||
| - adds `distro/config.yaml` to `GOOSE_ADDITIONAL_CONFIG_FILES` when present | ||
| - sets `GOOSE_DISTRO_DIR` to the resolved distro root | ||
|
|
||
| This is shell-level behavior, so it is implemented as Tauri-side setup rather than an ACP method. | ||
|
|
||
| ## Development notes | ||
|
|
||
| - packaged apps discover distro content from bundled Tauri resources | ||
| - local development uses `GOOSE_DISTRO_DIR` | ||
| - after changing `distro.json`, restart `just dev` so startup reloads the manifest | ||
|
|
||
| ## Scope guidance | ||
|
|
||
| Use distro bundles for packaged-app policy and shell-level defaults. | ||
|
|
||
| Good fits: | ||
|
|
||
| - feature flags for Goose2 UI behavior | ||
| - allowlists that constrain visible product choices | ||
| - config or helper binaries that should be present when `goose serve` starts | ||
|
|
||
| Avoid using distro bundles as a replacement for normal app state, user settings, or ACP-backed domain data. |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| { | ||
| "featureToggles": { | ||
| "costTracking": true | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| use crate::services::distro_bundle::{DistroBundleInfo, DistroBundleState}; | ||
| use tauri::State; | ||
|
|
||
| #[tauri::command] | ||
| pub fn get_distro_bundle(state: State<'_, DistroBundleState>) -> DistroBundleInfo { | ||
| state.info() | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting
GOOSE_ADDITIONAL_CONFIG_FILEShere overwrites any value inherited from the parent environment, so existing extra config layers are dropped whenever a distro config is present. In deployments that already rely on this env var (for policy or per-site defaults), those files stop loading after this change; append the distro path to the existing value instead of replacing it.Useful? React with 👍 / 👎.