Repository navigation
Conversation
|
🦞👀 Pull request received. I will update this pull request when review starts. |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@clawsweeper review Ready at |
|
🦞👀 Re-review progress:
|
|
Codex review: needs maintainer review before merge. What this changesThis PR schedules independent Git maintenance checks and resumes unfinished pack retirement between hourly passes. Example: Checkout cleanup remains blocked under storage pressure after 600 small promisor packs arrive.
Review scores
ProductKind: Bug fix · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review This PR fixes a current maintenance starvation path, and the previous fixture finding is resolved. No remaining actionable defect was found; exact-head CI is still pending. Priority: P2 Before mergeNone. FindingsNone. Tests
Agent review detailsHow this fits togetherThe Gateway scheduler invokes the managed-worktree service, whose maintenance owner inventories registered repositories and uses leases and native Git to consolidate packs without changing their object set. flowchart TD
A[Gateway scheduler] --> B[Checkout cleanup]
A --> C[Independent Git wake]
B --> D[Existing maintenance owner]
C --> D
D --> E[Repository maintenance lease]
E --> F[Native Git consolidation]
F --> G[Bounded pack retirement]
Technical reviewBest possible solution: Keep the independent wake and backlog continuation in the existing lease-protected maintenance owner while retaining hourly routine work. Do we have a high-confidence way to reproduce the issue? Current-main source places Git maintenance after potentially paused cleanup, and the supplied exact-parent comparison reports no admitted Git work while cleanup remains blocked; this review executed no target code. Is this the best way to solve the issue? The patch repairs scheduling at the existing owner, preserves bounded consolidation and foreground lease behavior, and adds only the deadline-record continuation needed to finish interrupted retirement. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 1d72ad079047. Provenance checked
TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
PR surfaceSource +81, Tests +92, Docs 0, Other +418. Total +591 across 12 files. Added test files: 0. View PR surface stats
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. 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 (1 earlier review cycle)
Reviewed November 11, 2026, 12:04 PM ET / 17:04 UTC (Revision 2). |
|
Addressed item 1, “Isolate the new Git wake in the thaw timer fixtures.”
Both original CI failures reproduced locally before the repair. All 69 tests in the Gateway timer/worktree scheduler files now pass, and all 127 tests across the nine shared-fixture consumer files pass. The initial consumer run exposed the missing telemetry stub method; its nine failures were repaired and rerun. Codex autoreview of the final fixture repair is scoped-clean through P2. Full check details and the exact-parent dead-export attribution remain in the PR body. @clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
Merged via squash.
|
…w#197287) * fix(worktrees): keep pack maintenance running during cleanup * test(gateway): isolate worktree maintenance in timer fixtures
What Problem This Solves
Fixes Git pack maintenance stalling for hours when checkout cleanup waits on storage pressure or a large deletion backlog.
User Impact
Managed repositories can consolidate a burst of small packs while the Gateway is busy. Checkout cleanup keeps its storage-pressure protection; foreground preparations retain short, nonwaiting checkout leases.
Why This Change Was Made
Git maintenance was behind the entire cleanup sweep, which can pause indefinitely on I/O pressure. An independent five-minute wake now calls the same maintenance owner. Its hourly deadline still governs routine tasks; between hourly passes, at least 512 eligible small packs in one promisor class trigger bounded consolidation. Thresholds derive from existing pack budgets. Unfinished 250-ms retirement slices resume at the next wake even below that threshold, without repeating hourly graph work. No config, schema, or cache was added. Lease deferrals log the reason, and successful pack reductions log counts.
Evidence
The first CI head exposed two thaw-timer fixture failures: an unrelated real Git inventory interfered with recovery assertions, and a fake-clock wake waited for suspended admission that the test would only reopen after that wake completed. The repair isolates worktree maintenance in the thaw-specific fixture and stubs Git inventory in the shared timer fixture. All 69 Gateway timer/worktree scheduler tests now pass. The nine shared-fixture consumer files also pass all 127 tests after adding the method to their worker-free telemetry service stub. Production behavior and the measured code are unchanged.
Acceptance rule, recorded before measurement: keep cleanup blocked under simulated I/O pressure; restore the same synthetic 1,033 pinned baseline packs plus 600 new 64-KiB promisor packs before each sample. Use actual Gateway scheduling, registry, maintenance leases and native Git. Candidate must recover near baseline within a virtual hour and preserve the exact object set; parent must reproduce lack of progress. Five interleaved pairs plus five A/A pairs; report owner wall time, JS/native CPU and allocation as the cost of newly admitted work, not a speedup over doing no maintenance. Fixture has 62,000 files totaling 1.116 GB and 3,000 registry rows. APFS local proof does not establish btrfs performance, a 35-GiB agent DB workload, or post-deployment production convergence.
Scheduler and native 600-pack regressions fail on exact parent
3a6cc6597d1d1d32a4bef83fd3041fedf5f48e76; 88 focused tests pass with one existing Linux-only skip. The extended retirement-continuation regression also passes. Native burst test: 14.9 seconds; full focused invocation: 141 seconds including compilation. Codex autoreview of the complete local change is scoped-clean through P2.pnpm check:changed --stagedcompleted; its three local lint findings were repaired and targeted core/script lint and script typechecking pass. The final fixture repair also completedpnpm check:changed --staged: all checks passed except the same 89 ordered dead-export findings. The only remaining failure is the unrelated dead-export scan: the exact parent also fails, with source-causal attribution recorded for all 57 production and 32 full-tree entries. These remain main regressions, not ignored noise; the introducing commits are listed below.Production growth is 80 lines, required to separate admission, derive backlog policy, preserve unfinished retirement state in the existing deadline record, and record lease/count outcomes. No second maintenance owner or pack inventory cache. The scoped 93-line test allocation covers the two missing regression boundaries and extends the existing retirement contract; the shared scalar is unchanged. Changed modules have no Control UI imports. No live service operations or deployment are part of this PR.
Five counterbalanced A/B pairs and five A/A control pairs passed on the measured production head
8683fa86c7fe971c72fc9a9f9a976d00037bc58cagainst exact parent3a6cc6597d1d1d32a4bef83fd3041fedf5f48e76. All 64,254 objects remain present; a subsequent quiescent tick performs zero consolidations. The baseline reaches a virtual hour without admitting any Git work. Candidate reaches near-baseline in 5–15 virtual minutes (median 10), using one to three bounded passes.This restores bounded background work and therefore spends CPU/allocation that the broken scheduler never spent. It is not a claim that compaction itself became faster. Candidate wall spread is 7.209–12.076 seconds, reflecting one to three retirement slices. A/A wall medians are 0.845 / 0.840 ms (0.7% drift); every control retains 1,633 packs. Recorded one-minute host load spans 10.6–16.8. A quiet candidate probe takes 60.35 ms wall, 13.71 ms main CPU, and 8.60 MiB allocation median for 3,000 registry rows, with two Git metadata commands and no consolidation.
Rerunnable workload:
node --expose-gc --import ./scripts/tsx.mjs scripts/perf/worktree-pack-backlog-measure.ts --output <owned-fixture> --prepare, then the same command without--prepareand with a unique--report <sample>.json. SetOPENCLAW_BENCH_BASELINE_DIRto the qualified exact-parent checkout for A; unset it for B. Fixture creation, restoration, warmup, and object verification are outside measured ticks. A failed sparse-overlay setup was excluded; the qualified full parent checkout supplied all successful baseline samples. Production convergence after deployment remains unverified; no live runs or deployment were performed.Inherited dead-export gate regressions: exact-parent reproduction and introducing commits
The canonical failed checker exits 1 on the clean exact parent after 279.82 seconds. Both ordered finding lists match the candidate exactly: 57 production / 32 full-tree, scripts 0, with no dependency-resolution errors. These are main regressions requiring separate repairs. No ignore list or shared budget was raised to mask them.
tool-result-contract.ts:Incomplete,Issue,LeanDefinition,LeanRecordFields,page,Via;tool-results.ts:AGENT_HIT_LIMIT,AGENT_RECORD_MAX_CHARS, and 14lean*exports;tool-rows.ts:rowDate9b7dcdc7a66dc1bbcb0767b8109e798eb826954e, #196767, creates all three files and these exports. Their production consumers are local to each declaring module;AGENT_HIT_LIMITandleanRecordhave external test consumers. Public tool registration importsleanToolResults, which uses its local projection helpers. No subsequent owner change before the exact parent explains these findings.TelegramWidgetMessage,formatTelegramWidgetRequestTextb22f35f7ed76552778bc185cc65a6177e8ad8b02, #196991, creates both files and exports. The message type and formatting function are used inside their declaring owners; only the formatting function has an external test consumer.BoundKeys,nextBindingSeq,TunnelStagedMessage5f2f21a7ee193fdd4aa8ac42a407eefc04905255, #196388, createsrebind-operations.tswith the two exports and adds the exported IPC type. All direct uses remain within the declaring modules.planOpenClawModelsJsonSource,filterToolsByClientCaps; auth-storageAuthCredential,AuthStatus,AuthStorageBackend; model-registryResolvedRequestAuth; linux-oom-scoreresolveOomScoreWrappedCommand,spawnWithInheritedOomScore625945b7ae01d5eea91aba5285da1a327b2a5f9f, #192552, migrates production consumers to core/leaf owners while retaining facade exports. The source-causal audit was reused after verifying unchanged owners.nestRequiredSummaryHeadingsc7152f3bda8e52c24fc2fda83911e7e1c24fb0f2, #196207, moves the former external production consumer into the quality owner but leaves the export.MAX_MCP_TOOL_DIRECTORY_BYTES,sanitizeMcpToolDirectoryDescription80ba593b8b14bb3f5ddd6634a92805e04707b25c, #196252, introduces exports with local production use and external test consumers.projectLeaseDiagnosticFrames2c4e34a72f490c710bc155319fcabf872f482b3eadds the projection helper, used internally in production and externally by tests.createKeyFile37a3b162a0c58aaceb1634aaef726d0e178a529c, #196380, introduces an exported helper whose production calls remain withintunnel-child/keyfile.ts. Other old key helper findings now have consumers and are absent; they are not counted here.replyWithBillingRouteWarnings56617cd00086481212d29745ed71f5feb8a40b9e, #191326, introduces helper with same-owner production use and external test-only use.provider-runtime.tsexports andprovider-external-auth.ts: resolveExternalAuthProfilesWithPluginsf63e5cd0f6d38f1d0438978255d9e244183864c3, #190205, narrows the broad deferred provider-runtime namespace import to actual auth/catalog owner loaders, exposing stale facade exports. A source counterfactual restored only the old namespace loader and removed exactly these eleven findings, leaving other findings unchanged. Current owner blobs are identical; that historical cutover proof is reused, not repeated.ProviderAuthOptionBag,ProviderNonInteractiveApiKeyCredentialParams,ProviderNonInteractiveApiKeyResult,ProviderResolveNonInteractiveApiKeyParamscf1ae7bb6a729a7f13a28ca2ef9d6f108c00566f, #190544, moves consumers to the provider-auth-types owner while retaining broad barrel exports.