Commit df4c8d2
Skip periodic chip refresh when fingerprint matches (#10307)
The 30s timer passed `allow_fingerprint_skip = false`, so the GitHub PR
chip re-ran `gh pr view` every tick. Each `gh` invocation makes a
GraphQL viewer precheck; across 3+ tabs this exhausts a user's
5,000-pt/hr quota (#9830).
Pass `true` so the timer uses the chip's fingerprint as a cache key.
Branch, cwd, and `git`/`gh`/`gt` commands still bust it.
Make the fingerprint skip status-aware so a previous `Error` or
`TimedOut` is treated as a cache miss. Otherwise retryable failures
would become sticky: `last_fingerprint` is recorded before the command
runs and `last_failure_fingerprint` is intentionally empty for
non-deterministic failures. Deterministic auth failures continue to be
suppressed via `last_failure_fingerprint`.
## Description
The recursive timer continuation in `fetch_chip_value_at_interval` was
the only call site passing `allow_fingerprint_skip = false`. Every other
entry point passes `true`. The chip's fingerprint inputs (`SessionId`,
`WorkingDirectory`, `GitBranch`, `RequiredExecutablesPresence`,
`InvalidatingCommandCount`) combined with `invalidate_on_commands
["git", "gh", "gt"]` already capture every input that can change the PR
URL.
`maybe_skip_fetch_due_to_matching_fingerprint` now filters out states
whose `update_status` is `Error` or `TimedOut` before the
fingerprint-equality check, so the periodic timer still retries
transient failures while successful refreshes are skipped.
Other periodic chips are unaffected. `Time`/`Date` have no fingerprint
inputs, so the skip check is a no-op. `ShellGitBranch`/`GitDiffStats`
route through the `GitRepoStatusModel` filesystem watcher on local
sessions and don't reach this path.
Warp version v0.2026.04.29.08.57.stable_01
## Linked Issue
Closes #9830.
- [ ] The linked issue is labeled `ready-to-spec` or
`ready-to-implement`.
## Testing
Measured GraphQL rate-limit consumption before and after disabling the
chip locally on macOS:
- Before: ~0.66 calls/sec sustained.
- After: ~0.012 calls/sec (1 external call in 84s; the rest were the
polling query itself).
`test_github_pr_chip_transient_failure_retries_with_same_fingerprint`
now passes `allow_fingerprint_skip = true` to exercise the same path the
periodic timer uses; without the status-aware filter it would
short-circuit as `Cached` and the transient failure would become sticky.
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
CHANGELOG-BUG-FIX: Stop the GitHub PR prompt chip from polling `gh pr
view` every 30 seconds when nothing has changed, preventing it from
draining the user's GitHub GraphQL rate limit.
---------
Co-authored-by: Oz <oz-agent@warp.dev>1 parent 98fa392 commit df4c8d2
2 files changed
Lines changed: 20 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
518 | 518 | | |
519 | 519 | | |
520 | 520 | | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
521 | 527 | | |
522 | 528 | | |
523 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
524 | 536 | | |
525 | 537 | | |
526 | 538 | | |
| |||
982 | 994 | | |
983 | 995 | | |
984 | 996 | | |
985 | | - | |
| 997 | + | |
986 | 998 | | |
987 | 999 | | |
988 | 1000 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
964 | 964 | | |
965 | 965 | | |
966 | 966 | | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
967 | 973 | | |
968 | 974 | | |
969 | 975 | | |
970 | 976 | | |
971 | | - | |
| 977 | + | |
972 | 978 | | |
973 | 979 | | |
974 | 980 | | |
| |||
0 commit comments