-
Notifications
You must be signed in to change notification settings - Fork 46
🤖 feat: support mux:// deep links for new chat drafts #2069
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
Add a shared MuxDeepLinkPayload type and parseMuxDeepLink() helper for parsing mux://chat/new deep links (projectPath/projectId/prompt/sectionId), with unit tests.
In packaged Electron, Windows/Linux deep links are passed in argv. Treating `mux://...` as an Electron launch arg ensures the desktop app is opened instead of routing to CLI help.
Register mux:// protocol and forward deep links from main to renderer.
Bridge mux:deep-link IPC events through preload by buffering payloads until the renderer subscribes, and expose them on window.api. Also extend WindowApi typings with consumePendingDeepLinks() and onDeepLink().
Handle mux:// deep links by opening a fresh workspace draft for the resolved project and prefilling the creation input text (without auto-sending). Startup links that arrive before projects load are buffered in-memory and retried.
--- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: `.91`_ <!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=1.91 -->
--- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: `$7.99`_ <!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=7.99 -->
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a957bf3272
ℹ️ 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".
|
@codex review |
Subscribe before draining deep-link buffers and only buffer when there are no subscribers. This avoids a startup race where mux:// deep links can be lost between consume + subscription. --- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: `$8.49`_ <!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=8.49 -->
2efe775 to
42a73fc
Compare
|
@codex review Fixed the deep-link startup race by subscribing before draining the preload buffer, and updated preload to only buffer when there are no subscribers. |
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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42a73fc7bb
ℹ️ 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".
Queue unresolved mux:// deep links when the API/projects list is not ready yet, and retry once projects load. This avoids dropping links during startup in the window where ProjectContext can report loading=false before the API connection is established. --- _Generated with `mux` • Model: `openai:gpt-5.2` • Thinking: `xhigh` • Cost: `$8.49`_ <!-- mux-attribution: model=openai:gpt-5.2 thinking=xhigh costs=8.49 -->
|
@codex review Handled startup project-loading race: unresolved mux:// deep links are now buffered when the API isn't connected yet / projects list isn't ready, and retried once projects load. |
|
Codex Review: Didn't find any major issues. You're on a roll. ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
Summary
Adds desktop deep links via the custom
mux://protocol so a URL can launch/focus Mux, select a project, and open a new chat draft with the prompt prefilled (prefill-only; does not auto-send).Background
External tools (scripts, issue trackers, notifications) can now jump directly into Mux with context, without requiring users to manually find the project and paste an initial prompt.
Implementation
mux://chat/new?...) shared by main/preload/renderer.mux://...arg.electron-builderconfig and added main-process capture for:open-urlsecond-instanceargvwindow.api.consumePendingDeepLinks()/window.api.onDeepLink().projectPath/projectIdValidation
make static-checkRisks
open-urland argv/second-instancepaths and buffering until renderer is ready.Generated with
mux• Model:openai:gpt-5.2• Thinking:xhigh• Cost:$7.99