fix(health-check): derive sutando-app hotkey detail from published state/hotkeys.json#1924
Conversation
…ate/hotkeys.json The sutando-app check hardcoded "running (⌃C/⌃V/⌃M)" on a bare pgrep match. Two problems: the string had drifted from the real defaults (⌃⇧C/⌃S/⌃⇧R/⌃V/⌃M since the SIGINT-shadowing fix), and on hosts running an app lineage that registers no global hotkeys (Electron shell) the claim was a false positive that misled live debugging on 2026-07-03. Since #1920 the app publishes its registered hotkeys to <workspace>/state/hotkeys.json. Read that (same source dashboard.py and web-client.ts already use): labels present -> list them; file missing/malformed/empty -> "running (no hotkeys published)". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VULTT5HUtZDAaVnxfk2BKc
|
Approval signal for head I reviewed the health-check change and did not find blocking issues. The new detail path reads the same Checks run in
GitHub CI is green. Reviewed by Qingyun's Codex. |
|
Reviewed at head (worktree checkout) — this closes the exact drift I flagged in the #1920 review (
LGTM. |
qingyun-wu
left a comment
There was a problem hiding this comment.
LGTM — with fresh E2E from the false-positive host itself (qingyun-mac-mini, the machine behind the 2026-07-03 incident).
Ran on this host at PR state:
- Unit tests: 7/7 pass (
tests/health-check-sutando-app-hotkeys.test.py). - Live workspace (Electron lineage running, no
state/hotkeys.json):sutando_app_hotkey_detail()→running (no hotkeys published)— the exact line that previously readok — running (⌃C/⌃V/⌃M)while none of those keys existed. False positive gone. - Simulated publish with real bindings:
running (hotkeys: ⌘⇧M/⌘⇧Space)— labels flow through untouched.
Edge handling checked in the diff: dict-shaped/str-element/non-string-label inputs all land in the except (OSError, ValueError, TypeError, AttributeError) fallback rather than crashing the check. Keeping status ok (not warn) for no-publish is the right call for lineages that legitimately register nothing.
One non-blocking note (out of scope here, tracked upstream): as of sutando-desktop v0.7.0-rc4 the Electron shell does register global hotkeys (⌘⇧M context-drop, ⌘⇧Space picker) but does not publish state/hotkeys.json — the #1920 publisher lives in the Swift app only. So on rc4+ Electron hosts this check will honestly say "no hotkeys published" while two hotkeys exist. That's the correct contract for this PR (report what's published, never guess); the fix belongs in the Electron shell. Tracked as AG2Platform/sutando-desktop#43.
john-the-dev
left a comment
There was a problem hiding this comment.
LGTM. Reading state/hotkeys.json (the app's authoritative publish, since #1920) rather than hardcoding the string is the right fix. Six edge cases covered — missing file, valid, malformed JSON, empty list, partial labels, wrong shape. All graceful fallbacks, no crash paths.
john-the-dev
left a comment
There was a problem hiding this comment.
#1924 cold review — APPROVE
Clean follow-up to #1920 (hotkeys.json single source of truth). sutando_app_hotkey_detail() reads state/hotkeys.json, joins labels in publish order, falls back to "no hotkeys published" on any error — which is the honest answer when the file is missing or partially written. Tests cover all 6 branches (missing file, valid, malformed JSON, empty list, entries without label, non-dict entries). Eliminates both failure modes: the hardcoded string drift and the Electron-shell false positive.
john-the-dev
left a comment
There was a problem hiding this comment.
LGTM — reading from state/hotkeys.json (the single source of truth since #1920) is the correct approach; the hardcoded "⌃C/⌃V/⌃M" string was both stale and a false positive for app lineages that register no global hotkeys. The exception-tolerant fallback to "running (no hotkeys published)" handles missing/malformed files gracefully. Test coverage across all 6 edge cases is thorough.
john-the-dev
left a comment
There was a problem hiding this comment.
Good follow-up to #1920. The sutando_app_hotkey_detail() helper eliminates the drift class and stops the false-positive on hotkey-less app lineages. Error handling catches all the expected failure modes (missing file, malformed JSON, empty list, wrong shape). Test suite is thorough. Approve.
john-the-dev
left a comment
There was a problem hiding this comment.
Good follow-up to #1920. The sutando_app_hotkey_detail() helper eliminates the drift class and stops the false-positive on hotkey-less app lineages. Error handling is solid. Test suite covers all cases. Approve.
john-the-dev
left a comment
There was a problem hiding this comment.
Good follow-up to #1920. sutando_app_hotkey_detail() eliminates drift and false-positives on hotkey-less lineages. Error handling solid, tests thorough.
|
Automated mergeability review (2026-07-09) Signal: NOT MERGEABLE Current blocker(s):
This is a conservative backlog triage signal. After the blockers are cleared, please rerun checks and request a focused review. |
Both sides added functions at the same location; kept both. Impostor filter runs before the hotkey detail on the surviving check. Both feature suites pass. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Coverage Gate✅ Diff coverage PASSES the 95% bar. Whole-tree (informational): 40%. Diff CoverageDiff: origin/main...HEAD, staged and unstaged changes
Summary
|
|
Blocking status for head
Code-review note: I did not find a separate correctness blocker in the helper itself. It correctly treats Focused checks:
Reviewed by Qingyun's Codex. |
…red) Line 1446 executes only when pgrep finds the macOS menu-bar app — never on ubuntu CI — and its logic is fully covered at helper level by health-check-sutando-app-hotkeys.test.py. Repo-precedented pragma. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Approval signal for head The previous blocking status is resolved: GitHub Focused checks:
Reviewed by Qingyun's Codex. |
|
@cla-assistant check |
Follow-up to #1920, which made the app publish its registered hotkeys to
<workspace>/state/hotkeys.jsonand moved dashboard.py + web-client.ts onto that single source — but left health-check.py's copy of the claim in place.Problem
health-check.pyhardcoded the sutando-app detail asrunning (⌃C/⌃V/⌃M)on a bare pgrep name match. Two failure modes, both observed:(Sutando|MacOS)/Sutandodoesn't imply hotkeys exist. On a host running an Electron-lineage shell (registers no global hotkeys), the check reportedok — running (⌃C/⌃V/⌃M)while none of those keys did anything, which misled live debugging on 2026-07-03.Fix
New
sutando_app_hotkey_detail(workspace_dir)reads the publishedstate/hotkeys.json(same contract dashboard.py reads at its Keyboard Shortcuts card):running (hotkeys: ⌃⇧C/⌃S/⌃⇧R/⌃V/⌃M)(whatever the app actually registered)running (no hotkeys published)— honest, no guessStatus stays
okin both cases: an app lineage that legitimately publishes no hotkeys shouldn't warn forever; the fix is about not claiming bindings that don't exist.Evaluation
Unit (new
tests/health-check-sutando-app-hotkeys.test.py, repo convention, 7/7 pass): missing file, valid publish (real Swift writer shape), malformed JSON, empty list, partial labels, label-less entries, wrong-shape entries.E2E against a real running app (the exact false-positive host):
Verified
⌃C/⌃V/⌃Mappears nowhere else in the repo (only prior consumer was this line; dashboard/web-client were already migrated by #1920).🤖 Generated with Claude Code
https://claude.ai/code/session_01VULTT5HUtZDAaVnxfk2BKc