Skip to content

Conversation

@jackjackbits
Copy link
Contributor

This PR adds comprehensive auto-update functionality to the Goose desktop application, enabling users to easily stay up-to-date with the latest releases.

Features Added:

  • Automatic Update Checking: The app now checks for updates automatically on startup (with a 5-second delay to avoid blocking app launch)
  • Visual Update Indicator: Menu bar icon changes to show an update indicator when updates are available
  • Dynamic Tray Menu: Shows "Update Available..." option that opens the update settings when clicked
  • Update Settings UI: New settings section for managing updates with:
    • Current version display
    • Check for updates button
    • Download progress indicator
    • Install update functionality
  • GitHub API Fallback: When electron-updater fails (e.g., due to missing release assets), the app falls back to GitHub API for update checking
  • Auto-extraction: Downloaded ZIP files are automatically extracted for easier installation
  • Manual Installation Flow: For GitHub downloads, provides clear instructions for manual update installation

Technical Changes:

  • Added electron-updater for native update support
  • Implemented custom GitHub updater as fallback mechanism
  • Added new tray icon assets for update notifications
  • Extended preload API to expose update functionality to renderer
  • Added proper TypeScript types and error handling throughout

Testing:

  • ✅ Rust compilation and linting pass
  • ✅ TypeScript type checking passes
  • ✅ ESLint checks pass (no errors, no warnings)
  • ✅ Prettier formatting applied
  • ✅ Successfully builds on macOS ARM64

What this PR adds:

  • Auto-update functionality for the Goose desktop app
  • Automatic update checking on startup (with 5s delay)
  • Visual indicator in the menu bar when updates are available
  • Dynamic tray menu that shows "Update Available..." when updates are found
  • GitHub API fallback for update checking when electron-updater fails
  • Auto-extraction of downloaded ZIP files
  • Update settings section in the app UI
  • Support for manual update installation flow

Files changed:

  • Added update-related utilities and components
  • Modified main process to integrate auto-updater
  • Added new UI components for update management
  • Created custom icons for update notifications

jack added 7 commits June 11, 2025 00:06
- add UpdateSection component with check for updates and install functionality
- add IPC handlers for executing update scripts and restarting the app
- integrate update section into AppSettingsSection
- support checking github releases for latest version
- display progress during download and installation
- prompt user to restart after successful update
- Add electron-updater for handling desktop app updates
- Create autoUpdater module with GitHub release integration
- Update UpdateSection component with real update checking
- Add IPC handlers for update operations
- Configure GitHub publisher in forge config
- Fix version display and error handling
- Check for updates automatically 5 seconds after app launch
- Add red dot indicator to menubar icon when updates are available
- Create iconTemplateUpdate.png with red dot overlay
- Update tray icon dynamically based on update availability
- Pass tray reference to auto-updater for icon management
- Add automatic update checking on app startup (5s delay)
- Implement auto-extraction of downloaded ZIP files
- Add GitHub API fallback for update checking
- Store and display update state in settings
- Show visual indicator in menu bar when updates available
- Bump version to 1.0.27
- Remove temporary documentation files
- Add 'Update Available...' menu item when updates are ready
- Dynamically update tray menu based on update status
- Clean up console.log statements
- Fix missing await statements in window creation
- Add navigation to update settings from tray menu
- Fix implicit any types in autoUpdater.ts
- Remove unused MenuItem import
- Convert require statements to proper imports
- Fix ESLint and formatting issues
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 should be 1.0.27

@zanesq zanesq self-requested a review June 11, 2025 02:56
@zanesq
Copy link
Collaborator

zanesq commented Jun 11, 2025

.bundle

@github-actions
Copy link
Contributor

⚠️ Cannot proceed with operation

This Action has been explicity configured to prevent operations from forks. You can change this via this Action's inputs if needed

@mrand-block
Copy link

For the security of the IPCs, instead of using exec for the unzip, can you use spawn() instead?

Same with the mv call, you should use built in FS rename or similar to move the file/dir instead of calling out to exec again

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! Worked in local testing with that one addition. Will also test this out with the next release.

will merge after the shell handling improvements @mrand-block

- Replaced exec() with spawn() for the unzip command for better IPC security
- Replaced shell mv command with built-in fs.rename() for file operations
- Removed unused execAsync and promisify imports

Addresses security concerns raised by @mrand-block in PR block#2852
@jackjackbits
Copy link
Contributor Author

Thanks for the security feedback @mrand-block! I've addressed both concerns:

  1. ✅ Replaced exec with spawn for the unzip command
  2. ✅ Replaced shell mv command with built-in fs.rename() for file operations

The code now uses more secure IPC methods and avoids shell command injection vulnerabilities. All tests pass (lint and typecheck).

@jackjackbits
Copy link
Contributor Author

Update: Fixed prettier formatting issues. All checks now pass:

  • ✅ TypeScript compilation successful
  • ✅ ESLint passes with no errors or warnings
  • ✅ Prettier formatting applied and verified

The security improvements requested by @mrand-block have been implemented and the code is ready for review.

Comment on lines +34 to +36
// Get current version on mount
const currentVersion = window.electron.getVersion();
setUpdateInfo((prev) => ({ ...prev, currentVersion }));

Choose a reason for hiding this comment

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

We may want to guarantee window.electron is not undefined in this useEffect

@taniandjerry
Copy link
Contributor

Thank you for contributing this auto-update PR! Being able to easily stay up-to-date is so important <3

@wendytang
Copy link
Contributor

.bundle

@github-actions
Copy link
Contributor

⚠️ Cannot proceed with operation

This Action has been explicity configured to prevent operations from forks. You can change this via this Action's inputs if needed

Comment on lines +22 to +29
useEffect(() => {
if (scrollToSection === 'update' && updateSectionRef.current) {
// Use a timeout to ensure the DOM is ready
setTimeout(() => {
updateSectionRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 100);
}
}, [scrollToSection]);
Copy link

@surreptus surreptus Jun 12, 2025

Choose a reason for hiding this comment

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

Not required, but consider using useLayoutEffect here instead of depending on the timeout.

Suggested change
useEffect(() => {
if (scrollToSection === 'update' && updateSectionRef.current) {
// Use a timeout to ensure the DOM is ready
setTimeout(() => {
updateSectionRef.current?.scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 100);
}
}, [scrollToSection]);
useLayoutEffect(() => {
if (scrollToSection === 'update' && updateSectionRef.current) {
updateSectionRef.current.scrollIntoView({ behavior: 'smooth', block: 'center' });
}
}, [scrollToSection]);

@leorosasa
Copy link

Ship it

@danielzayas
Copy link
Contributor

Awesome! Auto-update functionality is a great feature! 👏 👏 👏 🚢

@tiensi
Copy link
Contributor

tiensi commented Jun 12, 2025

Looks great! Would love to see a short demo vid of it in action or testing steps if we want to verify it locally.

@baxen baxen merged commit 37812fc into block:main Jun 12, 2025
6 checks passed
lifeizhou-ap added a commit that referenced this pull request Jun 13, 2025
* main: (26 commits)
  docs: update Snowflake link and description verbiage (#2882)
  Fixed typos and wording for endpoint info for ollama (#2861)
  Docs: Unlist blog post called What's in my goosehints file (#2891)
  Docs: Fix Nav Bar and wrong command in docs (#2889)
  fix the claude model name (#2890)
  disable temporal by default (#2886)
  feat(desktop): Add auto-update functionality to Goose desktop app (#2852)
  docs: add goose web command (#2856)
  Docs: Schedule recipes with the CLI (#2881)
  Docs: Fix readme (#2880)
  fix: CPU hogging GUI (#2877)
  feat/fix: don't stop cli starting if MCPs don't load (#2860)
  fix invalid context length for claude models (#2872)
  dynamic port selection for temporal (#2865)
  Docs: Session Export via CLI (#2867)
  Docs: Adding Snowflake as a Provider (#2868)
  [goose-llm] update example to add toolResult status error (#2854)
  fix: cap the repeat time when display usage (#2864)
  Docs: Goose now respects gitignore files (#2858)
  docs: add CLI token usage (#2857)
  ...
opdich added a commit to opdich/goose that referenced this pull request Jun 13, 2025
* upstream/main:
  fix: Revert downgrade to version number (block#2894)
  Goose recipes have settings now (block#2397)
  docs: update Snowflake link and description verbiage (block#2882)
  Fixed typos and wording for endpoint info for ollama (block#2861)
  Docs: Unlist blog post called What's in my goosehints file (block#2891)
  Docs: Fix Nav Bar and wrong command in docs (block#2889)
  fix the claude model name (block#2890)
  disable temporal by default (block#2886)
  feat(desktop): Add auto-update functionality to Goose desktop app (block#2852)
  docs: add goose web command (block#2856)
  Docs: Schedule recipes with the CLI (block#2881)
@rabble
Copy link

rabble commented Jun 18, 2025

This is so needed!

s-soroosh pushed a commit to s-soroosh/goose that referenced this pull request Jul 18, 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.