Repository navigation
feat(desktop): reuse existing window for recipe deep links - #12919
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: adf0a2bff6
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
jbg
left a comment
There was a problem hiding this comment.
Two launch details still need to match the design in #9143.
- Both protocol handlers pick
getRegularWindows()[0], which follows window registration order. With two regular chat windows open and the second focused, the link brings the first to the front and creates the session using that window’s startup working directory. Prefer the focused regular chat window, with a fallback when no regular chat window has focus. - The reuse branches return before reading
scheduledJob, andStartRecipePayloadcarries only the recipe config and parameters. CarryscheduledJobIdthrough the warm-window launch handoff as agreed in the issue.
Please add the agreed Electron/ACP regression coverage. Start with a run in progress, open a parameterized link, submit the form, and verify it dismisses and opens the new chat with the resolved prompt while the original run continues. The added scope unit tests do not exercise that handoff.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: af56abb059
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Deliver queued recipe links to the focused chat window, preserve scoped parameter values and scheduled job metadata, and navigate to the created chat with its resolved prompt. Cover the warm and cold launch paths in Electron and verify scheduled job persistence over ACP.
Use the focused chat directory for warm recipe launches and cover directory switches in the Electron regression.
7e9900d to
1315e90
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1315e90655
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
jbg
left a comment
There was a problem hiding this comment.
Thanks for addressing the focused-window selection, working directory, and scheduled-job metadata. The new Electron test covers the original run continuing through the handoff. Before merge, please address the open cancellation thread and add a single-link test that chooses “Start New Chat (No Recipe)” and verifies a blank chat opens.
jbg
left a comment
There was a problem hiding this comment.
Thanks for fixing the cancellation path. The single-link test covers opening a blank chat in the same window without sending a recipe prompt. This addresses my remaining review feedback.
Fixes: #9143
Summary
Recipe deep links (
goose://recipe?...) now reuse an existing normal chat window instead of always opening a new one. On both macOS (open-url) and Windows/Linux (second-instance), the handler checksgetRegularWindows()first. If a window is found it is focused and the recipe is delivered via a newstart-recipeIPC event; if not, a new window is created as before.To handle the case where the link arrives before React is ready, a
pendingRecipeDeepLinksmap queues the payload and drains it in the existingreact-readyhandler.On the renderer side,
App.tsxlistens forstart-recipe, resets recipe parameter state so each delivery starts fresh, then callscreateSessionwith the deep-link payload and dispatchesADD_ACTIVE_SESSIONTesting
src/acp/__tests__/recipeParamRequests.test.tscoveringresetConfiguredRecipeParameters(re-enables a new scope after consumption) andbeginConfiguredRecipeParameterScope(values)(uses inline values instead ofwindow.appConfig).pnpm run typecheck,pnpm run lint, andpnpm testall pass (933 tests).goose://recipe?...deep link with Goose already running — recipe loaded in the existing window without opening a new one.