Skip to content

feat(desktop): reuse existing window for recipe deep links - #12919

Merged
jbg merged 5 commits into
aaif-goose:mainfrom
Abhijay007:feat/recipe-deeplink-reuse-window
Dec 2, 2026
Merged

jbg merged 5 commits into
aaif-goose:mainfrom
Abhijay007:feat/recipe-deeplink-reuse-window

Conversation

@Abhijay007

Copy link
Copy Markdown
Collaborator

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 checks getRegularWindows() first. If a window is found it is focused and the recipe is delivered via a new start-recipe IPC event; if not, a new window is created as before.

To handle the case where the link arrives before React is ready, a pendingRecipeDeepLinks map queues the payload and drains it in the existing react-ready handler.

On the renderer side, App.tsx listens for start-recipe, resets recipe parameter state so each delivery starts fresh, then calls createSession with the deep-link payload and dispatches ADD_ACTIVE_SESSION

Testing

  • Unit tests added to src/acp/__tests__/recipeParamRequests.test.ts covering resetConfiguredRecipeParameters (re-enables a new scope after consumption) and beginConfiguredRecipeParameterScope(values) (uses inline values instead of window.appConfig).
  • pnpm run typecheck, pnpm run lint, and pnpm test all pass (933 tests).
  • Manual: opened a goose://recipe?... deep link with Goose already running — recipe loaded in the existing window without opening a new one.

@Abhijay007
Abhijay007 requested a review from a team as a code owner October 15, 2026 13:55
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-02T16:17:11.776858Z e6a3acc New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/desktop/src/App.tsx Resolved
Comment thread ui/desktop/src/App.tsx Resolved
Comment thread ui/desktop/src/App.tsx Resolved
Comment thread ui/desktop/src/main.ts Resolved
@DOsinga DOsinga assigned jbg and unassigned jbg Oct 16, 2026
@github-actions github-actions Bot added the stale label Nov 9, 2026
@aaif-goose aaif-goose deleted a comment from github-actions Bot Nov 13, 2026
@Abhijay007 Abhijay007 removed the stale label Nov 13, 2026

@jbg jbg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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, and StartRecipePayload carries only the recipe config and parameters. Carry scheduledJobId through 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.

@Abhijay007
Abhijay007 requested a review from jbg November 20, 2026 02:50

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/desktop/src/App.tsx Resolved
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.
@Abhijay007
Abhijay007 force-pushed the feat/recipe-deeplink-reuse-window branch from 7e9900d to 1315e90 Compare November 20, 2026 14:55

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 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".

Comment thread ui/desktop/src/App.tsx Resolved

@jbg jbg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@Abhijay007
Abhijay007 requested a review from jbg December 2, 2026 16:03

@jbg jbg left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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.

@jbg
jbg enabled auto-merge December 2, 2026 16:10
@jbg
jbg added this pull request to the merge queue Dec 2, 2026
Merged via the queue into aaif-goose:main with commit b4eda20 Dec 2, 2026
43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open new links in same window, not new window

2 participants