Skip to content

Refresh usage after reset expiry#201

Merged
cbusillo merged 1 commit into
mainfrom
fix/reset-expiry-refresh
Jun 17, 2026
Merged

Refresh usage after reset expiry#201
cbusillo merged 1 commit into
mainfrom
fix/reset-expiry-refresh

Conversation

@cbusillo

Copy link
Copy Markdown
Owner

Summary

  • Treat usage lanes whose resetsAt + 10s has passed as refresh-needed instead of waiting for normal snapshot age staleness.
  • Add persisted reset-expiry retry state so a stuck/same expired reset window retries after 30s, then falls back to normal cadence without tight loops.
  • Shorten the refresh-agent sleep to the next reset/retry deadline when it is sooner than the normal background interval.
  • Include the new reset-expiry state file in runtime reset/baseline cleanup checks.

Refs #199

Validation

  • swift test
  • zsh -n scripts/context-panel-runtime-baseline.sh
  • scripts/commit-gate.sh

Review Notes

  • Agent review found and I fixed a zero-sleep loop where suppressed retry state could still choose an already-past reset deadline.
  • Agent review found and I fixed partial refreshes consuming another account's pending retry.
  • Follow-up re-review found and I fixed lock-contention deferral so .skippedAlreadyRunning does not spin while another refresh holds the lock.

@cbusillo cbusillo merged commit 93f46e1 into main Jun 17, 2026
3 checks passed
@cbusillo cbusillo deleted the fix/reset-expiry-refresh branch June 17, 2026 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant