Skip to content

Conversation

@zanesq
Copy link
Collaborator

@zanesq zanesq commented Dec 20, 2025

Summary

Fix deep link handling on cold start (app not running) for extension, session, and recipe deep links.

Also noticed deeplinks stopped launching from cold start after nextcamp.

Goose created this but I wasn't able to test cold start launch it would only launch my goose app in applications and copying to Applications wasn't getting around it so we'll need to see after the next release. Verified deeplinks still open when app is running so there should be no regression here only hopeful improvement :)

fixes #3972

Problem

When clicking a goose:// deep link while Goose is not running:

  1. Extension deep links failed silently - the app launched but the extension install modal never appeared
  2. Recipe deep links failed silently - the app launched but the recipe didn't run
  3. Duplicate windows could be created - both the open-url handler and appMain() would create windows

Root Cause

Two issues in the open-url event handler:

  1. Missing app.whenReady() call: On macOS, open-url can fire before the app is ready. The handler was calling createChat() (which creates a BrowserWindow) without waiting for the app to be ready, causing the window creation to fail silently.

  2. Race condition for IPC messages: For extension/session deep links, IPC messages (add-extension, open-shared-session) were sent immediately after window creation, before React had mounted and registered its listeners. The messages were lost.

Solution

  1. Added await app.whenReady() in the open-url handler before creating any windows (critical fix for cold start)
  2. Added openUrlHandledLaunch flag to track when open-url has already created a window for a deep link
  3. Modified open-url handler to defer IPC messages for extension/session deep links until React is ready (stored in pendingDeepLink)
  4. Modified appMain() to skip window creation if openUrlHandledLaunch is true
  5. Modified react-ready IPC handler to process pendingDeepLink by sending the appropriate IPC message to the now-ready window

Result

  • App properly launches on cold start deep links (was silently failing before)
  • Single window opens (no duplicates)
  • Extension install modal appears correctly when clicking extension deep links
  • Recipe deep links now work correctly on cold start
  • Session sharing deep links now work on cold start

@zanesq zanesq requested a review from DOsinga December 20, 2025 01:22
@alexhancock alexhancock self-requested a review January 12, 2026 16:47
}
const scheduledJobId = parsedUrl.searchParams.get('scheduledJob');

// Wait for app to be ready before creating window (critical for cold start)
Copy link
Collaborator

Choose a reason for hiding this comment

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

i'd nuke the comments

Copy link
Collaborator

Choose a reason for hiding this comment

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

goose run --text "look at the current branch and compare with main. remove any comments that were introduced that were introduce that just say what the code underneath is doing, i.e. commenting on what or how and not on why."

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

sure will do, actually I did review these and they seem relevant for the cold start edge case for future devs

@zanesq zanesq merged commit eb5577a into main Jan 12, 2026
20 checks passed
@zanesq zanesq deleted the zane/deeplink-coldstart branch January 12, 2026 19:00
fbalicchia pushed a commit to fbalicchia/goose that referenced this pull request Jan 13, 2026
zanesq added a commit that referenced this pull request Jan 13, 2026
…ased

* 'main' of github.com:block/goose: (23 commits)
  Use Intl.NumberFormat for token formatting in SessionsInsights (#6466)
  feat(ui): format large and small token counts for readability (#6449)
  fix: apply subrecipes when using slash commands (#6460)
  Fix: exclude platform_schedule_tool in CLI (#6442)
  Fix: Small update in how ML-based prompt injection determines final result (#6439)
  docs: remove SSE transport and rename to Streamable HTTP (#6319)
  fix: correct Cloudinary extension command and env variable (#6453)
  fix: add gap between buttons in MacDesktopInstallButtons.js (#6452)
  refactor: include hidden dotfiles folders in file picker search (#6315)
  upgraded safe npm packages (#6450)
  chore(deps): bump react-router and react-router-dom in /ui/desktop (#6408)
  chore(deps): bump lru from 0.12.5 to 0.16.3 (#6379)
  chore(deps-dev): bump @modelcontextprotocol/sdk from 1.24.0 to 1.25.2 in /ui/desktop (#6375)
  fix: inconsistent API url requirement between desktop and CLI versions (#6419)
  feat(vertexai): Add streaming support (#6409)
  fix deeplink recipe launch cold start (#6210)
  Spell check setting (#6446)
  File bug directly (#6413)
  fix(cli): incorrect bin name in shell completions (#6444)
  Use crunchy from crates instead of git fork (#6415)
  ...
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.

bug: blank window being created when app is closed and launched from a recipe deeplink

4 participants