fix(scm-github): throttle repeated GitHub ETag network warnings#1554
fix(scm-github): throttle repeated GitHub ETag network warnings#1554ChiragArora31 wants to merge 5 commits into
Conversation
Greptile SummaryThis PR introduces a per-guard/per-cache-key transient-warning throttle for the three GitHub ETag guards in
Confidence Score: 5/5Safe to merge — all three ETag guards are consistently updated, every 304 and success path clears the suppression key, and the fallback behavior is preserved on every error path. The change is purely additive observability throttling. Suppression only affects logging, never the returned boolean, so data correctness cannot regress. All catch-path 304 branches now call markETagGuardSuccess, Guard 3 is fully wired up, duplicate imports in the test file are gone, and clearETagCache resets the new Set. No files require special attention.
|
| Filename | Overview |
|---|---|
| packages/plugins/scm-github/src/graphql-batch.ts | Adds throttling helpers and wires them into all three ETag guards; all catch-path 304 branches now call markETagGuardSuccess, and clearETagCache clears the suppression set. Previously flagged gaps are resolved. |
| packages/plugins/scm-github/test/graphql-batch.test.ts | Adds Guard 1, 2, and 3 throttling tests covering suppression, recovery via catch-path 304, and non-transient pass-through; imports are clean with no duplicates. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[ETag Guard call] --> B{execGhAsync success?}
B -- Yes, 304 --> C[markETagGuardSuccess\nclear suppression key]
B -- Yes, 200 --> C
C --> D[return result]
B -- Error --> E[extractErrorOutput]
E --> F{is304 in output?}
F -- Yes --> C
F -- No --> G{is304 in errorMsg?}
G -- Yes --> C
G -- No --> H[warnETagGuardFailure]
H --> I{isTransientNetworkError?}
I -- No --> J[observer.log warn always]
I -- Yes --> K{warningKey in\ntransientNetworkWarningKeys?}
K -- Yes, suppress --> L[return true\nassume changed]
K -- No --> M[add key to Set\npruneIfNeeded]
M --> J
J --> L
Reviews (3): Last reviewed commit: "fix(scm-github): clear etag warnings on ..." | Re-trigger Greptile
|
Addressed all review points in
Validation:
|
Clear suppression keys on catch-path 304 recovery for all guards, migrate Guard 3 to shared throttling, and expand transient network detection/tests so repeated warnings are deduped only for transient failures. Made-with: Cursor
703e6b0 to
a39c5c6
Compare
…rk-warning-throttle
Co-authored-by: Cursor <cursoragent@cursor.com>
|
Want your agent to iterate on Greptile's feedback? Try greploops. |
…-1554 # Conflicts: # packages/plugins/scm-github/src/graphql-batch.ts
Resolves #1526.
Summary
Root cause
When
gh apirepeatedly failed for transient connectivity reasons, every poll emitted the same warning even though the fallback behavior was already safe.Approach
Classify common transient network messages, remember which guard/key has already warned, and reset that memory on successful 200/304 responses. Non-transient failures keep logging every time.
Verification
pnpm --filter @aoagents/ao-plugin-scm-github test -- graphql-batch.test.tspnpm --filter @aoagents/ao-plugin-scm-github typecheckpnpm --filter @aoagents/ao-plugin-scm-github test