Skip to content

Answer an abandoned menu request before starting the next one - #9056

Open
FernandoJVideira wants to merge 6 commits into
omacom:quattrofrom
FernandoJVideira:fix-menu-summon-orphans-request
Open

FernandoJVideira wants to merge 6 commits into
omacom:quattrofrom
FernandoJVideira:fix-menu-summon-orphans-request

Conversation

@FernandoJVideira

@FernandoJVideira FernandoJVideira commented Aug 30, 2026 •

Copy link
Copy Markdown

Summary

Repeating a menu-summoning keybinding (e.g. Super+K for the Keybindings
cheat sheet) before the previous popup was answered leaks a permanently
stuck omarchy-menu-select process per extra press. On a real system this
accumulates into hundreds of orphaned processes over time.

Fixes #9057.

Root cause

bin/omarchy-menu-select creates a doneFile, asks the shell to summon
omarchy.menu, then polls for that file:

while [[ ! -e $done_file ]]; do
  sleep 0.05
done

In shell/plugins/menu/Menu.qml, open(payloadJson) dispatches to either
openDmenu() (select/input requests) or openRoute() → openExistingMenu()
(plain menu routes). Both unconditionally overwrite
selectionFile/doneFile/requestActive with the new request's values:

function openDmenu(payload) {
  ...
  selectionFile = String(payload.selectionFile || "")
  doneFile = String(payload.doneFile || "")
  requestActive = !!doneFile
  ...
}
function openExistingMenu(initialMenu) {
  ...
  requestActive = false
  selectionFile = ""
  doneFile = ""
  ...
}

If a request is already in flight (its caller is still polling for a
doneFile that hasn't been written yet), neither function finishes it —
they just drop the reference to its files. Nothing will ever create that
doneFile, so the earlier omarchy-menu-select process spins in its
sleep 0.05 loop forever.

cancel() already handles this correctly for the normal close path:

function cancel() {
  if (root.dmenuActive) root.finishRequest(null)
  opened = false
  filterText = ""
}

open() just doesn't call it before replacing the in-flight request.

Fix

Finish any active request as cancelled at the top of open(), before
dispatching to either openDmenu() or openRoute():

if (root.requestActive) root.finishRequest(null)

This reuses the existing finishRequest() plumbing (same as cancel()),
so the superseded request's doneFile is always written and its caller
exits (with an empty selection, i.e. as if cancelled) instead of hanging.

Repro

for i in $(seq 1 20); do
  /usr/share/omarchy/bin/omarchy-menu-keybindings >/dev/null 2>&1 &
done
sleep 2
ps aux | grep -c '[o]marchy-menu-select'

Before this change, that count grows by one per invocation and never
drops. Full diagnostics and root-cause writeup are in #9057.

Test plan

  • Reviewer confirms in a running desktop: spam the Keybindings
    keybinding several times without dismissing, then check
    ps aux | grep omarchy-menu-select drops back to 0 shortly after.
  • omarchy restart shell after the change, exercise the menu normally
    (open, select, cancel, reopen) to confirm no regression to the usual
    flow.
  • Not run here: ./test/all and the graphical acceptance suite, which per
    agents/skills/acceptance-tests.md require a disposable VM via the
    sibling omarchy-iso repo, not available in this environment.

open() dispatches to openDmenu() or openExistingMenu() (via openRoute()),
and both unconditionally overwrite selectionFile/doneFile/requestActive
without finishing any request already in flight. A summon that arrives
before the prior select/input request was answered — e.g. a keybinding
like Super+K repeated in quick succession — orphans that request's
doneFile forever, so bin/omarchy-menu-select's polling loop
(`while [[ ! -e $done_file ]]; do sleep 0.05; done`) never exits and the
process leaks indefinitely.

Finish any active request as cancelled at the top of open(), before
dispatching to either path, mirroring what cancel() already does for
dmenuActive.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR prevents orphaned omarchy-menu-select processes by ensuring any in-flight select/input request is finished (as cancelled) before a new menu summon overwrites its doneFile/selectionFile state in the menu plugin.

Changes:

  • Cancel/finish any active select/input request at the start of Menu.open() to ensure the previous caller’s doneFile is written.
  • Add inline documentation describing the stuck-process failure mode and why the pre-cancel is necessary.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +25 to +32
// A select/input request left in flight when a new summon arrives
// (e.g. the trigger key repeated before the prior one was answered)
// would otherwise have its doneFile silently abandoned by
// openDmenu/openExistingMenu below, leaving the caller that's still
// polling for it (bin/omarchy-menu-select) blocked forever. Answer it
// as cancelled first so every summon always resolves.
if (root.requestActive) root.finishRequest(null)

@buger buger 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.

Verdict: approve-with-comments — I verified the fix live against the real shell, and traced the blast radius of answering inside open(). Re-checked on the current head b7bd59c4.

The attached 78-second narrated video runs the real shell with real callers on quattro c05d9019, the first commit 0b4fe29 (the guard only) and the head b7bd59c4, with the SHAs on screen: two overlapping requests, then a burst of 20 and Escape.

pr-9056-supersession.mp4
  • Two requests: on quattro, caller A is never answered and keeps waiting; on 0b4fe29 and b7bd59c4, B's summon answers A as cancelled and both exit 1.
  • Burst of 20: 19 callers still waiting on quattro, 11 on 0b4fe29, 0 on b7bd59c4. A real selection still returns its value (alpha, exit 0).

Many summons at once — fixed by b7bd59c4 (thanks @omarchybot, who found it and pushed the fix). Copilot flagged this race on the first commit; my earlier two-answer test missed it. With a single shared Process for answers, a burst of summons stranded callers: when the queue drains, several answers are started while the first write is still running, and those starts are ignored. I re-ran it on a live session (20 concurrent omarchy-menu-select, then Escape on the visible menu; two sessions of 3 runs each):

Tree Callers still waiting (of 20)
quattro c05d9019 19 in all 6 runs
0b4fe29 (guard only) 12, 11, 10, 7, 10, 9
b7bd59c4 0 in all 6 runs
b7bd59c4 merged onto c05d9019 0 in all 6 runs

The two-summon case exits cleanly on b7bd59c4 (A 1, B 1), and a real selection still returns its value (alpha, exit 0).

Blast radius — checked, safe. The one concern with answering inside open() is whether any path calls open() intending to keep an in-flight request (a refresh/redraw would now wrongly cancel it). I traced every entry point:

  • open() has exactly one caller — the summon queue drain in shell.qml. All summon paths (omarchy-menu summon, omarchy-menu-select, omarchy-menu-input, omarchy-agent) are genuine new requests, where supersession is the intent.
  • toggle (and the default keybinds) while a request is active goes through close() → cancel(), which already answers via finishRequest(null) — behavior unchanged there.
  • refresh never touches open() — it routes to refresh() (Menu.qml:46), which only reloads the two JSONC files. No theme-change or watcher-triggered re-open exists anywhere in bin/ or default/.
  • open() only calls finishRequest(null) when a request is in flight (the requestActive guard), so flows with nothing pending are unaffected.
  • Removing resultProc also removes its onExited, which only set opened = false; cancel(), applyDmenuSelection(), applySelected() and the app-launch path already set it themselves.

Two comments:

  1. This fixes the supersession trigger only. If the menu process dies after the summon (Quickshell crash/restart) instead of being superseded, open() never runs again and the caller still polls forever — same leak, different trigger (details on #9057). bin/omarchy-menu-select is unchanged by this PR. A bounded wait there (deadline + diagnostic + exit 1) covers both. Non-blocking for this PR, but the pair should land together, or the issue should stay open for the peer-death half.

  2. Please add a regression test. The new menu-test.sh assertions check the source text of open() and finishRequest(); nothing yet runs two overlapping requests, which is the gap greptile also points out. A two-summon test is cheap in the existing shell test harness and prevents a silent revert the next time open() is refactored.

    Here is one for test/shell.d/ that needs no compositor. It runs the real open / finishRequest / openDmenu / openExistingMenu / openRoute bodies from Menu.qml under Node and records every answer write, whether it goes through Quickshell.execDetached or a shared Process (modelled as it behaves live: a start while it is still running is ignored). Feel free to add it to this PR as is.

What the test reports on each tree
Tree Result
quattro c05d9019 (and 8b4eae6) exit 1 — stops at not ok - a second summon answers the active request
0b4fe29 (guard only) exit 1 — 7 ok, then not ok - back-to-back answers are all written, none dropped while an earlier write runs
this branch (b7bd59c4) 8 / 8 ok
this branch merged onto c05d9019 8 / 8 ok

The four cases cover a picker superseded by a second picker, a picker superseded by a route summon, a summon with nothing active (which must write nothing), and three pickers summoned back to back (every answer must be written).

test/shell.d/menu-summon-cancel-test.sh (run with bash test/shell.d/menu-summon-cancel-test.sh)
#!/bin/bash

set -euo pipefail

# #9057: a summon while a select request is active must answer the earlier
# request (as a cancel) instead of orphaning its done file, and answers given
# back to back must all be written. Runs the real open / finishRequest /
# openDmenu / openExistingMenu / openRoute bodies from Menu.qml under node vm
# and records every answer write. A shared Process is modelled as it behaves
# live: a start while it is still running is ignored.

source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"

run_node_test <<'JS'
function requestHarness() {
  const vm = require('vm')
  const fs = require('fs')
  const qml = fs.readFileSync(path.join(root, 'shell/plugins/menu/Menu.qml'), 'utf8')
  const names = ['open', 'finishRequest', 'openDmenu', 'openExistingMenu', 'openRoute']
  const src = names.map(name => {
    const m = qml.match(new RegExp('\\n  function ' + name + '\\([^)]*\\) \\{[\\s\\S]*?\\n  \\}\\n'))
    if (!m) throw new Error(name + ' not found in Menu.qml')
    return m[0]
  }).join('\n')
  const writes = []
  let busy = false
  const resultProc = { command: [], set running(v) { if (v && !busy) { busy = true; writes.push(this.command.slice()) } }, get running() { return busy } }
  const Quickshell = { execDetached(command) { writes.push(command.slice()) } }
  const r = {
    opened: false, mode: 'menu', requestSerial: 0, applySerial: 0, requestActive: false, selectionFile: '', doneFile: '',
    dmenuPrompt: '', dmenuOptions: [], dmenuWidth: 300, dmenuMaxHeight: 0, activeMenu: 'root', navStack: [],
    filterText: '', selectedIndex: 0, cursorActive: true, fontFamily: '', pendingInitialMenu: 'root', appLibrary: null,
    items: { root: { id: 'root', kind: 'menu' } }, itemOrder: ['root'],
    item(id) { return this.items[id] || null },
    resolveRoute(input) { return input },
    disarmPointer() {}, evaluateGuards() {}, rebuildDisplay() {}, invalidateVolatileProvider() {}, loadProviderForMenu() {},
    cancel() { this.finishRequest(null) }, runAction() {}
  }
  const fns = vm.runInNewContext(`(function() { with (root) { ${src}; return { ${names.join(', ')} } } })()`, {
    root: r, resultProc, Quickshell, keyCatcher: { forceActiveFocus() {} }, Qt: { callLater() {} },
    Util: { shellQuote: s => "'" + String(s).replace(/'/g, "'\\''") + "'" }, JSON, Math, Number, String, Array
  })
  for (const n of names) r[n] = fns[n]
  return { r, writes }
}
const selectPayload = tag => JSON.stringify({ mode: 'select', prompt: 'Pick ' + tag, options: ['a', 'b'], selectionFile: '/tmp/sel-' + tag, doneFile: '/tmp/done-' + tag })

{
  const { r, writes } = requestHarness()
  r.open(selectPayload('first'))
  r.open(selectPayload('second'))
  assertEqual(writes.length, 1, 'a second summon answers the active request')
  assertEqual(writes[0][2], ": > '/tmp/done-first'", 'the superseded request is answered as cancelled (done file only)')
  assertEqual(r.doneFile, '/tmp/done-second', 'the new request owns its own done file')
  assertEqual(r.requestActive, true, 'the new request stays active')
}

{
  const { r, writes } = requestHarness()
  r.open(selectPayload('pending'))
  r.open(JSON.stringify({ menu: 'root' }))
  assertEqual(writes.length, 1, 'a route summon answers a pending picker')
  assertEqual(r.requestActive, false, 'no request stays active after a route summon')
}

{
  const { r, writes } = requestHarness()
  r.open(selectPayload('clean'))
  assertEqual(writes.length, 0, 'a summon with no active request writes nothing')
}

{
  const { r, writes } = requestHarness()
  for (const tag of ['b1', 'b2', 'b3']) r.open(selectPayload(tag))
  r.finishRequest(null)
  assertEqual(writes.map(w => w[2]).join(' | '), ": > '/tmp/done-b1' | : > '/tmp/done-b2' | : > '/tmp/done-b3'",
    'back-to-back answers are all written, none dropped while an earlier write runs')
}
JS

Unrelated, in the neighborhood: the menu's JSONC parsing has pre-existing edges (#13250, #13492, #13493), fixed together in #13968. None is caused by this change.

Verified by driving the real shell; the video above is the actual run, not a mock.

Independent verification: the requirement map, test results and behaviour-change analysis for this PR at b7bd59c4.


Updated 2026-10-02: re-checked on b7bd59c4 (thanks @omarchybot and Copilot): the burst case is fixed; new video on all three commits; this review now holds everything.

@buger

buger commented Sep 25, 2026 •

Copy link
Copy Markdown

Folded into my review above. It now carries the live video on quattro, 0b4fe29 and b7bd59c4, the 20-caller burst numbers, the regression test and the blast-radius check, so there is one place to read.


Updated 2026-10-02: folded into the review above.

finishRequest() sent every answer through one shared Process. Setting a command and running = true on a Process that is still running is ignored, so when a second answer came before the first write exited (several summons arriving together, as when a menu key is pressed repeatedly) it was dropped and its caller polled for a done file that never came. With 20 selects summoned at once, about half stayed stuck after the open() guard.

Quickshell.execDetached starts a fresh process per answer, so none can be lost. The Process's onExited only closed the menu again after the selection path had already closed it, so it goes, along with the serials that existed only to feed it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and reproduced on a disposable Omarchy VM, running the real shell from this branch. The guard in open() fixes the two-summon case, but under a burst of summons about half the callers were still left stuck. I pushed a fix for that to your branch as b7bd59c.

What was found. finishRequest() wrote every answer through one shared Process (resultProc). Setting command and running = true on a Process that is still running is ignored, so when the guard's cancel and the next answer come before the first bash has exited, the second answer is dropped and its caller polls forever, which is the same hang by another route. Your repro (20 concurrent omarchy-menu-select, then dismiss the visible one) left 19 callers stuck on the base, about 10 on 0b4fe29 across three runs, and 0 with b7bd59c.

What changed. finishRequest() now starts each answer with Quickshell.execDetached, so no answer can be dropped. resultProc is gone: its onExited only closed the menu again after cancel() or applyDmenuSelection() had already closed it. applySerial and requestSerial went with it, since nothing read them any more. test/shell.d/menu-test.sh gains two assertions: open() answers an in-flight request before replacing it, and finishRequest() uses a process per answer. On the worker I checked that each assertion fails on the code it guards against: the first on the base, the second on 0b4fe29.

What ran, on the worker: the two-summon case (A now exits 1), the 20-way burst (0 left), three summons back to back (all exit), and a real selection, which still returns its value. Also ./test/cli (116 ok) and the menu, menu-plugin, keybindings-menu, menu-guards and menu-images shell tests, all green. The same repro and menu tests are also clean with this branch merged into current quattro. No CI ran on this pull request.

Second opinion: none. The configured reviewer (Codex Medium) answers, but omabot's review budget for the day was spent, so this was checked by one model, Claude Opus 5.5, and nothing else.

Not covered here: a caller still waits forever if the shell dies after it summons, as noted on #9057. A bounded wait in omarchy-menu-select would cover that, and whether to add one is the maintainer's call.

This waits on a second-opinion review of b7bd59c, then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 1, 2026
@greptile-apps

greptile-apps Bot commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5 · Fix the leftover applySerial assignment before merging; it breaks choosing a keybinding.RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The change affects menu requests and their callers across the desktop workflow.

Fix the leftover applySerial assignment before merging; it breaks choosing a keybinding.

Findings

  1. P1 Keybindings no longer run ▶
  2. P2 Overlapping requests remain untested ▶

Summary

The PR answers an abandoned menu request before opening its replacement.

  • A new menu summon cancels any unanswered selection first.

Reviews (5) · Last reviewed commit: "Merge branch 'quattro' into fix-menu-sum..." · Reviewed by Greptile

Comment thread test/shell.d/menu-test.sh Outdated
Comment on lines +639 to +645
/if \(root\.requestActive\) root\.finishRequest\(null\)/.test(openBody)
&& openBody.indexOf('root.finishRequest(null)') < openBody.indexOf('root.openDmenu(payload)'),
'menu answers a request still in flight before a new summon replaces it'
)
const finishBody = menuQml.match(/function finishRequest\(selection\) \{([\s\S]*?)\n \}/)[1]
assert(
(finishBody.match(/Quickshell\.execDetached\(/g) || []).length === 2 && !/\.running = true/.test(finishBody),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Overlapping requests remain untested The new assertions inspect QML text but never run two overlapping select/input requests. A regression could leave the first caller waiting for its doneFile while these checks still pass. A runtime test that supersedes an active request and verifies both callers exit would cover the behavior this PR fixes.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@buger

buger commented Oct 1, 2026 •

Copy link
Copy Markdown

Thanks @omarchybot for b7bd59c and the burst repro, and Copilot for flagging the race on the first commit. I updated my review above for the head b7bd59c4. Re-run on a live session: the two-summon case still exits cleanly, and a burst of 20 summons now leaves 0 callers stuck (19/20 on quattro, 7–12/20 on 0b4fe29). The review now includes a headless regression test that runs overlapping requests (the gap Greptile pointed out); it fails on both older trees and passes 8/8 on this head.

buger added a commit to probelabs/omarchy that referenced this pull request Oct 2, 2026
test/reports/*.sh run through test/node/report-reproducers.test.mjs,
which is in scope, so the JUnit report has no testcase per script. In
scope, the engine counted a traced reproducer as a test of its own with
no observed outcome: on the omacom#9056 mirror, which edits the omacom#9057
reproducer, that was a test_outcome_unobserved disclosure for
SYS-REQ-260922-X6Z5 although the script ran and passed.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
buger added a commit to probelabs/omarchy that referenced this pull request Oct 2, 2026
- Front page: omacom#9057 row says omacom#9056 fixes the re-summon trigger only (a menu
  process that dies mid-request still strands the caller); omacom#13492 row says
  label-only array elements stay hidden; omacom#13493 row says every entry in that
  file; omacom#13250 row covers actions; omacom#10340 reproduces but is a ranking-policy
  change (omacom#12223).
- Clip notes: this branch carries upstream 821ae58 (was e332dc9); ff77cd0 is
  the first commit of omacom#13968 (head b2dae8d), with the reproducers re-run on
  821ae58 and b2dae8d; no internal branch names; the omacom#13012 back-from-search
  note names the KI-MENU-BACK-FILTERED-INDEX test instead of a removed script.
buger added a commit to probelabs/omarchy that referenced this pull request Oct 2, 2026
- KI-MENU-JSONC-ARRAY-ROOT: the title says an array root is read as
  entries with ids 0, 1, ...; label-only elements stay hidden and the
  rest show under the user's own labels, so nothing says the file is
  wrong (omacom#13492).
- KI-MENU-REQUEST-LIFECYCLE: nothing bounds the wait; a superseded
  caller, or one whose menu process dies, polls forever (19 of 20 in a
  burst on quattro c05d901). omacom#9056 (b7bd59c) answers a superseded
  request and fixes the busy-writer race; a deadline in
  omarchy-menu-select is still needed for a dead menu process.
- KI-MENU-JSONC-INLINE-COMMENT: the missing entries are visible, but
  nothing says why (omacom#13493).
- Fix lines name the requirement in the proof layer.
- Plain-language customer impact on the five menu known issues.
- Evidence refreshed (reproducers re-run); front page names engine
  2dabc50.
buger added a commit to probelabs/omarchy that referenced this pull request Oct 4, 2026
Applies the full upstream PR diff (158e8cf..b7bd59c: 0b4fe29 "Answer an
abandoned menu request before starting the next one" + b7bd59c "Write each
menu answer in a process of its own") with a 3-way apply.

Conflicts: Menu.qml - the deleted resultProc Process block carried the
baseline annotation "// Implements: SW-REQ-260922-FGZQ"; it is deleted with
the block (FGZQ stays implemented by applyDmenuSelection). menu-test.sh - the
PR's two source assertions are kept right after the "mouse activation"
assert, ahead of the baseline proof witness blocks.

Product diff vs baseline is line for line the upstream diff, plus that one
removed annotation line. menu-test.sh: 210 ok.

Upstream-Head: b7bd59c
Baseline: 1e43373

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
buger added a commit to probelabs/omarchy that referenced this pull request Oct 4, 2026
…t (superseded caller fixed, dead menu process open)

The baseline merge carried quattro's description, mitigation and customer impact,
which say a superseded caller waits forever. On this mirror omacom#9056 answers the
superseded caller as cancelled; the hang remains only when the menu process dies
(omarchy-menu-select has no deadline), as posted on omacom#9056 and omacom#9057. The first
note names this mirror's baseline, quattro-proof 41076fd. Evidence refreshed (box).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
buger added a commit to probelabs/omarchy that referenced this pull request Oct 4, 2026
…ro-proof 1e43373)

Mirror of omacom#9056 at head b7bd59c: the upstream change applied onto
quattro-proof 1e43373, followed by the proof work for the review. This
commit changes no file; it records the mirror at the branch tip, where the
review pipeline reads it (Proof-* trailers).

Proof-Change-Key: pr/9056
Proof-Upstream-Repo: github.com/omacom/omarchy
Proof-Mirror-Of: refs/pull/9056/head
Proof-Upstream-Head: b7bd59c
Proof-Head-Ref: fix-menu-summon-orphans-request
Proof-Change-Base: 158e8cf
Proof-Base-Ref: quattro
Proof-Baseline: 1e43373
Proof-Baseline-Ref: quattro-proof
Proof-Previous-Mirror: b1fd500
buger added a commit to probelabs/omarchy that referenced this pull request Oct 6, 2026
…ow the PR's displaced-request answer

- test/reports/report-cmulr95nw0kqr1gw46i7f50xj.sh keeps a stand-in shell
  alive and puts the tree's bin/ on PATH (the callers now look up the shell
  that took their request), and also runs the releaseProc writes of a
  revision that answers a displaced request through finishDoneFile. On this
  tree it exits 0: both callers are answered.
- test/node/report-reproducers.test.mjs: the omacom#9057 expectation flips to the
  fixed behaviour (as on the omacom#9056 mirror).
- KI-MENU-REQUEST-LIFECYCLE: note on the two legs omacom#9031 fixes (re-summon,
  dead menu process) and the one it leaves (busy resultProc); mitigation
  and customer impact for this mirror; reproducer back to the static green
  tripwire pocs/menu-qml-static.sh.
- test/bdiff/harness.mjs: Verifies annotation for the replay of the
  displaced-request answer (SW-REQ-260922-C8HX).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread shell/plugins/menu/Menu.qml Resolved
The merge from quattro brought in selectionProc, which queues root.requestSerial with every immediate-save toggle and assigns it to an int property before starting the save. This branch had removed requestSerial along with the shared answer process, so each toggle queued undefined, the assignment threw, and no checkbox change in a menu like the typing pickers was ever saved. requestSerial and its two increments are back.

The merge also brought back resultProc, which nothing starts any more and which still read the removed applySerial, and it dropped the two menu-test assertions that guard the open() answer and the per-answer process. resultProc goes again, the assertions return, and a third pins requestSerial in place.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot omarchybot added the verified Omarchy Triage has verified that this issue is ready for final review label Oct 21, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

The merge from quattro in 27e8c77 broke immediate-save checkboxes, as Greptile flagged. I pushed a fix to your branch as cdc2952 and re-verified the whole pull request on a disposable Omarchy VM running the real shell from this branch.

What was wrong. quattro added selectionProc, which queues root.requestSerial with every toggle in an omarchy-menu-select --multiple --on-change menu (the typing pickers, for one) and assigns it to an int property before starting the save. This branch had removed requestSerial, so each toggle queued undefined, the assignment threw (Menu.qml:1087: Cannot assign [undefined] to int in the shell log), and the change was never saved. The merge also brought back resultProc, which nothing starts any more and which still read the removed applySerial, and it dropped the two menu-test.sh assertions added in b7bd59c.

What changed. requestSerial and its two increments are back, resultProc is gone again, the two assertions are restored, and a third pins requestSerial in place. Each assertion fails on the tree it guards against: the first two on quattro, the third on 27e8c77.

What ran, on the worker:

  • A toggle in an on-change multi-select saves on quattro 087f73d, never saves on 27e8c77, and saves on cdc2952 (3 of 3).
  • 20 concurrent omarchy-menu-select, then Escape: 19 callers left waiting on quattro, 0 on cdc2952.
  • Two summons: A is answered and exits 1, and B still returns its selection.
  • ./test/cli passed, and so did the menu, menu-plugin, keybindings-menu, menu-guards, menu-guards-parallel, menu-images, menu-open-budget, menu-guard-budget, menu-keybindings-key-names and tray-menu shell tests.
  • The branch merges cleanly with current quattro.

Second opinion: Codex Medium reviewed the pull request as it now stands and found no defects. It agreed that nothing else depends on the removed process closing the menu, and that no path calls open() meaning to keep an in-flight request. It agreed with a conclusion already written down, so its independence is not guaranteed.

This is waiting on CI, then on the maintainer.

@omarchybot omarchybot removed the verified Omarchy Triage has verified that this issue is ready for final review label Oct 28, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

This branch no longer merges with quattro, and #7826 fixes the same bug and was opened first, so I'm leaving the choice between them to the maintainer rather than bringing this one up to date. @FernandoJVideira, thank you for the fix and for the burst reproduction behind it.

The conflict. It is only in test/shell.d/menu-test.sh. quattro's #16334 removed every test that reads QML source as text, including the block where this branch's three assertions sit. Merging quattro in and taking its version of that file leaves the Menu.qml change exactly as it was, with no test left for it. I did that merge locally to check, and did not push it.

The competing fix. #7826 (wico216, opened 2026-08-22, already labelled verified) fixes #7818. #9057, which this branch closes, was closed as a duplicate of #7818. Both pull requests answer a displaced request before it is replaced, and both stop a shared Process from dropping an answer: #7826 queues answers, and this one gives each answer its own process. open() is the only way into openDmenu() and openExistingMenu(), so the two cover the same paths. #7826 merges cleanly with current quattro and comes with a test that runs the real Menu.qml through the supersede cases. The one difference I could find: this branch only answers when a request is active, so re-summoning a menu that is already open doesn't close it and reopen it within the same call. #7826 does that, and its earlier review found nothing visible on screen.

Second opinion: Codex Medium and muse-wonder via pi (thinking high) were each given both pull requests without my conclusion. Both found that each one fixes the cause and breaks nothing, including the on-change checkbox saves, and both picked #7826 under the rule that the older fix wins unless the newer one is clearly better. Their answers matched mine, so their independence is not guaranteed. This was source review only, and nothing ran on a worker this time.

This is waiting on the maintainer to choose between #7826 and this one.

@omarchybot

Copy link
Copy Markdown
Collaborator

Thanks for merging quattro back in, @FernandoJVideira. The branch merges cleanly again. I'm still leaving the choice between this and #7826 to the maintainer, and #7826 remains the one I'd bring forward.

What the merge changed. The Menu.qml change is exactly what was checked on a worker in October. In test/shell.d/menu-test.sh the merge kept quattro's version, which removed the source-reading tests in #16334, so this branch no longer has a test of its own.

The competing fix. #7826 (wico216, opened 2026-08-22) fixes the same stranded omarchy-menu-select waiter and was opened first, which settles it when the two fixes are this close. It was brought up to date with quattro today, merges cleanly, and has a test that runs the real Menu.qml through a select displaced by the menu and by newer selects. Codex Medium, given both diffs, also picked #7826. It found one difference between them, which I checked against the source. This branch answers the displaced request in open(), and #7826 answers it inside openDmenu() and openExistingMenu(). Every shipped caller goes through open(), so the two behave the same in normal use. They differ only when a helper is called directly, for example omarchy-shell shell call omarchy.menu openExistingMenu root, which leaves a waiting select stranded here and not on #7826. Codex found no regression from replacing the shared Process with one detached write per answer: each request has its own files, so the order the writes finish in doesn't matter.

I didn't run this head on a worker this time. Its Menu.qml change hasn't changed since the last run, and it isn't the fix being brought forward.

Next: it waits on the maintainer to choose between the two. You don't need to do anything unless they ask for this one.

Comment on lines 116 to 117
property int requestSerial: 0
property int applySerial: 0
property var items: ({})

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Keybindings no longer run

Removing applySerial breaks choosing a row in the keybindings menu. activateIndex() still runs applySerial = requestSerial before closing the menu or running the chosen command. Assigning to that undeclared name raises a QML error, so clicking a row or pressing Enter leaves the menu open and does nothing.

Remove the leftover assignment along with the unused resultProc, or restore the property.

@omarchybot

Copy link
Copy Markdown
Collaborator

At 779f682eae68d9f381557e672821d2d8df6a9a0e, the source confirms Greptile’s dangling applySerial finding: the property is removed, but the keybindings branch of activateIndex() still assigns it at shell/plugins/menu/Menu.qml:927, before closing the menu or dispatching the binding. The unused resultProc also remains and reads root.applySerial. This head was reviewed in source; it was not run on a worker.

There is one piece of coverage to preserve from this branch: its active-request guard in open() also runs before the new openKeybindings() clears the pending request’s files. #7826 currently finishes requests in openDmenu() and openExistingMenu(), so its update needs to cover the keybindings entry point too. I recorded a handoff to #7826’s own queue session to carry this guard and coverage across, crediting @FernandoJVideira, and extend its runtime test for that path.

I compared the current diffs of #7826, #9031, #9056 and #17239. Opus 5.5 High and muse-wonder via pi, thinking high, also reviewed them and selected the older #7826 with that coverage folded in. That agrees with my source review as GPT-6 in Codex (effort not exposed); independence is not guaranteed. This pull request stays open, waiting on the maintainer’s choice between the competing fixes. Nothing was pushed or marked verified in this run.

omarchybot added a commit to wico216/omarchy that referenced this pull request Nov 26, 2026
Carry the active-request guard from omacom#9056 across all three entry points. The native keybindings menu now clears request state too, and must answer the displaced caller first. Guarding the finish also avoids closing and reopening an idle menu.

Extend the runtime fixture to cover a select displaced by keybindings and check that delayed writes leave the replacement open.

Co-Authored-By: FernandoJVideira <03.pleaser-minster@icloud.com>

Co-Authored-By: GPT-6 (Codex) <noreply@openai.com>
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.

Spamming a menu-summoning keybinding (Super+K) leaks orphaned omarchy-menu-select processes

4 participants