-
Notifications
You must be signed in to change notification settings - Fork 2.1k
feat: external goosed server #5978
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
base: main
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds support for connecting the desktop application to an external goosed server instead of always launching a local bundled instance. Users can configure an external server URL and secret key through a new settings UI, enabling scenarios like connecting to a remote development server or a shared team instance.
Key Changes:
- Adds external backend configuration interface with URL and secret key settings
- Refactors
startGoosedfunction to return a structured result object withbaseUrlinstead of just a port - Implements graceful error handling that offers to disable external backend and retry if connection fails
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| ui/desktop/src/utils/settings.ts | Adds ExternalGoosedConfig interface with enabled, url, and secret fields |
| ui/desktop/src/preload.ts | Exposes saveSettings IPC method to renderer process |
| ui/desktop/src/main.ts | Implements external backend logic, CSP updates for external URLs, secret key management, and error recovery flow |
| ui/desktop/src/goosed.ts | Refactors startGoosed to accept options object and return structured GoosedResult with baseUrl field |
| ui/desktop/src/config.ts | Simplifies getApiUrl to use full GOOSE_API_HOST URL instead of constructing from host + port |
| ui/desktop/src/components/settings/app/ExternalBackendSection.tsx | New settings UI component for configuring external backend with URL validation and secret key input |
| ui/desktop/src/components/settings/app/AppSettingsSection.tsx | Integrates external backend settings section into app settings |
| ...appConfig, | ||
| GOOSE_PORT: port, | ||
| GOOSE_API_HOST: baseUrl, | ||
| GOOSE_PORT: 0, |
Copilot
AI
Dec 4, 2025
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.
[nitpick] Setting GOOSE_PORT: 0 in additionalArguments when using an external backend or custom URL could be confusing. Since this value is no longer meaningful (the actual connection is via GOOSE_API_HOST), consider removing it from the config or documenting why it's set to 0.
| GOOSE_PORT: 0, |
| const validateUrl = (value: string): boolean => { | ||
| if (!value) { | ||
| setUrlError(null); | ||
| return true; | ||
| } | ||
| try { | ||
| const parsed = new URL(value); | ||
| if (!['http:', 'https:'].includes(parsed.protocol)) { | ||
| setUrlError('URL must use http or https protocol'); | ||
| return false; | ||
| } | ||
| setUrlError(null); | ||
| return true; | ||
| } catch { | ||
| setUrlError('Invalid URL format'); | ||
| return false; | ||
| } |
Copilot
AI
Dec 4, 2025
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.
[nitpick] The URL validation only checks the protocol but doesn't validate the host. Consider adding validation to prevent localhost URLs when external backend is enabled, or document that localhost is intentionally allowed for development/testing purposes.
| }; | ||
| saveSettings(updatedSettings); | ||
| mainWindow.destroy(); | ||
| return createChat(app, initialMessage, dir); |
Copilot
AI
Dec 4, 2025
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.
The recursive call to createChat is missing parameters that were passed to the original call. If this function was invoked with resumeSessionId, viewType, recipeDeeplink, scheduledJobId, recipeId, or recipeParameters, these will be lost in the retry. Consider passing all original parameters: return createChat(app, initialMessage, dir, _version, resumeSessionId, viewType, recipeDeeplink, scheduledJobId, recipeId, recipeParameters);
| return createChat(app, initialMessage, dir); | |
| return createChat(app, initialMessage, dir, _version, resumeSessionId, viewType, recipeDeeplink, scheduledJobId, recipeId, recipeParameters); |
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.
I don't think this comment makes any sense, it is a fall back
| }); | ||
|
|
||
| const buildConnectSrc = (): string => { | ||
| const sources = [ |
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.
this is for CSP when the goose-server is remote - or an attempt to cc @aharvard
fixes: #4115 which has been requested a few times. Let the goose app connect to any goose server.
example motivation:
If you accidentally start it and it can't connect:
you can then run a goose server with:
and use the defaults in the form (127.0.0.1, port 3000, secret is 'test')