Skip to content

Conversation

@lily-de
Copy link
Contributor

@lily-de lily-de commented Mar 12, 2025

UI changes

  • nothing in production, but allows for extensions to use the extensions manager like the CLI
  • no page that shows these changes yet -- next pr

Goose core changes

  • ExtensionConfig has a key() method, which is used to generate / get the key under which an extension goes
  • ExtensionManager methods use key for lookup now
  • Users still supply and interface with the name of the extension, key is purely for reading/writing the config file

eg

extensions:
  _computercontroller:
    enabled: false
    name: computercontroller
    timeout: 300
    type: builtin
  _developer:
    enabled: true
    name: developer
    timeout: null
    type: builtin
  _memory:
    enabled: true
    name: memory
    timeout: 300
    type: builtin
  _tutorial:
    enabled: false
    name: tutorial
    timeout: 300
    type: builtin

@lily-de lily-de force-pushed the ldelalande/extensions-read-config branch from 3fb3e04 to 238871a Compare March 12, 2025 02:25
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is autogenerated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is autogenerated

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this file is autogenerated

Copy link
Contributor Author

@lily-de lily-de Mar 12, 2025

Choose a reason for hiding this comment

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

  1. exported some structs via openapi so frontend uses same schema
  2. added a key() method that creates the key underwhich the extension should be stored

users will interact / supply / create names of extensions only, the key is purely for config storage and lookup under the hood and is abstracted away

@lily-de lily-de marked this pull request as ready for review March 12, 2025 17:17
@lily-de lily-de changed the title Ldelalande/extensions read config feat: extensions read config Mar 12, 2025
@michaelneale
Copy link
Collaborator

.bundle

@github-actions
Copy link
Contributor

macOS ARM64 Desktop App (Apple Silicon)

📱 Download macOS Desktop App (arm64, signed)

Instructions:
After downloading, unzip the file and drag the Goose.app to your Applications folder. The app is signed and notarized for macOS.

This link is provided by nightly.link and will work even if you're not logged into GitHub.

Copy link
Collaborator

@baxen baxen left a comment

Choose a reason for hiding this comment

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

LGTM! A few comments below

.required(false)
.items(
&extension_status
&disabled_extensions
Copy link
Collaborator

Choose a reason for hiding this comment

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

it looks like we are applying a similar filter twice below, should the existing iter/filter/map be removed or consolidated ?

}

pub fn name_to_key(name: &str) -> String {
format!("_{}", name)
Copy link
Collaborator

Choose a reason for hiding this comment

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

curious why we add the leading underscore - does this make it backwards incompatible with existing config files? also seems like it could be a bit odd to see if you manually edit your config

Copy link
Contributor Author

@lily-de lily-de Mar 13, 2025

Choose a reason for hiding this comment

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

yeah the editing is sort of an issue -- i don't think the keys should be arbitrary names and i also don't think they should be something the user defines because it's sort of a detail... anyway! am i going to just make the key the same as the name

this is an issue in the UI for example, asking them to define key and name is super confusing, so i wanted a way to abstract the key part out

Sort of think if you bork your config file extensions from bad manual edits that's sort of on you, but idk

)
)]
pub async fn read_all_config(
pub async fn update_extension(
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: this method is the same as add_extension except it raises an error if it already exists? i will look at the UX code below but usually in this case i'd suggest only having one method that creates or updates

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😂 wait that is actually kinda funny -- goose implemented a lot of this and tbh i had to do some moderate work to get it working end to end but i didn't notice this

)
)]
pub async fn update_extension(
pub async fn toggle_extension(
Copy link
Collaborator

Choose a reason for hiding this comment

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

similar comment as above, can we just use a single set meth to also set enabled/dsiabled? it would make sense to have this if in some cases the UI doesn't have the other components of the extension readily available. but if it does i usually would prefer keeping the surface area smaller

import React from "react";
import {useConfig} from "../../ConfigContext";

export function ConfigPage({ onClose }: { onClose: () => void }) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: is this a debugging tool? could add a comment

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thought i deleted this

@salman1993
Copy link
Contributor

salman1993 commented Mar 13, 2025

i ran the UI locally with just run-ui and tried to add builtin "tutorial" extension but didn't see any changes in goose/config.yaml - is that expected?

when i run goose configure via CLI, i see a new extension get added to config:

  _tutorial:
    enabled: true
    name: tutorial
    timeout: 100
    type: builtin

@lily-de
Copy link
Contributor Author

lily-de commented Mar 13, 2025

i ran the UI locally with just run-ui and tried to add builtin "tutorial" extension but didn't see any changes in goose/config.yaml - is that expected?

when i run goose configure via CLI, i see a new extension get added to config:

  _tutorial:
    enabled: true
    name: tutorial
    timeout: 100
    type: builtin

@salman1993 yes -- this doesn't actually update the state or anything in the UI yet... i just set up the backend routes and some functions in ConfigContext for the settings to use. I tested them in a dummy page, but to try to keep an already beefy PR as small as possible, a follow up PR i am currently working on will actually include those changes

@lily-de
Copy link
Contributor Author

lily-de commented Mar 13, 2025

@baxen -- i have already started implementing some stuff using these routes (toggle and update) -- to avoid a rebase on my branch, with your blessing, i would like to merge this as is and promise i will get rid the two routes in my next PR and re-work the frontend client calls to only need add . i am lazy to do it right now (but can!) but i will do it 🙏

@lily-de lily-de merged commit 4537264 into main Mar 13, 2025
6 checks passed
@lily-de lily-de deleted the ldelalande/extensions-read-config branch March 13, 2025 01:41
michaelneale added a commit that referenced this pull request Mar 14, 2025
* main: (32 commits)
  ui: load builtins (#1679)
  chore(release): release version 1.0.14 (#1676)
  Revert "feat: handling larger more complex PDF docs (and fix) (#1663)" (#1675)
  fix: uvshim default to existing uv configuration (#1670)
  fix: handle interruptions during tool responses (#1651)
  feat: Copy error message button in toast (#1658)
  feat: handling larger more complex PDF docs (and fix) (#1663)
  Add Filesystem Tutorial (#1666)
  docs: figma blog post (#1647)
  docs: updating goose modes doc (#1665)
  docs: Add running tasks guide (#1626)
  docs: Add experimental features (#1644)
  feat(cli): add better error message, support stdin via -i - or just no args (#1660)
  feat: extensions read config (#1637)
  fix: trigger words for memory (#1654)
  fix: cleanup keyboard shortcut indication (#1642)
  Extensions load in background and show pending state (#1657)
  Extension error toast stays until dismissed, and error message cleanup (#1653)
  fix: remove other category in settings (#1641)
  fix: restore image outputs from tool calls (#1640)
  ...
ahau-square pushed a commit that referenced this pull request May 2, 2025
cbruyndoncx pushed a commit to cbruyndoncx/goose that referenced this pull request Jul 20, 2025
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.

5 participants