Repository navigation
fix(quota-tracker): narrow bare-except to ImportError (closes #1062) - #1230
bassilkhilo-ag2 wants to merge 1 commit into
Conversation
…onichi#1062 Swapping except Exception for except ImportError lets non-import failures (RuntimeError, AttributeError, etc.) from status_read_path propagate as visible tracebacks instead of silently falling through to "No quota-state.json found", masking real bugs for hours. Tests: 7/7 (static clause checks + RuntimeError propagation + ImportError graceful message + live happy path). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Bassil Khilo seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
VasiliyRad
left a comment
There was a problem hiding this comment.
Duplicate src change with already-approved #1180. Both PRs have the identical 1-line fix to skills/quota-tracker/scripts/read-quota.py (except Exception → except ImportError).
Test files differ in name and language:
- #1180:
tests/quota-bare-except.test.py(Python, 126 lines) - #1230:
tests/quota-tracker-bare-except.test.sh(Bash, 115 lines)
Test names are different, so no FS collision. They could co-exist as complementary Python + Bash coverage, but the source change is redundant — whichever lands second will show 0 src changes.
Suggestion: close this PR and add just the bash test file as a separate one-file PR (since #1180 already carries the src fix). Or close #1180 and let this carry both. Either way, please don't land both as-is — confusing diff history.
If this is intentional dual-test coverage, mention it explicitly and I'll approve. Otherwise, deduplication needed.
|
Closing — superseded by VasiliyRad's #1094 which covers the same one-token fix. |
Summary
Single token swap on
skills/quota-tracker/scripts/read-quota.py:31:The
except Exception:was masking real errors fromstatus_read_path()— if a future workspace_default refactor raises an unexpected exception type, it silently fell through to the misleading"No quota-state.json found"message. This pattern is only correct for the import-time failure mode (module not on path), whichImportErrorcovers precisely.This is the bug that kept the quota dashboard dark for ~12h on 2026-05-21: the path off-by-one raised
ImportError, got swallowed byexcept Exception:, and set_canonical = None.Test plan
python3 ~/.claude/skills/quota-tracker/scripts/read-quota.pystill prints live 5h/7d windows🤖 Generated with Claude Code