[log] Add debug logging to internal/githubhttp/rate_limit.go - #10586
Conversation
Add meaningful debug log calls to IsRateLimitText and RateLimitSignal to aid troubleshooting of GitHub API rate-limit detection, using the existing logHTTP logger. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds debug diagnostics for GitHub API rate-limit detection.
Changes:
- Logs sanitized rate-limit text matches.
- Logs nil responses and detected HTTP rate-limit signals.
Show a summary per file
| File | Description |
|---|---|
internal/githubhttp/rate_limit.go |
Adds rate-limit detection logging. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Balanced
| strings.Contains(lower, "secondary rate limit") || | ||
| strings.Contains(lower, "too many requests") | ||
| if isRateLimit { | ||
| logHTTP.Printf("IsRateLimitText: detected rate-limit indicator in text=%q", util.Truncate(sanitize.SanitizeString(text), 120)) |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@copilot address review feedback |
🔒 mcpg Read-Only Stress — gVisorSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30827279820
|
🔒 mcpg Read-Only Stress — default AWFSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS Part B detail: Gateway exposes only 22 read-only tools (get_*, list_*, search_*). All 7 write tool calls returned Part D/E detail: References: §30827279721
|
🔒 mcpg Read-Only Stress — docker-sbxSurface coverage: MCP tool calls + proxied CLI (REST) + GraphQL mutations
Overall: PASS
References: §30827284185
|
Summary
Adds meaningful debug logging to
internal/githubhttp/rate_limit.goto aid troubleshooting of GitHub API rate-limit detection.Changes
IsRateLimitText: logs when a rate-limit indicator is detected in error text (reusing the existinglogHTTPlogger and truncated/sanitized text, consistent withParseRateLimitResetFromTextin the same file).RateLimitSignal: logs when a nil response is passed (no signal possible), and logs the status code, remaining, and reset header values when a rate limit is detected.No new logger was created — the file already declares
logHTTP(used elsewhere in the same file), so all new calls reuse it per thepkg:filenamenaming convention already established.Validation
go build -o awmg .— succeedsgo vet ./internal/githubhttp— cleango test ./internal/githubhttp— passesOnly this one file was modified.