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 shares a bounded cache across GitHub readers so expired metadata can return immediately while refreshing. Example: A GitHub preview is read after its 60-second cache expires.
Review scores
ProductKind: Performance · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open for landing: it provides a useful latency improvement, resolves the previous review findings, and introduces no further actionable defect found in this review. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherControl UI requests enter Gateway identity and authorization owners, which use credential-scoped caches and the GitHub plugin transport to return previews, repository results, and account display facts. flowchart TD
A[Control UI request] --> B[Gateway authorization]
B --> C[Current GitHub identity]
C --> D[Bounded read cache]
D --> E[Cached response with freshness]
D --> F[GitHub transport]
F --> D
Technical reviewBest possible solution: Land the shared bounded cache with explicit freshness markers and the retained live-authority and strict-publication checks. Do we have a high-confidence way to reproduce the issue? Current-main source awaits expired GitHub reads; the supplied controlled-latency comparison demonstrates that delay, but this read-only review ran no target code. Is this the best way to solve the issue? A shared cache removes duplicated policy while preserving bounded loads, replacement ordering, failure eviction, identity scoping, and strict verification for publication. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against e353566c506d. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +80, Tests +580, Docs +22, Other +2. Total +684 across 32 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel 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 (4 earlier review cycles)
Reviewed October 11, 2026, 3:58 PM ET / 19:58 UTC (Revision 5). |
794afc5 to
d9491c3
Compare
Reuse one bounded stale-read cache for Actions, hover previews, repository search, and display-only credential verification. Preserve current reader authority and strict publication verification.
Settle refreshes through promise callbacks after installing the shared entry, preserving synchronous loader admission and error eviction.
Keep credential and requester checks before every background dispatch, and cover profile removal and token rotation through the Gateway RPC.
d9491c3 to
1ae921e
Compare
…enclaw#169143) * perf(github): serve stale Control UI reads during bounded refresh Reuse one bounded stale-read cache for Actions, hover previews, repository search, and display-only credential verification. Preserve current reader authority and strict publication verification. * fix(github): keep refresh promise ownership immutable Settle refreshes through promise callbacks after installing the shared entry, preserving synchronous loader admission and error eviction. * fix(github): retain read authority during stale refreshes Keep credential and requester checks before every background dispatch, and cover profile removal and token rotation through the Gateway RPC. * fix(github): preserve personal account freshness
What problem this solves
Expired GitHub previews, publication account options, and repository searches wait for GitHub before the Control UI can respond, even when a previous successful result is available.
Change
Extract the board Actions stale-read mechanism into one bounded cache factory and reuse it for preview, repository search, and display-only credential verification. Expired successful metadata returns with
stale: truewhile one bounded refresh runs. Publication still requests fresh verification. Every response and authenticated outbound request retains the current identity and requester checks.The factory replaces the separate cache policies and preserves forced-refresh ordering, existing error cooldown, clear-time invalidation, and the bound on all active loads, including superseded work. The existing
collection-runtimeSDK subpath gains one factory; there is no new subpath or configuration. Production LOC is +312 / -230, net +82 (excluding tests, test support, and docs); the growth preserves those concurrency/lifecycle contracts and adds explicit freshness fields.Cold reads, explicit preview refreshes, due OAuth token renewal, and detailed PR visibility/exact-head checks still await their authoritative owner. No Team state or real browser was used.
Evidence
A synthetic rig with 800 ms item/account latency and immediate repository-visibility responses on AWS Crabbox
cbx_60d8e8bf5e38, baselinea17bd679979e1dc69bba795222c5dce5da750815, measured 25 expired reads after warm-up:github.previewsessions.github.optionsAll 25 candidate responses carried the stale marker. Both versions made 26 upstream calls per surface, including warm-up; background completion is outside the request timing. Preview timings cover the preview loader; options timings use the RPC fixture. This is synthetic latency evidence, not a live deployment measurement.
The initial options regression failed against the old main implementation while the upstream request was held. The final authorization regressions use the real Gateway dispatch, managed profile files, and prepared identity owner. They hold repository admission, return the stale response, then remove or rotate the profile before releasing the response. The unchanged-profile case must complete refresh; the retired cases must prevent subsequent authenticated requests. Search retries similarly retain requester authorization across redirects and optional-auth retry.
Latest candidate replay on the isolated Linux rig: preview loader p50/p99 0.215 / 0.551 ms and
sessions.github.optionsRPC 5.273 / 9.276 ms, again with all 25 results marked stale and 26 upstream calls per surface. The replay took 56.97 s. A first replay timed out during worker-backed fixture setup; correcting its artificial-clock handling fixed the benchmark without a product change.The final focused run passed 10 files / 208 tests in 285.98 s. The isolated authority run passed all five cases in 45.85 s. Replacing the three affected modules with previous-head
794afc556f2f3e71c2adf3423a712b4da70ba08cmade all four negative controls fail for the intended reason in 56.93 s: retired preview credentials reached GitHub, and search made five/three calls instead of two on redirect/401 retry. The fixed preview trace after repository admission is:The changed gate passed format, line caps, SDK budgets and boundaries, all 28 core test type graphs, and core/extension/extension-test/script types. It then found seven unused exports in untouched Telegram and subagent-store files. Removing the entire PR patch and running the same scan at exact main
292766cf8575a5d477b41efea72ab50d7a9c6be9reproduced all seven. The original gate remains red for that inherited finding; no skip flag was used. All subsequent native gate commands passed, including core/extension/script lint and runtime-cycle guards. Export-name collision checks and all six closure/CI-planning files passed (146 tests, 199.15 s).Standalone test cost:
pnpm test src/gateway/server-methods/control-ui.github-preview-refresh.test.ts --maxWorkers=1passed all three cases in 53.936 s wall on the Linux rig (46.43 s Vitest duration, dominated by module preparation). The final personal-account correction preserves the prepared freshness fact while revalidating live selection. Its new RPC regression primes personal verification before shared verification, expires only the personal facts, and holds that refresh: both personal and top-level stale markers must survive. It fails on the preceding code and passes with the correction. The options and personal-authorization suites passed 33 tests in 181.33 s (new case 3.9 s); targeted lint and core/Gateway-methods typechecks also passed. Independent Codex review is clean.The earlier rebase resolved only the SDK-budget conflict, retaining main’s four additional exports. Final-head CI run 38169251462 passed on
043bab854082ac0261bf32f7a0347e6de7cccf05, including all required checks (758 s wall for the full CI run). ClawSweeper reviewed that same head as ready with zero findings. Merged asea4b186dbfcfe499ac985bbc5c7cb62d1310cc8f.Earlier remote proof passed 525 selected tests, the export-name guard, closure/CI-planning checks, and a full build (262.6 s, 152 SDK subpaths). An initial cache lint error was corrected. Earlier-head CI had a terminal-layout failure also present on main run 38147604740, job 114494370832, at the same
chat-panel-layout.e2e.test.ts:379hidden-canvas assertion. Its status-probe failure was not reproduced on main and is not claimed as inherited; final-head CI will be assessed separately.The first new authorization run on Hetzner
cbx_cddc837cdf76stopped at a test-context fixture error before testing behavior; that fixture was corrected. Subsequent Hetznercbx_f21fb1068f08source sync and full-resync stalled before executing any test and the lease was released. Final validation uses the authorized isolated Linux rig with the exact staged patch on292766cf8575a5d477b41efea72ab50d7a9c6be9.