Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR measures session branch-PR cache freshness and retry windows with the existing monotonic clock. Example: A branch snapshot has a 90-second TTL, and Date.now advances 61 minutes before the normal poll at 60 elapsed seconds.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open: this PR fixes a current cache-timing defect with a focused change and sufficient Gateway proof; no actionable defects remain, and exact-head CI is pending. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe Gateway resolves a session’s GitHub checkout, caches branch PR observations, and supplies snapshots to Control UI subscriptions and publication readers. flowchart LR
A[Control UI subscription] --> B[Gateway subscription owner]
B --> C[Session checkout resolution]
C --> D[Branch PR cache]
E[Monotonic clock] --> D
D --> F[GitHub HTTP client]
D --> G[PR snapshot events]
Technical reviewBest possible solution: Land the existing focused monotonic-clock repair once the exact-head CI gate passes. Do we have a high-confidence way to reproduce the issue? Current-main source compares wall-clock deadlines directly, and the supplied built-Gateway comparison demonstrates premature expiry after a forward clock step; this read-only review ran no target code. Is this the best way to solve the issue? The patch is the smallest complete fix: all branch-cache deadlines use the existing process-local clock owner, without changing cache policy or adding state. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against eb370ce61139. Provenance checked
TestingProof path: shipped entry point. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +1, Tests 0, Docs +1. Total +2 across 4 files. Added test files: 0. View PR surface stats
LabelsLabel changes: No label changes. Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (2 earlier review cycles)
Reviewed November 3, 2026, 12:40 PM ET / 17:40 UTC (Revision 3). |
The in-process branch PR cache anchors its TTL on Date.now(); a wall-clock correction (NTP step, manual change, suspend/resume) extends or shortens the window. Anchor on performance.now() so the module-local cache ages by elapsed time. Compare and write in the same clock domain; no entry leaves the process.
… fixture The retention fixture's 61s wall-clock step only moved Date, so the branch cache's performance.now() deadlines never aged; the final poll then advanced elapsedMs by only 240,001ms, leaving the 5-minute rate-limit backoff unexpired (104 fetches instead of the expected 205). Advance the elapsed-time clock with the wall clock while keeping the backoff alive. Co-Authored-By: nebulacoder-v8.0 <[email protected]>
cb6f6ca to
f4b1e47
Compare
|
@obviyus — thanks for sweeping #191575 and #191577 into #191606. This PR (#191576) is the remaining same-shape cache window (session branch-PR cache in Status now:
It exercises the same elapsed-time shape as #190894/#190997/#191606. Happy to add the shipped Gateway proof if you'd prefer to land it here rather than fold it into another sweep. |
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Exact-head refresh: after-push required reconciling GitHub diff/base drift, so current main was merged without conflicts and the final head is |
|
Landed in c5828d0. Thanks @wangmiao0668000666. The branch pull-request cache now expires by elapsed time. |
What Problem This Solves
The session branch-PR cache used wall-clock epochs for its90-second success TTL and failure/quota backoffs. A forward wall-clock correction expired fresh branch snapshots early, making extra GitHub requests; a backward correction could retain stale snapshots too long. This is the remaining branch-cache member after #191606.
Changes
monotonicDeadlineAfter/monotonicNowowner at all five deadline write/comparison sites.Evidence
Built Gateway in secretless Node24.22.1 Docker, real Git checkout/branch/commit/remote, real WebSocket subscription RPC, and recorded local GitHub HTTP responses: main twice prematurely refetches revision2 after a process-local forward Date.now step; candidate twice retains revision1 through the original90-second TTL. Ordinary no-step reuse controls pass. Performance and actual timers are untouched; no system clock was changed.
The consolidated backward-clock regression fails on pre-fix main and passes on candidate. Both touched suites pass 11/11; targeted formatting and lint pass. Full before/after payloads, HTTP counts, isolation paths and run identifiers are in the proof comment below. No live GitHub or provider credentials required. No visual change or browser screenshot claim.
Risk and rollback
Two-way door: reverting restores the former in-process cache timing; no schema or persisted state migration. Blast radius is session branch-PR freshness and GitHub request/backoff timing; other cache owners and UI rendering are unchanged.
Detailed built-Gateway proof: #191576 (comment)