Repository navigation
refactor(quota-tracker): narrow bare-except to ImportError (closes #1062) - #1180
Closed
bassilkhilo-ag2 wants to merge 2 commits into
Closed
bassilkhilo-ag2 wants to merge 2 commits into
bassilkhilo-ag2 wants to merge 2 commits into
Conversation
…nichi#1062) Per Lucy's code review on sonichi#1055: the except Exception on read-quota.py:31 masked a real import path bug for ~12h by silently swallowing any exception from workspace_default, not just ImportError. Narrow so unexpected exceptions from status_read_path() (e.g. future workspace_default regressions) propagate and appear in cron pass logs rather than silently producing the misleading "No quota-state.json found" message. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
VasiliyRad
approved these changes
May 26, 2026
…chi#1062) 5 structural tests verifying the `except ImportError` constraint in skills/quota-tracker/scripts/read-quota.py. Companion tests to the 1-line fix in the same commit — extracted from the bundled PR sonichi#1165 (which mixed in unrelated changes). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Collaborator
Author
|
Added 5 structural tests ( Note: VasiliyRad's PR #1094 has the same single-line fix but no tests; PR #1165 has tests but is bundled. This PR (#1180) now has both the clean fix and the tests. PRs #1094, #1165, and this PR all close #1062 — Bassil should pick one to merge. |
This was referenced May 27, 2026
2 tasks done
Collaborator
Author
|
Superseded by #1094 (VasiliyRad's fix). Both change the same single line in read-quota.py:25. Deferring to theirs. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
skills/quota-tracker/scripts/read-quota.py:31catchesexcept Exception:around theworkspace_defaultimport +status_read_pathcall. This swallows any exception — not justImportError— so ifstatus_read_path()ever raises unexpectedly (e.g. a future workspace_default refactor), the error silently falls through to_canonical = Noneand produces the misleading"No quota-state.json found"message.This was the exact masking mechanism from the #1055 bug: a path miscalculation raised
ImportError, got caught by the broadexcept Exception:, and froze the quota dashboard for ~12h.Fix
One-character change:
except Exception:→except ImportError:. Only the import-path failure case sets_canonical = None; anything else propagates.Test
🤖 Generated with Claude Code