Skip to content

fix: trust source-backed triage and apply all safe close reasons - #1015

Merged
steipete merged 1 commit into
mainfrom
codex/clawsweeper-close-first-triage
Aug 2, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/clawsweeper-close-first-triage

Conversation

@steipete

@steipete steipete commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Trust source-backed Codex triage: default to closing external-product reports, unsupported support/configuration requests, incoherent issues or PRs, independently disproven claims, optional external extensions, duplicates, and stale low-value work when the existing repository policy and live safety guards permit it.
  • Preserve genuine official OpenClaw bugs, concrete owned-source or missing-extension-API failures, meaningful useful PRs, maintainer engagement, protected/security labels, repository-specific close restrictions, freshness checks, mutation leases, and all existing age/activity/proof gates.
  • Require friendly closed-report guidance that invites reopening with an official affected version, owned component, actionable reproduction, or focused useful patch.
  • Fix the actual reason issue [Bug]: [Bug] 长回合+多工具调用场景下最终回复偶发丢失,触发核心层兜底文案 openclaw#117838 would still not close: direct, queued, batched, and isolated post-review publication each hard-coded only implemented_on_main,duplicate_or_superseded,low_signal_unmergeable_pr, silently rejecting not_actionable_in_repo, incoherent, cannot_reproduce, and other otherwise valid decisions. Replace those divergent lists with the single configurable CLAWSWEEPER_AUTO_CLOSE_REASONS policy, defaulting to all; final repository profile, live guards, and opt-in policy gates remain authoritative.
  • Carry existing repository-configured product-direction, unsponsored-feature, stale-version-bug, obsolete-fix, revival-reaction, and author-budget threshold settings through publication. Keep author-budget closes exclusively in the existing globally capped single-process apply lane so parallel batch workers cannot reset its per-author cap; no automatic OpenClaw PR merge setting changes.

Real behavior proof

Using the real apply-decision entrypoint against the actual issue-117838 source tuple, durable matching review, active same-revision mutation lease, and real repository policy produced:

{"close_reason":"not_actionable_in_repo","action":"closed","reason":"dry-run: would close as not actionable in this repository"}
{"close_reason":"incoherent","action":"closed","reason":"dry-run: would close as too unclear to act on"}
{"close_reason":"cannot_reproduce","action":"closed","reason":"dry-run: would close as cannot reproduce on current main"}

An actual gpt-5.6-sol / xhigh replay of two real reports also distinguished an externally owned QClaw bug from a substantive maintainer-reopened official-release regression:

{"externalProduct":{"issue":117838,"decision":"CLOSE","closeReason":"not_actionable_in_repo","maintainerReviewRequired":false},"credibleUpstreamBug":{"issue":102534,"decision":"KEEP_OPEN","closeReason":"none","maintainerReviewRequired":true}}

Issue #102534 explicitly targets official OpenClaw v2026.6.5, and a maintainer already proved its prior closure incorrect; mentioning QClaw does not override that verified upstream defect or maintainer signal.

The earlier production operator recovery on the preceding merged service head completed successfully with:

{"action":"reconcile","dry_run":false,"inventory_complete":true,"queue_pressure":"idle","inspected_targets":16,"recovered_targets":10,"resolved_rows":22,"closed_rows":11,"duplicate_rows":1}

Safety and verification

  • Focused review-policy, sweep workflow, exact batch publication/preparation, protected-label, close-routing, author-budget, unsponsored-feature, stale-version, obsolete-fix, repository-profile, and stale-event suites: 343 passed, zero failed.
  • Independent fresh pre-commit review found no actionable defects after verifying all five corrected findings: 60-day stale floors; normalized security-bearing labels across proposal/apply/router; configured revival and author thresholds; author-budget isolation to the capped single-process lane; and shared-policy overrides in scheduled/manual proof and apply.
  • Any label whose normalized name contains security now blocks proposal, apply, and trusted close routing, including impact:security, clawsweeper:needs-security-review, and custom security labels.
  • Exact-head full pnpm run check, independent committed-head review, and fresh ClawSweeper durable review will complete before merge.
  • CLAWSWEEPER_ALLOW_AUTOMERGE=0, CLAWSWEEPER_ALLOW_MERGE=0, CLAWSWEEPER_FIX_PR_MODEL=gpt-5.6-sol, and CLAWSWEEPER_FIX_PR_REASONING_EFFORT=xhigh remain unchanged.

@steipete
steipete requested a review from a team as a code owner August 2, 2026 18:53
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. 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. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Aug 2, 2026
@clawsweeper

clawsweeper Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 2, 2026, 3:11 PM ET / 19:11 UTC.

ClawSweeper review

What this changes

This PR makes direct, queued, and exact-batch review publication use the shared automatic-close policy, forwards relevant close-policy settings, and blocks labels containing security across planning and trusted-close routing.

Merge readiness

⚠️ Ready for maintainer review - 4 items remain

Keep this PR open for maintainer review. The current head consistently replaces divergent publication allowlists with the shared close-reason policy, retains the downstream repository, freshness, protected-label, and reason-specific gates, and adds targeted regression coverage; I found no discrete patch defect. The operational choice is whether the broader default may reach immediate publication paths, so it needs explicit maintainer confirmation rather than automatic landing.

Priority: P2
Reviewed head: ec8c4932ce114b1de108e7837bab29b8b9059c29
Owner decision: Required. See Decision needed.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) The patch is focused, includes relevant real-path proof and regression coverage, and needs a maintainer decision only because it intentionally broadens automation policy scope.
Proof confidence 🐚 platinum hermit (4/6) Sufficient (terminal): The PR body shows after-fix output from the real apply-decision entrypoint for three newly reachable close reasons and contrasts that with a maintained official-release regression that remains open.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body shows after-fix output from the real apply-decision entrypoint for three newly reachable close reasons and contrasts that with a maintained official-release regression that remains open.
Evidence reviewed 6 items Current-head policy propagation: The event publisher now takes an explicit close-reason override first, then the shared CLAWSWEEPER_AUTO_CLOSE_REASONS value, rather than falling back to a fixed three-reason subset.
Workflow fallback uses shared policy: The apply workflow resolves an omitted manual close-reason input through CLAWSWEEPER_AUTO_CLOSE_REASONS, while the global environment defaults that policy to all.
Security-label guard is broadened consistently: Planning, apply protection, and trusted-close routing now reject any normalized label containing security, including labels such as impact:security.
Findings None None.
Security None None.

How this fits together

ClawSweeper turns Codex review decisions into durable records, then its apply lane rechecks live GitHub state and repository policy before syncing comments or closing an item. This PR changes the workflow and event-publication inputs that determine which proposed close reasons can reach that guarded apply lane.

flowchart LR
  A[Codex review decision] --> B[Workflow or event publisher]
  B --> C[Shared automatic-close policy]
  C --> D[Durable review record]
  D --> E[Apply lane live guards]
  E --> F[Comment sync or safe close]
Loading

Decision needed

Question Recommendation
Should immediate and exact-review publication use the shared automatic-close policy—including its configured all default—rather than remain limited to the previous three close reasons? Accept the shared policy rollout: Merge the change and rely on the existing repository-profile, freshness, protected-label, and reason-specific apply gates for each newly reachable close reason.

Why: The implementation is internally consistent, but this deliberately expands the set of high-confidence proposals that may enter the live apply lane; maintainers must choose that cleanup-policy boundary.

Before merge

  • Resolve merge risk (P1) - Merging changes immediate and exact-review publication from a fixed three-reason subset to the shared default policy; a configuration of all can therefore send more source-backed proposals to the apply lane.
  • Resolve merge risk (P1) - The patch relies on the existing repository-profile, live-state, protected-label, age, and reason-specific apply gates to reject unsafe closes; this is an intentional operational expansion rather than a purely internal refactor.
  • Complete next step (P2) - No mechanical repair is needed; a maintainer must explicitly accept or defer the broader automatic-close publication scope.
Agent review details

Security

None.

Review metrics

Metric Value Why it matters
Changed surface 11 files affected; 173 added, 32 removed The patch spans workflows, event publication, prompt policy, protection gates, and focused regression tests.
Publication paths 3 policy entry paths updated The direct event publisher, exact-batch preparation, and sweep workflow now converge on the shared close-reason policy.

Merge-risk options

Maintainer options:

  1. Confirm the broader rollout (recommended)
    Merge after a maintainer confirms that every reason enabled by the shared policy is intended to enter immediate and exact-review publication under the existing apply guards.
  2. Stage only the newly added reasons
    Keep the previous publication subset until the additional reason classes are deliberately enabled and observed in a controlled rollout.

Technical review

Best possible solution:

Keep one shared close-reason policy for every publication path, retain the existing live apply safeguards as the final authority, and merge only after a maintainer accepts the wider operational rollout.

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

Yes—source inspection identifies the former fixed close-reason subsets in direct and batch publication, and the PR body includes real apply-decision dry-run output for newly reachable reasons. I did not execute the mutation-capable apply command in this read-only review.

Is this the best way to solve the issue?

Yes for the implementation boundary: centralizing the publication policy eliminates divergent allowlists while retaining the guarded apply lane. Whether the broader default should be enabled operationally remains a maintainer policy decision.

AGENTS.md: found and applied where relevant.

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

Labels

Label justifications:

  • P2: The PR changes automated cleanup behavior with meaningful operational impact but retains multiple downstream safety gates.
  • merge-risk: 🚨 automation: Workflow and event-publication configuration determines which review close proposals reach ClawSweeper’s live apply machinery.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body shows after-fix output from the real apply-decision entrypoint for three newly reachable close reasons and contrasts that with a maintained official-release regression that remains open.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body shows after-fix output from the real apply-decision entrypoint for three newly reachable close reasons and contrasts that with a maintained official-release regression that remains open.

Evidence

What I checked:

  • Current-head policy propagation: The event publisher now takes an explicit close-reason override first, then the shared CLAWSWEEPER_AUTO_CLOSE_REASONS value, rather than falling back to a fixed three-reason subset. (src/repair/publish-event-result.ts:657, ec8c4932ce11)
  • Workflow fallback uses shared policy: The apply workflow resolves an omitted manual close-reason input through CLAWSWEEPER_AUTO_CLOSE_REASONS, while the global environment defaults that policy to all. (.github/workflows/sweep.yml:222, ec8c4932ce11)
  • Security-label guard is broadened consistently: Planning, apply protection, and trusted-close routing now reject any normalized label containing security, including labels such as impact:security. (src/clawsweeper-item-policy.ts:78, ec8c4932ce11)
  • Batch path intentionally excludes the author-budget enable switch: The added regression assertions require the concurrent shared workflow environments not to expose CLAWSWEEPER_AUTHOR_PR_BUDGET_CLOSE_ENABLED, preserving that globally capped close reason for its dedicated single-process apply lane. (test/review-close-policy.test.ts:192, ec8c4932ce11)
  • Feature-history provenance: The event publisher dates to the exact-review scheduler work in commit c5c8ddf0, while commit 0925ecae introduced bounded exact-review publication state; the current change follows those existing safety boundaries instead of creating a separate route. (src/repair/publish-event-result.ts:657, 0925ecae3787)
  • Repository direction: The checked-in VISION.md prioritizes auditable, policy-gated closing and destructive-action gates, which supports consolidating policy plumbing while preserving live apply checks. (VISION.md:13, 8a31b9f89386)

Likely related people:

  • Peter Steinberger: Authored the current PR and the recent workflow, policy, publisher, and apply-path history that the patch extends. (role: recent area contributor; confidence: high; commits: ec8c4932ce11, 8a31b9f89386, 4a39cfcf6a96; files: .github/workflows/sweep.yml, src/clawsweeper-item-policy.ts, src/repair/publish-event-result.ts)
  • Vincent Koc: Introduced the bounded exact-review publication-state work that this PR’s batch publication path builds upon. (role: adjacent exact-publication contributor; confidence: medium; commits: 0925ecae3787; files: src/repair/publish-event-result.ts, scripts/prepare-exact-review-batch.mjs)

Rank-up moves

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

  • Confirm the shared-policy rollout decision before merging.

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 (2 earlier review cycles)
  • reviewed 2026-08-02T18:58:16.898Z sha 4fec9ae :: needs maintainer review before merge. :: none
  • reviewed 2026-08-02T19:06:39.701Z sha d7e6636 :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/clawsweeper-close-first-triage branch from 4fec9ae to d7e6636 Compare August 2, 2026 19:03
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete force-pushed the codex/clawsweeper-close-first-triage branch from d7e6636 to ec8c493 Compare August 2, 2026 19:07
@steipete

steipete commented Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Aug 2, 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 repository_dispatch).
Result: when the review finishes, ClawSweeper will create the durable review comment if needed or update the existing comment in place.

Re-review progress:

@steipete
steipete merged commit de31c99 into main Aug 2, 2026
10 checks passed
@steipete
steipete deleted the codex/clawsweeper-close-first-triage branch August 2, 2026 19:15
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. P2 Normal priority bug or improvement with limited blast radius. proof: sufficient Contributor real behavior proof is sufficient. 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant