This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Repository navigation
Conversation
…rvices Bare `except:` catches BaseException (including KeyboardInterrupt, SystemExit, GeneratorExit) which can mask fatal signals and make the process unkillable. Narrowing to `except Exception:` preserves the catch-all intent while letting system-exit exceptions propagate. Affected files (12 occurrences total): - src/agent-api.py (3): JSON parse, body parse in HTTP handlers - src/dashboard.py (2): git log parse, fallback return - src/discord-bridge.py (6): access.json reads, tier detection - src/health-check.py (1): pgrep subprocess call 240/240 TS + 27/27 Python tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
bassilkhilo-ag2
approved these changes
Jun 5, 2026
bassilkhilo-ag2
left a comment
There was a problem hiding this comment.
Correct and safe. Narrowing bare except: to except Exception: across agent-api, dashboard, and discord-bridge is the right Python practice — bare except catches SystemExit and KeyboardInterrupt which we never want swallowed. All three call sites are in error-recovery paths where swallowing Exception is intentional. Approved.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Bare
except:catchesBaseException(includingKeyboardInterrupt,SystemExit,GeneratorExit), which can mask fatal signals and make the process unkillable or silently swallow shutdown. Narrowing toexcept Exception:preserves the catch-all intent while letting system-exit exceptions propagate normally.12 occurrences fixed across 4 files:
src/agent-api.py(3): JSON parse in/status, body parse in/voice/desired-state, body parse in/task-donesrc/dashboard.py(2): git log date parse, outer catch-all fallbacksrc/discord-bridge.py(6): access.json reads (×4), tier detection, TOFU pairingsrc/health-check.py(1): pgrep subprocess callMirrors upstream
fix(bridges,services): narrow bare except: → except Exception:(sonichi#1398).Test plan
🤖 Generated with Claude Code