Skip to content

Add local-only issue and PR review mode - #357

Merged
joshavant merged 12 commits into
openclaw:mainfrom
brokemac79:codex/local-clawsweeper-review
Jun 24, 2026
Merged

joshavant merged 12 commits into
openclaw:mainfrom
brokemac79:codex/local-clawsweeper-review

Conversation

@brokemac79

@brokemac79 brokemac79 commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds a local ClawSweeper review workflow for users who want advisory output before submitting, updating, or re-reviewing an issue or pull request. This was based on a discussion with @joshavant on Discord.

Changes

  • Add pnpm run review -- --local-only for read-only local issue/PR review without the starter GitHub comment.
  • Add pnpm run codex:local:check to verify local Codex CLI auth and execution without printing secrets.
  • Preserve local Codex auth only for --local-only; hosted/normal workers still strip Codex/OpenAI/GitHub write credentials.
  • Prefer the Windows Codex app binary for local-only review and support Node-shebang Codex shims on Windows.
  • Keep README as the canonical local review guide with generic --target-repo owner/name examples.
  • Add docs/local-clawsweeper-skill.md for the optional Codex skill and remove the duplicated long-form local review guide.
  • Add .agents/skills/local-clawsweeper-review as an optional ergonomic Codex wrapper.

Validation

  • Final-head full repo check on 1c872e6453343ead2c1070516c3f4196dce40641:
pnpm run check

Passed: build, lint, unit tests, repair tests, changed coverage, full coverage, and format check.
  • Final-head Codex preflight on 1c872e6453343ead2c1070516c3f4196dce40641:
pnpm run codex:local:check

Codex binary: codex
Checking Codex login status...
Checking Codex login status completed in 0.1s.
Running Codex smoke test with gpt-5.5...
Running Codex smoke test with gpt-5.5 completed in 32.5s.
Codex local preflight passed.
  • Final-head local review proof on 1c872e6453343ead2c1070516c3f4196dce40641:
pnpm run review -- --local-only --target-repo openclaw/clawsweeper --item-number 357 --artifact-dir artifacts/local-review-357-docs-consolidation-proof

Local ClawSweeper review for openclaw/clawsweeper#357

Preparing target checkout
  mode: managed PR checkout
  path: artifacts/local-review-357-docs-consolidation-proof/target
  base: main

Loading review item
  item: PR #357
  title: [codex] Add local ClawSweeper review workflow
  state: open

Collecting GitHub context

Running Codex review
  timeout: 20m 0s
  stdout: artifacts/local-review-357-docs-consolidation-proof/codex/357.1.codex.stdout.log
  stderr: artifacts/local-review-357-docs-consolidation-proof/codex/357.1.codex.stderr.log

Review complete
  elapsed: 4m 12s
  decision: keep_open
  confidence: high
  action: kept_open
  report: artifacts/local-review-357-docs-consolidation-proof/357.md

Local review artifact summary:

  • review_status=complete
  • decision=keep_open
  • confidence=high
  • action_taken=kept_open
  • review_service_tier=fast
  • local_checkout_access=verified
  • main_sha=bd03fe34c0a49e17735186bc15e6e8656d03e2e2
  • pull_head_sha=1c872e6453343ead2c1070516c3f4196dce40641
  • Managed target checkout remained clean after the run: ## clawsweeper/pr-357

No GitHub apply/close command was run; this was local-only advisory review proof.

@clawsweeper

clawsweeper Bot commented Jun 23, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed June 23, 2026, 9:31 PM ET / 01:31 UTC.

Summary
The PR adds an advisory review -- --local-only workflow, a local Codex preflight script, scoped local Codex auth preservation, managed exact PR checkouts, Windows Codex launcher handling, README/skill docs, CI coverage, and tests.

Reproducibility: not applicable. as a bug reproduction: this PR adds a new local maintainer workflow rather than fixing a broken existing contract. The observable verification is the terminal proof for pnpm run check, pnpm run codex:local:check, and pnpm run review -- --local-only.

Review metrics: 3 noteworthy metrics.

  • Changed surface: 14 files, +1385/-82. The PR spans runtime review code, credential handling, Windows process resolution, docs, tests, a script, a skill, and CI.
  • Command surface: 1 new script, 1 new CLI mode. codex:local:check and review -- --local-only become maintainer-facing workflows with support and auth-boundary implications.
  • Behavior proof: 3 terminal transcripts. The PR body shows the full check, local Codex preflight, and local-only review path running successfully on the final head.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🦞 diamond lobster
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

  • none.

Risk before merge

  • [P1] Maintainers need to explicitly accept a new supported local exact issue/PR review mode with item-specific artifacts and managed PR checkouts.
  • [P1] --local-only intentionally preserves local Codex/OpenAI auth for the Codex subprocess; that is scoped to local-only, but it changes the credential boundary for local operator runs.
  • [P1] The diff changes review execution, starter-comment skipping, Windows launcher resolution, and CI launcher coverage; workstation variation still needs maintainer acceptance despite green checks.

Maintainer options:

  1. Accept the local workflow contract (recommended)
    Maintainers can merge once they accept local exact-review support, managed checkout behavior, optional skill/docs, and the scoped local Codex auth boundary.
  2. Narrow the first supported surface
    If maintainers want a smaller first operator tool, trim or defer the bundled skill, managed checkout default, Windows app-binary preference, or scoped auth preservation before merge.
  3. Pause workflow expansion
    If local advisory issue/PR reviews should not become supported yet, pause or close this PR and keep the idea in maintainer planning.

Next step before merge

  • [P2] Human maintainer review is the next action because the remaining blockers are product, support, and auth-boundary decisions rather than a narrow automated repair.

Security
Cleared: No concrete security or supply-chain regression was found; the scoped local auth preservation is a maintainer merge-risk decision rather than an observed secret exposure bug.

Review details

Best possible solution:

Land after maintainers explicitly accept the local review workflow and credential boundary, or narrow the supported local surface before merge.

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

Not applicable as a bug reproduction: this PR adds a new local maintainer workflow rather than fixing a broken existing contract. The observable verification is the terminal proof for pnpm run check, pnpm run codex:local:check, and pnpm run review -- --local-only.

Is this the best way to solve the issue?

Yes at the implementation level: extending the existing review command is narrower than creating a separate issue/PR review engine. The remaining question is maintainer acceptance of the support, auth, checkout, and automation boundary.

AGENTS.md: found and applied where relevant.

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

Label changes

Label justifications:

  • P2: This is a normal-priority workflow improvement with limited blast radius but meaningful automation and auth-provider surface.
  • merge-risk: 🚨 compatibility: The PR adds a supported local review mode, managed checkout behavior, artifact defaults, and repo-local skill that change maintainer setup expectations.
  • merge-risk: 🚨 auth-provider: The diff changes which Codex/OpenAI auth variables are preserved for local-only review subprocesses.
  • merge-risk: 🚨 automation: The diff changes review command execution, starter-comment skipping, local preflight, local artifacts, Windows Codex launcher behavior, and CI launcher coverage.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): Sufficient terminal proof: the PR body includes final-head output for the full check, Codex local preflight, and local-only review run.
  • proof: sufficient: Contributor real behavior proof is sufficient. Sufficient terminal proof: the PR body includes final-head output for the full check, Codex local preflight, and local-only review run.
Evidence reviewed

What I checked:

  • Repository policy read: AGENTS.md was read fully and applied because this PR changes ClawSweeper automation, workflow behavior, generated artifacts, and auth handling. (AGENTS.md:1, bd03fe34c0a4)
  • Current main lacks the requested issue/PR local workflow: Current main only has the separate Commit Sweeper offline local-review path; searches found no --local-only, codex:local:check, preserveCodexAuth, Windows Codex app preference, or repo-local local-review skill surface. (package.json:24, bd03fe34c0a4)
  • Local-only review implementation: PR head wires --local-only into the review command, skips the starter comment, defaults local service tier to fast, and passes local auth and Windows launcher preferences into Codex review execution. (src/clawsweeper.ts:16007, 1c872e645334)
  • Managed checkout implementation: PR head creates artifacts/local-review-<number>/target, fetches the pull-request ref, and checks it out on an item-specific local branch for exact local PR review when no target dir is supplied. (src/clawsweeper.ts:6528, 1c872e645334)
  • Credential boundary: PR head preserves OPENAI_API_KEY, CODEX_API_KEY, and CODEX_ACCESS_TOKEN only when preserveCodexAuth is set; GitHub/App credentials remain stripped. (src/codex-env.ts:67, 1c872e645334)
  • Preflight and proof: The PR body includes final-head terminal output for pnpm run check, pnpm run codex:local:check, and a local-only review run against this PR; GitHub checks for CI, Windows launcher coverage, CodeQL, and Socket are green on the same head. (1c872e645334)

Likely related people:

  • steipete: Current-main blame ties the review runner, Codex env, and Codex spawn baseline to the v0.3.0 release commit authored by Peter Steinberger. (role: current review-runner baseline owner; confidence: high; commits: dc824915bb6c; files: src/clawsweeper.ts, src/codex-env.ts, src/codex-spawn.ts)
  • vincentkoc: Recent current-main commits changed exact-review capacity and queue behavior adjacent to the new local exact-item review workflow. (role: recent exact-review automation contributor; confidence: medium; commits: bd03fe34c0a4, 59f4d6981e65, 54eedf80d79f; files: src/clawsweeper.ts, .github/workflows/sweep.yml, .github/workflows/ci.yml)
  • Dallin Romney: Recent current-main commits changed review placeholder and advisory label comment behavior near the starter-comment path this PR skips in local-only mode. (role: recent review-comment automation contributor; confidence: medium; commits: b75626e4df03, 4e5c4d47c83f; files: src/clawsweeper.ts, test/clawsweeper.test.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@brokemac79
brokemac79 marked this pull request as ready for review June 23, 2026 21:30
@brokemac79
brokemac79 requested a review from a team as a code owner June 23, 2026 21:30
@clawsweeper clawsweeper Bot added proof: sufficient Contributor real behavior proof is sufficient. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P2 Normal priority bug or improvement with limited blast radius. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. labels Jun 23, 2026
@clawsweeper clawsweeper Bot added 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 rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 23, 2026
@joshavant

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 24, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed proof: sufficient Contributor real behavior proof is sufficient. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. labels Jun 24, 2026
@clawsweeper clawsweeper Bot added status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Jun 24, 2026
@joshavant

Copy link
Copy Markdown
Contributor

@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. and removed rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 24, 2026
@joshavant

Copy link
Copy Markdown
Contributor

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Jun 24, 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: the existing ClawSweeper review comment will be edited in place when the review finishes.

@joshavant joshavant changed the title [codex] Add local ClawSweeper review workflow Add local-only issue and PR review mode Jun 24, 2026
@joshavant
joshavant merged commit 79e7688 into openclaw:main Jun 24, 2026
10 checks passed
anagnorisis2peripeteia added a commit to anagnorisis2peripeteia/clawsweeper that referenced this pull request Jun 25, 2026
Addresses review feedback that the offline --local-range full review paralleled
the hardened local-review path (openclaw#298) instead of reusing it. Now --local-range:
- enforces openclaw#298's clean-checkout contract (dirtyWorktree guard — rejects a dirty
  tree; the committed-range review can't see staged/untracked work);
- scrubs every GitHub credential from the engine (scrubGitHubCredentialEnv) and
  disables web search (LOCAL_REVIEW_WEB_SEARCH_CONFIG) — the same offline guarantee;
- reuses commitMetadata(offline=true) for author/subject/dates instead of its own
  git calls.
dirtyWorktree + scrubGitHubCredentialEnv are extracted from commit-sweeper.ts's
localReviewCommand (behavior unchanged there) and shared. This is the openclaw#357 full
proof-aware review made offline — distinct from openclaw#298's commit-sweeper code-only
lane, but built on its offline plumbing.
anagnorisis2peripeteia added a commit to anagnorisis2peripeteia/clawsweeper that referenced this pull request Jun 28, 2026
Addresses review feedback that the offline --local-range full review paralleled
the hardened local-review path (openclaw#298) instead of reusing it. Now --local-range:
- enforces openclaw#298's clean-checkout contract (dirtyWorktree guard — rejects a dirty
  tree; the committed-range review can't see staged/untracked work);
- scrubs every GitHub credential from the engine (scrubGitHubCredentialEnv) and
  disables web search (LOCAL_REVIEW_WEB_SEARCH_CONFIG) — the same offline guarantee;
- reuses commitMetadata(offline=true) for author/subject/dates instead of its own
  git calls.
dirtyWorktree + scrubGitHubCredentialEnv are extracted from commit-sweeper.ts's
localReviewCommand (behavior unchanged there) and shared. This is the openclaw#357 full
proof-aware review made offline — distinct from openclaw#298's commit-sweeper code-only
lane, but built on its offline plumbing.
anagnorisis2peripeteia added a commit to anagnorisis2peripeteia/clawsweeper that referenced this pull request Jun 28, 2026
Synthesize the Item + ItemContext from the local git range
(merge-base(--base, HEAD)..HEAD) so the full review — real-behavior proof and
mantis decision — runs BEFORE a PR exists and WITHOUT a GitHub fetch. Diff from
`git diff`, body from the commit message (or --body-file). This is the offline
advisory review openclaw#357 describes but gates behind an open PR; it also works on fork
checkouts that the gh-fetch gitInfo path rejects.
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
* Add local ClawSweeper review workflow

* fix: preserve Codex login fallback

* fix: redact local Codex access tokens

* fix: harden local Codex review across platforms

* fix: show local Codex preflight progress

* fix: explain missing local review checkout

* fix: suppress stacks for local setup errors

* feat: manage local review PR checkouts

* fix: improve local review exact-item output

* fix: improve local review failure output

* docs: consolidate local review command

* docs: consolidate local review guidance

---------

Co-authored-by: joshavant <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-risk: 🚨 auth-provider 🚨 Merging this PR could break OAuth, tokens, provider routing, model choice, or credentials. merge-risk: 🚨 automation 🚨 Merging this PR could break CI, automerge, proof capture, label sync, or automation. merge-risk: 🚨 compatibility 🚨 Merging this PR could break existing users, config, migrations, defaults, or upgrades. 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.

2 participants