Skip to content

Send Edge the two fields its handoff expects beyond one argument - #16433

Closed
vitally wants to merge 2 commits into
omacom:quattrofrom
vitally:fix/16428-edge-handoff-fields
Closed

vitally wants to merge 2 commits into
omacom:quattrofrom
vitally:fix/16428-edge-handoff-fields

Conversation

@vitally

@vitally vitally commented Oct 23, 2026

Copy link
Copy Markdown
Contributor

With Microsoft Edge as the default browser and running, a handoff with two or more arguments loses the first two: omarchy-launch-webapp URL --ignore-certificate-errors opens a blank "New tab" in a normal window, as #16428 reports for Omarchy's own Sunshine admin web app.

Edge's own second process sends two extra fields after the working directory, a time in microseconds since 1601 and one it ignores:

START\0<cwd>\0 13437246733690000 \0 1696729291 \0/opt/microsoft/msedge/msedge\0--app=…\0…

omarchy-cmd-browser-handoff sends Chromium's shorter message, and Edge reads a message without those fields only when it has a single argument — with more, it takes the first two arguments as the fields and drops them.

Fix. For the microsoft-edge profile only, the handoff now sends the two fields before the browser token, dating the message from 1601 as Edge's own client does. Chromium, Chrome, Brave, Brave Origin and the flags and socket checks are unchanged, and a single-argument handoff gets the same fields, which is the form Edge's own client sends.

Test. browser-handoff-test.sh runs the real handoff against a singleton socket and asserts the exact fields: START, the working directory, a timestamp above the 1601 offset, 0, browser, then both arguments. The packaged path is what selects the Edge profile, so the test stands in for type -P to reach it where Edge is not installed; it fails on quattro with the message START\0cwd\0browser\0--app=…\0--ignore-certificate-errors and passes with the fix. bin-style-test.sh passes too.

Not run against a real Edge, which is not installed here; the field layout and the argument-loss table are from the issue's strace capture.

Fixes #16428

@greptile-apps

greptile-apps Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issue remains.

Summary

Adds the two fields Edge expects before the browser token, preserving the URL and extra arguments during handoff.

  • Running Edge keeps every argument in a handed-off command.

Reviews (3) · Last reviewed commit: "Quote the Edge profile and clean up the ..." · Reviewed by Greptile

Comment thread test/shell.d/browser-handoff-test.sh Resolved
Comment thread bin/omarchy-cmd-browser-handoff Resolved
@vitally
vitally force-pushed the fix/16428-edge-handoff-fields branch from f7db948 to 65d267e Compare October 25, 2026 05:49
@omarchybot omarchybot added the bug Something isn't working label Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks @vitally. I reviewed this at 65d267e alongside #16079, which also says it fixes #16428.

The Edge change here is the same code as the one in #16079, line for line: START, the directory, the 1601-based microsecond time, 0, browser, then the arguments. #16079 is older, and its Edge commit was pushed before this pull request was opened. When two fixes are the same, the older one wins so the first author keeps the credit, so #16079 is the one going on to the maintainer. This one stays open, and it was not run on a worker, since testing a fix that won't be merged would only duplicate #16079's verification.

Your test does add something #16079 doesn't have. #16079's Edge case skips unless /usr/bin/microsoft-edge-stable is installed, so it never runs in CI or on a stock install. Yours stands in for type -P with an exported function, which the script's type -P "$1" picks up, so the Edge field layout is checked everywhere. I've marked that test to be folded into #16079, credited to you.

I found no defect in the Edge hunk itself. The offset 11644473600000000 is the 1601-to-1970 gap in microseconds, EPOCHREALTIME with its separator stripped gives Unix microseconds, and the fields come in the order Edge's own client sends them.

Checked by Claude Opus 5.5 and, as a second opinion, Codex Medium. Codex was given both diffs and asked which should win without being told my answer. It reached the same conclusion and also recommended folding the test in, though independence isn't guaranteed. Next step: the maintainer decides between the two.

omarchybot added a commit to dmkenney/omarchy that referenced this pull request Nov 2, 2026
The packaged path is what selects Edge's profile, so the test stands in for type -P rather than skipping wherever Edge is missing, which is everywhere the suite usually runs. Taken from omacom#16433.

Co-Authored-By: Vitally Tezhe <vitally@tezhe.eu>
Co-Authored-By: muse-wonder High <noreply@meta.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vitally

vitally commented Nov 12, 2026

Copy link
Copy Markdown
Contributor Author

Superseded by #16079, which carries the same Edge handoff fix and now includes the test from this PR in 3c8e8c4, credited to @vitally. No unique changes remain here, so I'm closing this one as a duplicate.

@vitally vitally closed this Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Edge drops the first two arguments of a browser handoff that has more than one

2 participants