Repository navigation
fix: recover reviewed issue fixes without enabling merge - #982
Conversation
|
@clawsweeper review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
Codex review: needs maintainer review before merge. Reviewed July 31, 2026, 4:58 PM ET / 20:58 UTC. ClawSweeper reviewWhat this changesThe PR accepts all authoritative reviewed-issue triggers, recovers completed repair workers that produced no PR, prevents generated issue jobs from inheriting merge permission, and hydrates bounded Git blobs for restricted PR reviews. Merge readinessThis PR remains necessary: current Priority: P2 Review scores
Verification
How this fits togetherClawSweeper converts authoritative issue reviews into durable repair jobs and dispatches GitHub Actions workers that may create a repair PR but require separately authorized merging. Restricted PR reviews consume changed-file metadata and Git objects, so missing blobs in a partial clone can prevent the reviewer from inspecting the proposed patch. flowchart LR
A[Authoritative issue review] --> B[Durable repair job]
B --> C[Worker dispatch and recovery]
C --> D[Generated repair PR]
D --> E[Human-controlled merge]
F[Changed PR paths] --> G[Bounded blob hydration]
G --> H[Restricted Codex review]
Before merge
Agent review detailsSecurityNone. Review metrics
Merge-risk optionsMaintainer options:
Copy recommended automerge instructionTechnical reviewBest possible solution: Land the narrow repair only after focused current-head validation confirms authoritative reviewed triggers remain provenance-checked, completed workers retry within the bounded policy, and generated issue jobs can create repair PRs without ever enabling merge. Do we have a high-confidence way to reproduce the issue? Yes. Current main defines Is this the best way to solve the issue? Yes. Expanding acceptance only to the existing authoritative review-trigger constants while preserving repository, issue, source-revision, branch, and allowed-action checks is a narrower solution than weakening the general autonomous execution guard. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 16f01b295086. LabelsLabel justifications:
EvidenceWhat I checked:
Likely related people:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
History |
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
* fix: recover reviewed issue fixes without enabling merge * fix: hydrate restricted review blobs and recover deduplicated issue workers * fix: harden bounded review hydration and issue retry recovery --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
review_viable_issue; this unblocks strict reproducible OpenClaw bug fixes without weakening the existing branch, issue identity, source revision, action, or owner guards.CLAWSWEEPER_ALLOW_MERGE=0for generated issue jobs in both the planner and executor while preserving separately authorized maintainer automerge lanes.pnpm run local-reviewfeature and protect its package command with an explicit regression test.Production root cause and runtime proof
Real affected issue: openclaw/openclaw#98276
Failed autonomous worker: https://github.com/openclaw/clawsweeper/actions/runs/30654950729
The actual durable job was authenticated, bug-only, and explicitly blocked
closeandmerge, but carriedtrigger_source: review_reproducible_bug. The executor only recognizedreview_viable_issue, so it treated this reviewed issue job as untrusted and rejected its focused three-file fix because the planner described five affected behaviors:The live durable intake audit separately reported
worker_dispatched: trueindefinitely after completed workers produced no PR. The same audit also contained a stalejob_report_revision_sha256, so retrying the old job unchanged would replay an outdated review. The current-head runtime proof loads the real production job, its real downloaded planner artifact, the real production intake audit, and live worker history; it proves all of the following:{ "reviewTrigger": "review_reproducible_bug", "affectedSurfaces": 5, "previousDecision": "fix artifact is too broad for autonomous execution; split into narrower jobs or explicitly set CLAWSWEEPER_ALLOW_BROAD_FIX_ARTIFACTS=1", "currentDecision": "approved for bounded execution", "liveCompletedWorkerRecovered": true, "staleCompletedJobRefreshed": true, "workerRetryAttemptsMaximum": 3, "generatedIssueMergeAllowed": false, "issueExecutionModel": "gpt-5.6-sol", "issueExecutionReasoningEffort": "xhigh" }The old and new scope decisions are generated by the actual production-parent and changed
validateAutonomousFixScopefunctions against the exact same real job and planner artifact. Recovery queries the real current Actions workflow history. Merge proof checks the actual issue-job frontmatter plus the actual parsed planner and executor workflow expressions.Previously blocked self-review: real partial-clone proof
The previous review correctly reported that its restricted sandbox could not inspect current-head blobs: the exact-review checkout is a
--filter=blob:nonepartial clone, the reviewer fetched only the PR commit/tree, and Codex had no DNS to lazily fetch the changed objects. This PR fixes that root cause in a separate focused module: before the restricted review, it validates at most 80 Git paths, inspects only their base/head tree entries, discovers missing blob sizes in one read-only GitHub GraphQL metadata request, enforces a strict 4 MiB aggregate blob budget, and retrieves every permitted missing object in one Git fetch. It never checks out PR content, changes working-tree files, weakens the sandbox, forwards write credentials, downloads oversized contributor blobs, or runs for offline--local-rangereview.The real behavior regression creates a genuine local filtered/promisor clone, proves two PR blobs do not exist with
GIT_NO_LAZY_FETCH=1, fetches the PR head with--filter=blob:none, calls the actual current-head hydration helper, then changes the origin tohttps://invalid.invalid/offline.gitand provesgit show <head>:added.txt,git show <head>:changed.txt, andgit diff <base> <head> -- changed.txtall succeed completely offline. A Git trace proves 12 missing files cause exactly one fetch, not 12. Separate genuine promisor-clone tests prove 5 MiB objects and aggregate 3 MiB + 2 MiB objects are never downloaded while a neighboring small source file remains inspectable. The base working tree remains clean. Traversal, absolute,.git, backslash, control-character, gitlink, literal-pathspec, and >80-file cases are safely handled.{ "actualFilteredPromisorClone": true, "headObjectsMissingBeforeHydration": [true, true], "boundedObjectsHydrated": 6, "metadataRequestsForTwelveMissingFiles": 1, "networkFetchesForTwelveMissingFiles": 1, "maximumTotalBlobBytes": 4194304, "oversizedBlobDownloaded": false, "remoteAfterHydration": "https://invalid.invalid/offline.git", "headFileInspectionWithoutNetwork": "new implementation", "baseToHeadDiffWithoutNetwork": "+after", "workingTreeModified": false, "offlineLocalReviewStillAvailable": true }Deterministic token boundary and existing-worker recovery
CLAWSWEEPER_ISSUE_IMPLEMENTATION_WORKFLOW_TOKENis the existing central ClawSweeper dispatch installation token, withactions: writeforopenclaw/clawsweeper; it is not a target-repository mutation token and is not exposed to Codex or repair execution. It exists only in the deterministic issue-intake prepare step, where workflow-history discovery explicitly overrides its localGH_TOKENfor authenticated central Actions reads:The existing dispatch step already uses that installation token independently. When dispatch finds an active worker instead of launching a duplicate, it exports that worker's actual immutable
createdAtthrough the GitHub Actions step-output file; the separate deterministicmark-dispatchedstep records this exact original timestamp. Recovery then queriescreated>=<actual worker createdAt>, paginates all matching workflow runs, rejects active workers and historical completed workers, and tests completed deduplicated workers through the actual filtered history path. Invalid/blank legacy timestamps fall back to the durable preparation time. If the worker successfully opens an implementation PR, the unchanged issue is suppressed for 30 minutes rather than consuming capacity on every sweep; its live PR state is then rechecked so closing an unresolved PR allows the still-open issue to resume. A genuinely newer authoritative review can still safely reopen work immediately.An isolated end-to-end intake replay creates a durable issue job tied to an older review with three exhausted attempts and a retry deadline 30 minutes in the future, supplies one completed real-shape worker plus a fresh competing issue, and executes the actual
dist/repair/issue-implementation-intake.js prepareentrypoint against a deterministic GitHub API fixture. A stale runner snapshot is rejected before it can downgrade either dispatched or undispatched durable jobs; shared review/item timestamps are compared only when present on both records, so incomplete legacy audit metadata cannot misclassify older records. The genuinely newer authoritative review is selected first; an explicitly referenced open competing PR receives a delayed 30-minute recheck; closing that PR and advancing its retry timer regenerates the old completed job immediately, advances its durable review revision, and resets its attempt count to zero. Audit records retain authoritative review/item freshness for subsequent comparisons. Active queued/in-progress workers continue to block duplicate dispatch; same-review retry timers and attempt caps remain enforced.No dispatch token is added to the
repair-cluster-worker.ymlCodex process. Generated issue jobs forceCLAWSWEEPER_ALLOW_MERGE=0in both cluster and execute jobs, retaingpt-5.6-sol+xhigh, and require human merge. Existing separately authorized non-issue maintainer merge lanes are unchanged.Validation
pnpm run build:allpnpm run check:staticpnpm run lintnode --test test/review-blob-hydration.test.ts test/local-review.test.ts test/local-range-review.test.ts test/repair/issue-worker-recovery.test.ts test/repair/execute-fix-validation.test.ts test/repair/issue-implementation-intake.test.ts test/repair/cluster-workflow-security.test.ts test/repair/gitcrawl-store.test.ts test/repair/issue-implementation-dispatch.test.ts test/repair/post-flight.test.ts— 107 passed, 0 failed, including genuine filtered-clone integration, one-fetch Git traces, 4 MiB budget enforcement, terminal completed-PR deduplication, deterministic dispatch timestamps, actual CLI preparation of newer exhausted-worker reviews, and offline local review.pnpm run local-review; committed-range local review remains offline, rejects dirty checkouts, scrubs GitHub credentials, and disables web search.mainbefore landing.Generated OpenClaw issue PRs are create-only and require manual merge. This change does not disable or otherwise alter the separately authorized maintainer/service automerge lanes.