Skip to content

Keep JSON arrays whole when omarchy-shell falls back to qs ipc - #16773

Open
giuse wants to merge 2 commits into
omacom:quattrofrom
giuse:ipc-list-args
Open

giuse wants to merge 2 commits into
omacom:quattrofrom
giuse:ipc-list-args

Conversation

@giuse

@giuse giuse commented Oct 27, 2026

Copy link
Copy Markdown

When omarchy-shell reaches the shell through qs ipc rather than its socket, a JSON array argument does not arrive as sent. qs ipc call takes its arguments as a CLI11 multi-value positional, and CLI11 reads an argument in brackets as a list:

$ omarchy bar set <id> pinned '[]' --json
Too few arguments provided (4 required but 3 were provided.)
$ omarchy bar set <id> pinned '["a","b"]' --json
Too many arguments provided (4 required but 5 were provided.)

'["a"]' is worse: it is accepted and stored as the string "a".

The socket path sends arguments verbatim, so this only bites on the fallback: no socket yet, a stale one, a SKIP answer, or an argument holding a separator. Releases without the socket (4.0.6 here) hit it on every call.

The fallback now prefixes a space to any argument that starts with [ and ends with ]. CLI11 leaves that alone, and JSON.parse skips the space. Only fully bracketed arguments change, and those already lose their brackets today, so no argument that works now is altered. The socket path is untouched.

Quickshell knows about it (quickshell-mirror/quickshell#22): the maintainer calls it a misfeature of the argument parser that can't be disabled, triggered only when the first character is [ and the last is ]. This keeps Omarchy's callers correct meanwhile.

Validation

  • test/shell.d/shell-ipc-test.sh: a JSON array reaches qs ipc as one argument (fails without the fix), and travels over the socket unchanged. The file passes.
  • Quickshell 0.3.2 (2b4501a): checked qs ipc call directly. '[]', '["a","b"]' and '["a"]' are mangled; with the leading space, ' []', ' ["a","b"]' and ' [["x"],{"y":[1]}]' arrive intact.
  • On a running 4.0.6 shell (no socket, so always the fallback): this branch's omarchy-shell sets [], ["a","b"] and ["x"] through setBarWidget, and shell.json reads them back as the same arrays. The installed one fails with the errors above.
  • Not tested: a full quattro shell, where the socket path normally answers.

@greptile-apps

greptile-apps Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

omarchy-shell adds a leading space to fully bracketed arguments only when falling back to qs ipc. The socket path stays unchanged.

  • Bracketed JSON arrays stay whole when shell calls use qs ipc.

Reviews (2) · Last reviewed commit: "Tell one bracketed argument from two in ..." · Reviewed by Greptile

Comment thread test/shell.d/shell-ipc-test.sh Resolved
@omarchybot omarchybot added bug Something isn't working verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Nov 2, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Reviewed and verified on a worker built from the Omarchy ISO (Quickshell 0.3.2), with this branch linked as the running shell and the shell's socket moved aside so every call took the qs ipc fallback.

  • Reproduced on quattro: omarchy bar set omarchy.tray pinned '[]' --json fails with "Too few arguments", '["a","b"]' and '[["x"],{"y":[1]}]' fail with "Too many arguments", and '["x"]' reports success but stores x. On this head all four are stored and read back as the arrays sent. Through the socket, both versions behave identically.
  • Tests: test/shell.d/shell-ipc-test.sh passes on the head and fails ("a JSON array reaches qs ipc as one argument") with quattro's bin/omarchy-shell swapped in. ./test/cli and every shell test that calls omarchy-shell pass, both on this branch and on it merged with current quattro. The one exception is i18n-test.sh, which fails the same way with or without this change because the worker can't generate locales.
  • Second opinion: Codex Medium and muse-wonder (via pi, thinking high) both reviewed it. Both found the fix correct and the right size, and found no JSON handler that trips over the leading space; their agreement is not guaranteed independent. They also noticed something worth recording: the space is added to any argument shaped [...], not only JSON. So on the fallback path a plain string like omarchy-shell notifications dismiss '[build]' now arrives as [build] rather than build. That makes "no argument that works now is altered" in the description slightly too broad. I left the change as it is: no caller in the tree passes such an argument (dismiss gets "Omarchy Migrations", background gets absolute paths), the socket path, which is the normal one on quattro, passes those strings literally, and the old fallback result was the CLI11 list behaviour rather than anything a caller could rely on.
  • Related: [quattro] Pause shell plugin loads around package updates #16900 also edits bin/omarchy-shell (the missing-target notification). Its change handles the result after the qs ipc call, and this one only changes the arguments passed to it, so the two don't conflict in what they do, though one may need a small rebase after the other lands.

Nothing pushed, and nothing is needed from you. It's waiting on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants