Skip to content

perf(ci): reuse matching checkout for harness actions - #133994

Closed
steipete wants to merge 3 commits into
mainfrom
codex/ci-checkout-reuse-20260831
Closed

steipete wants to merge 3 commits into
mainfrom
codex/ci-checkout-reuse-20260831

Conversation

@steipete

@steipete steipete commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Linux and platform CI fetched the workflow revision again even when it exactly matched the candidate revision already checked out. Main run 33361712534 spent about 30 seconds on that duplicate harness transport. Repeating it across every job adds checkout latency and network load.

Why This Change Was Made

Immediately after the owned candidate checkout, exact revision equality now lets the Git owner copy only tracked .github/actions files from the fresh index into an independent harness directory using checkout-index --prefix. It does not copy from later workspace contents or update the candidate index. Different workflow/candidate revisions keep their existing sparse, blobless fetch. Action-existence, cancellation, process-tree cleanup, deadline, and retry ownership remain unchanged.

The regression reuses the existing real-Git fixture transport and process-tree cleanup owner. It does not introduce another Git supervisor or cleanup path.

User Impact

Faster CI checkout with the same pinned candidate and harness contents. No product runtime behavior, configuration, dependencies, permissions, runner counts, or concurrency changes.

Evidence

A real-Git regression failed on the original workflow because it performed two fetches and passes with one after generation from the canonical owner. It checks exact action bytes, unchanged raw index/HEAD, independent copies after later candidate edits, export attributes, filenames with spaces, and POSIX executable/symlink/newline behavior. Windows executes the same ordinary file/index contract without requiring symlink privilege. Existing different-revision, timeout, cancellation and performance-workflow lifecycle cases remain covered.

The final real-Git regression passes fresh Linux, fresh platform and retained-platform cases, preserving index and action bytes with a single fetch. Three different-revision, cancellation and deadline sibling cases also pass. The local focused recovery run passed both Linux recovery cases. The existing cancellation-during-timeout-drain case passes with the source-loader repair already present on current main. The broader lifecycle selection passed 28 cases with one 55-second recovery timeout during a heavily delayed local run; that same recovery and its sibling passed the focused rerun without changing their deadlines. Native Windows and complete Linux proof are required from exact-head CI before landing.

The complete changed-file gate passed, including root-test types, formatting and scripts lint. The generated owner check passed. Independent Codex autoreview found no blocking findings; the final fixture-only gate is recorded before publication.

Direct dependency proof: Git checkout-index documentation and Git2.55 source establish that an output prefix prevents index refresh/write. The scoped TypeScript importer was checked in installed tsx types/source and exercised against the exact failing source closure. No new loader implementation or shutdown policy is introduced.

Runtime production delta0; CI owner net+6 lines for the separate exact-revision copy contract; generated workflow projection net+6; test/support net+141; docs net0. Historical different-revision fetch behavior is preserved. No additional runner registrations. Hosted timing will be added when the PR run completes; this change alone does not claim a five-minute workflow.

The retained-platform case addresses the latest ClawSweeper finding and rank-up requests: checkout-index --force replaces an existing destination action. The pre-fix real reproduction exits 1; stale action execution was not reproduced. The canonical owner and generated workflow agree, and the corrected three-case proof passes again after rebase. The initial exact-head CI passed Linux and macOS but an existing Windows provider-import test timed out; this branch now includes the upstream provider preparation repair from #133970. The final changed-file gate and independent scoped Codex review pass; fresh exact-head CI remains required.

The next hosted run exposed an unrelated incomplete provider fixture: the global-session sandbox test supplied a provider handle without its attempt model ID, forcing real plugin discovery before its assertion. The existing helper in that file and the production producer both carry the model ID. This PR completes that one fixture field. The hosted case failed at 132.9 seconds against its unchanged 120-second timeout; an isolated local A/B preserves all 12 cases and assertions while reducing wrapper wall from 70.300 to 3.674 seconds. Profiling removes the 61-second plugin-loading path. Both nearest prompt/sandbox suites pass (23 additional cases); the integrated 12-case proof and complete changed-file gate also pass. No production code, mocks, skips or deadlines change.

Run 33388473243 also lost its hosted lint runner to a shutdown signal and hit the existing prepared Anthropic timeout on Windows. The Windows timeout occurs unchanged on both the baseline and Windows optimization PR; that separate cold-registration owner is being investigated. Fresh exact-head CI remains required.

@clawsweeper

clawsweeper Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M maintainer Maintainer-authored PR labels Aug 31, 2026
@clawsweeper clawsweeper Bot added merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 31, 2026
@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 31, 2026, 8:37 AM ET / 12:37 UTC.

ClawSweeper review

What this changes

The PR exports tracked GitHub Action files from the already checked-out candidate index when it matches the workflow revision, avoiding a duplicate harness fetch while retaining the existing sparse-fetch path for different revisions.

Merge readiness

⚠️ Ready for maintainer review - 2 items remain

No blocking defect was found in the introduced checkout path. Keep this member-owned, protected PR open for normal maintainer handling while its exact-head hosted CI completes.

Priority: P2
Reviewed head: f41f0be68139ebadb14dd2e7dccfd220ea96e41a

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is a focused, well-covered CI-owner change with no identified correctness finding; exact-head hosted confirmation remains the relevant merge gate.
Proof confidence 🌊 off-meta tidepool Not applicable: Not applicable to the member-authored proof gate; the supplied real-Git fixture nonetheless directly exercises the changed generated checkout closure and records the after-fix single-fetch result.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: Not applicable to the member-authored proof gate; the supplied real-Git fixture nonetheless directly exercises the changed generated checkout closure and records the after-fix single-fetch result.
Evidence reviewed 7 items Current-main behavior: Current main still always initializes and sparse-fetches the harness, so it does not already contain this performance change.
Introduced owner path: The matching-revision branch reads only tracked action paths from the freshly checked-out index, exports them with force overwrite, and leaves the differing-revision sparse fetch unchanged.
Workflow consumer: Both checkout anchors pass the candidate and workflow revisions, then consume actions from the independent harness directory.
Findings None None.
Security None None.

How this fits together

The CI checkout owner fetches a pinned candidate revision and prepares an independent action harness that later workflow steps execute. The change affects the matching-revision branch of that preparation, before Linux and platform jobs set up Node and pnpm.

flowchart LR
  A[CI revision inputs] --> B[Git checkout owner]
  B --> C[Candidate checkout]
  C --> D{Revisions match}
  D -->|Yes| E[Export tracked action files]
  D -->|No| F[Sparse harness fetch]
  E --> G[Independent action harness]
  F --> G
  G --> H[CI setup actions]
Loading

Before merge

  • Resolve merge risk (P1) - The patch changes the generated CI checkout path, but the exact-head hosted Linux and native Windows checks are still queued; the real-Git fixture cannot establish runner-specific behavior before those results arrive.
  • Complete next step (P2) - No discrete repair is outstanding; this protected member PR needs its normal exact-head CI and maintainer review rather than an automated fix lane.
Agent review details

Security

None.

PR surface

Tests +141, Docs 0, Config +12. Total +153 across 6 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 3 155 14 +141
Docs 1 1 1 0
Config 2 38 26 +12
Generated 0 0 0 0
Other 0 0 0 0
Total 6 194 41 +153

Review metrics

Metric Value Why it matters
Production versus test delta CI owner +6; generated workflow projection +6; tests +132; test support +9; docs 0 The small production addition creates the matching-revision branch, while most growth is real-Git boundary coverage and its fixture support.

Merge-risk options

Maintainer options:

  1. Verify exact-head checkout automation (recommended)
    Let the queued exact-head Linux and Windows workflow checks complete successfully before merging the generated checkout-path change.

Technical review

Best possible solution:

Retain the canonical checkout owner and merge after exact-head hosted CI confirms the generated Linux and platform harness paths.

Do we have a high-confidence way to reproduce the issue?

Yes: current main's unconditional second harness fetch is visible in the owner, and the introduced real-Git fixture exercises the rendered Linux and platform workflow closures against the same-revision condition.

Is this the best way to solve the issue?

Yes: using the freshly checked-out index preserves the existing owner boundary and avoids a second transport only when the two pinned revisions are equal; the different-revision path remains intact.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a7be8e5ec6ff.

Labels

Label changes:

  • add merge-risk: 🚨 automation: The introduced branch changes how GitHub Actions materializes its trusted harness, and runner-specific confirmation is still pending.

Label justifications:

  • P2: This is a bounded CI performance and reliability improvement rather than a product-runtime outage.
  • merge-risk: 🚨 automation: The introduced branch changes how GitHub Actions materializes its trusted harness, and runner-specific confirmation is still pending.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: Not applicable to the member-authored proof gate; the supplied real-Git fixture nonetheless directly exercises the changed generated checkout closure and records the after-fix single-fetch result.

Evidence

What I checked:

  • Current-main behavior: Current main still always initializes and sparse-fetches the harness, so it does not already contain this performance change. (.github/actions/git-owner/owner.py:378, a7be8e5ec6ff)
  • Introduced owner path: The matching-revision branch reads only tracked action paths from the freshly checked-out index, exports them with force overwrite, and leaves the differing-revision sparse fetch unchanged. (.github/actions/git-owner/owner.py:378, f41f0be68139)
  • Workflow consumer: Both checkout anchors pass the candidate and workflow revisions, then consume actions from the independent harness directory. (.github/workflows/ci.yml:1702, f41f0be68139)
  • Boundary regression coverage: The real-Git fixture executes the rendered checkout step and verifies one fetch, unchanged candidate index and HEAD, exact action bytes, retained-file replacement, modes, symlink preservation, and isolation from later workspace edits. (test/scripts/ci-platform-checkout.test.ts:224, f41f0be68139)
  • Git command contract: Installed Git documentation confirms that --prefix prepends an output path, --force overwrites existing output, and index stat updates require the separate --index option not used by this branch.
  • Relevant history: Merged commit 1737e5c established the preceding sparse/blobless harness design; the current CI-owner history makes steipete the strongest routing candidate. (.github/actions/git-owner/owner.py:376, 1737e5c44197)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rank-up moves

Optional improvements that raise the rating; they are not merge blockers.

  • Allow the queued exact-head Linux and native Windows checks to complete before merge.

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

History

Review history (4 earlier review cycles)
  • reviewed 2026-08-31T09:13:18.589Z sha 1a9c9a53b2a6b766e998ce6cf0014309fa7d5542 :: found issues before merge. :: [P1] Force overwrite of the same-revision harness export
  • reviewed 2026-08-31T09:39:45.709Z sha 0cedf84f9cfb58cceac063e2906662464e476577 :: found issues before merge. :: [P1] Force the same-revision harness export to overwrite
  • reviewed 2026-08-31T11:53:33.848Z sha c8ff4db :: needs maintainer review before merge. :: none
  • reviewed 2026-08-31T12:27:58.307Z sha f41f0be :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/ci-checkout-reuse-20260831 branch from 1a9c9a5 to 0cedf84 Compare August 31, 2026 09:31
@steipete
steipete marked this pull request as ready for review August 31, 2026 09:35
@steipete
steipete force-pushed the codex/ci-checkout-reuse-20260831 branch from 0cedf84 to c8ff4db Compare August 31, 2026 11:45
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed P1 High-priority user-facing bug, regression, or broken workflow. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

The retained-harness overwrite finding is fixed and the real-Git regression covers it. Since the last review, CI exposed a separate incomplete prepared-provider test fixture. f41f0be adds the missing model ID; all 12 original cases plus 23 prompt/sandbox siblings pass, and profiling removes the unintended cold plugin load. Assertions, mocks and deadlines are unchanged. The complete changed-file gate and scoped review pass; fresh exact-head CI is running.

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 31, 2026 •

Copy link
Copy Markdown
Contributor

🦞🧹
ClawSweeper re-review requested.

I asked ClawSweeper to review this item again.
Action: item re-review queued (workflow sweep.yml, event exact_review_queue).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@clawsweeper clawsweeper Bot added the merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. label Aug 31, 2026
@steipete

Copy link
Copy Markdown
Contributor Author

Implemented through #134038, merged as 4ee565c6d2a, including authenticated same-revision checkout and harness reuse. The integration preserves the connected main changes and removes the superseded duplicate paths.

Exact-head CI33434384581 completed successfully with all applicable Testboxes green. Both Windows jobs, all 16 UI jobs and the macOS Node job passed. The integration PR records the focused source-owner and regression proof, including the Windows readiness repair and trusted-wrapper merge checks. This source PR is superseded by that verified landing.

@steipete steipete closed this Aug 31, 2026
@RomneyDa
RomneyDa deleted the codex/ci-checkout-reuse-20260831 branch October 22, 2026 00:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation maintainer Maintainer-authored PR merge-risk: 🚨 automation 🚨 May affect CI, automerge, proof capture, label sync, or maintainer automation. P2 Normal backlog priority with limited blast radius. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: M status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant