Skip to content

Run the audio watchdog's commands under C.UTF-8, not C - #56

Merged
maralcbr merged 1 commit into
mainfrom
fix/watchdog-utf8-locale
Oct 24, 2026
Merged

maralcbr merged 1 commit into
mainfrom
fix/watchdog-utf8-locale

Conversation

@maralcbr

Copy link
Copy Markdown
Member

Summary

The audio watchdog declines every automatic restart on current installs:

omarchy-audio-watchdog: Not restarting audio: the shell state is unknown

System.run() forces LC_ALL=C. Under C, Quickshell 0.3.2 prints Qt's Detected locale "C" ... which is not UTF-8 warning on stdout, ahead of the JSON from quickshell list -j. So shell_instances() can't parse the listing, stop_shell() returns unknown, and the restart is declined.

record() runs before stop_shell(), so each declined attempt also uses up the restart budget. On the M2 Max, three refusals right after login exhausted WirePlumber's three per hour, and the next real repair was refused with EXHAUSTED. This affects every automatic WirePlumber/stack repair, including the mic mapper's.

Fix: LC_ALL=C.UTF-8. Messages stay in English (why LC_ALL was set), and Arch / Arch Linux ARM ship C.utf8 in glibc itself, with no locale generation needed. omarchy-mac 0.2.1.

Evidence

  • M2 Max (omarchy-mac 0.1.4, Quickshell 0.3.2): from a systemd --user transient unit, as the mapper starts it, shell_instances() returned None with the old code and 1 with this one. With this change in place, a live mic recovery run went through (#54 comment).
  • Test: watchdog-test.sh adds a Quickshell stub on PATH that prints the warning on stdout under C. It fails against main's watchdog ("a running shell is counted, whatever locale the session has") and passes here. The full suite passes in a Debian container.
  • Review: GPT-6 Astra, CORRECT. It checked that no parsed command output depends on C versus C.UTF-8 and that notifications don't go through run().

Not in this PR

Astra agrees unknown refusals shouldn't count against the restart budget, since nothing was touched. That's a separate behaviour change for its own PR.

Under LC_ALL=C, Quickshell 0.3.2 prints Qt's "Detected locale C ... not
UTF-8" warning on stdout, ahead of the JSON from `quickshell list -j`.
shell_instances() could not parse it and returned None, so stop_shell()
reported 'unknown' and every automatic WirePlumber or stack restart was
declined ("the shell state is unknown"). record() runs before
stop_shell(), so each declined attempt still counted against the
restart budget: on the M2 Max three of them right after login exhausted
WirePlumber's three per hour, and the next real repair was refused.

C.UTF-8 keeps the commands' messages in English, which is what LC_ALL
was there for; Arch and Arch Linux ARM ship it in glibc itself (C.utf8),
with no locale generation needed. The test runs a Quickshell stub
that prints the warning on stdout under C, and fails against the
previous code. omarchy-mac 0.2.1.
@maralcbr
maralcbr requested a review from scottjones as a code owner October 24, 2026 00:36
@greptile-apps

greptile-apps Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Changes the audio watchdog’s child commands to use C.UTF-8, keeping Quickshell’s locale warning out of its JSON output.

  • The audio watchdog reads Quickshell's shell list under a UTF-8 locale.

The review found no actionable issues. Tests were inspected, not run.

Reviews (1) · Last reviewed commit: "Run the audio watchdog's commands under ..." · Reviewed by Greptile

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant