Repository navigation
fix(launch): only links on the app's own scheme are links; the value of --server is not one - #1195
Merged
Merged
Conversation
…of --server is not one Rune took every scheme:// launch argument for a link. Started as 'app --server http://127.0.0.1:4096', the app got the server's URL in its link handler ('ignored a link it doesn't open'), and a second launch with that flag was handed over as a link, not as a launch that reopens the app. The app now names its scheme (rune::url_schemes, anomalyco/rune#2182, in the pin of #1192).
A pin move renames every Rune symbol, so the committed profiles were dead for Rune's code on this branch's first commit. Both are re-keyed onto this tree's names, read from the instrumented build of #1193 (scripts/pgo-rekey.mjs). Windows x64: the counts trained on 25 Nov (launch weight 1): 17,961 of 18,439 functions keep their counts, 337 are dropped because their code changed, 141 no longer exist. Apple silicon: the committed profile, not trained anew: 15,030 of 15,445 kept, 285 dropped, 130 gone.
…ix/url-schemes-app
Hona
marked this pull request as ready for review
November 25, 2026 15:54
Hona
added a commit
that referenced
this pull request
Nov 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Started as
opencode-rune --server http://127.0.0.1:4096, the app took the server's URL for a link.Stacked on #1192 (the Rune pin that has
rune::url_schemes, anomalyco/rune#2182). Until #1192 merges, this PR's diff also shows its three files; it merges after #1192, rebased ontodev.What went wrong
scheme://launch argument as a link. The app's link handler gothttp://127.0.0.1:4096and printedignored a link it doesn't openon every such launch.Change
One line before
single_instance:rune::url_schemes([launch::product().scheme()]). From then on only arguments on the app's own scheme are links: jump list entries, notification clicks, deep links and the Console's return all use that one scheme.OpenCode Desktop's Electron shell does the same by hand: only arguments that start with
opencode://are links (packages/desktop/src/main/lifecycle/launch-links.ts).Run
Before this line existed here, the same line was run on a build pinned to the Rune change (Windows x64, and Linux x64 in a headless Wayland compositor): the
ignored a linkline went from 1 after the first launch and 2 after a second launch with the same arguments to 0 and 0; a link on the app's own scheme still reached the handler.On this PR's own Windows x64 CI build (
0f400d067) against #1192's build (60eda7d40, the same tree without the line): a real window started with--server http://127.0.0.1:<port>, then a second launch with the same arguments, then a third with none.ignored a linklines on the first window's output:The later launches exit 0 in 10 to 17 ms on both.
The same three launches on the re-keyed head (
864fc3932against #1192's9bc491fdcd): 1 / 2 / 2 lines against 0 / 0 / 0 again.Launch pair (the line is on the launch path). Windows x64, real windows, this PR's build of
864fc3932against #1192's build of9bc491fdcd(the same tree without the line, the same re-keyed profile), and #1192's build a second time as a control; three sides in turn, 26 counted rounds a side after 2 not counted, the app's own launch trace; every side had the exe's page list in 26 of 26 launches; ms, paired medians:main enteredmainSo the line is flat against the same build run a second time. The first-named side of a three-sided run reads about 4.6 ms faster than a second copy of itself (2 ms of it before
mainis entered, so before any code of the app); that is the method's, not this change's, and it is why the control column is the one to read.Linux x64 (a headless compositor, the build of
0f400d067, which differs from this head only by profile files no Linux build reads): to be added when its lab run is in.Not run: macOS; a second launch that brings the window forward (read from Rune, not observed); Linux arm64 (not built in a PR run).
Head
5a0200c47=dev866dd4ec76(which holds the pin bump, #1192, as866dd4ec76) taken in by a normal merge, plus the one call. The runs and the tables above were made on864fc3932(the bump's branch at9bc491fdcd+ the same line); this head differs from that bydev's own commits only, and fromdevby three lines inapps/desktop/src/lib.rs: the call and its two-line comment.