[low] fix: [qintel_helper] add missing f-prefix to rate-limit log message - #880
Open
elhoim wants to merge 1 commit into
Open
[low] fix: [qintel_helper] add missing f-prefix to rate-limit log message#880elhoim wants to merge 1 commit into
elhoim wants to merge 1 commit into
Conversation
The 429 rate-limit branch builds its log message as a plain string
literal containing {request_attempts} and {wait_time} placeholders, but
never marks it as an f-string. An analyst reading the module's logs
during a Qintel rate-limit event sees the literal text
"rate limit reached on attempt {request_attempts}, waiting {wait_time}
seconds" instead of the actual attempt count and wait duration, making
the log line useless for diagnosing retry behaviour.
Verified with py_compile on the changed file and the full pytest suite
against a live modules server on port 6772: 161 passed, 4 skipped, 5
subtests passed, matching the baseline.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8
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.
BLUF — The 429 handler in qintel_helper.py builds its rate-limit message from a plain string literal rather than an f-string, so the {request_attempts} and {wait_time} placeholders are logged verbatim instead of the attempt number and backoff duration. This PR adds the missing f prefix. Operators debugging Qintel API throttling now see the real retry count and wait time in the log instead of placeholder text.
The 429 rate-limit log message in
qintel_helper.pywas a plain string literal, not an f-string:Because the
fprefix was missing, the{request_attempts}and{wait_time}placeholders were never interpolated — the log line prints the literal text{request_attempts}and{wait_time}instead of the actual attempt number and wait time.Impact: When the Qintel enrichment module hits the Qintel API's rate limit, the log message an analyst or operator relies on to understand and debug the throttling behavior is useless — it shows placeholder text instead of which attempt this is and how long the module is waiting before retrying.
Fix: Added the missing
fprefix so the log line correctly interpolatesrequest_attemptsandwait_time. This is a one-line change with no behavior change beyond the log text now being correct.Found during a review of the repository; other findings are being submitted as separate PRs.
Verification
py_compile misp_modules/lib/qintel_helper.py: OK🤖 Generated with Claude Code
https://claude.ai/code/session_018dfYpyaSZd1nxSRLr8suj8