feat: add local-review command for offline branch review#253
feat: add local-review command for offline branch review#253anagnorisis2peripeteia wants to merge 1 commit into
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 4, 2026, 7:22 AM ET / 11:22 UTC. Summary Reproducibility: not applicable. as a bug reproduction; this is a feature PR. The PR body provides terminal proof for the new local-review happy path, and source inspection covers the patched launcher paths. Review metrics: 2 noteworthy metrics.
Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land the local-review command if maintainers accept the new CLI/env surface, preserving the Windows-safe launcher handling and stale-output cleanup with focused tests. Do we have a high-confidence way to reproduce the issue? Not applicable as a bug reproduction; this is a feature PR. The PR body provides terminal proof for the new local-review happy path, and source inspection covers the patched launcher paths. Is this the best way to solve the issue? Yes, pending maintainer acceptance of the feature surface. Reusing the existing review prompt/schema engine is the narrowest maintainable path for local branch review, with the remaining concern being merge-order and platform validation rather than a code defect. AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 74f63a090af7. Label changesLabel changes:
Label justifications:
Evidence reviewedWhat I checked:
Likely related people:
What the crustacean ranks mean
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
|
e29b2dc to
a3a121d
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
a3a121d to
75613c8
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Adds a 'local-review' CLI command that reviews the current branch diff against a base branch using Codex, without requiring a GitHub PR. Includes all prerequisites for local runs: - CODEX_BIN env var support (Windows .cmd wrapper compatibility) - shell: true on win32 for all Codex spawn sites - CLAWSWEEPER_CODEX_LOGIN_METHOD for ChatGPT Pro OAuth login - Applied to all 4 Codex subprocess launchers - Clears stale output before each review run Merge order: this PR subsumes openclaw#250 (Windows spawn) and openclaw#251 (OAuth login). If this lands first, close those as superseded. If either lands first, this PR needs a trivial rebase (identical changes).
|
@clawsweeper re-review |
75613c8 to
3569490
Compare
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Summary
Adds a
local-reviewcommand that reviews a local git branch without needing a GitHub PR. This enables pre-push code review: stage changes on a branch, runlocal-review, fix findings, then push and create the PR.Self-contained: includes all prerequisites for local runs (CODEX_BIN, shell: win32, CLAWSWEEPER_CODEX_LOGIN_METHOD) applied to all 4 Codex subprocess launchers.
How it works
The existing
reviewcommand fetches PR metadata from GitHub (fetchItem,collectItemContext) and runs Codex against the checkout.local-reviewconstructs the sameItemandItemContextfrom local git state:git remote, title from commit message, author fromgit configgit diff <base>...HEAD, changed files fromgit diff --name-only, commits fromgit log--pr-body-fileflag or commit message bodyrunCodex()call with the same prompt, schema, and decision outputNo GitHub API calls are made. The decision is written to
~/.clawsweeper-local-reviews/local-review.jsonand printed to stdout.Prerequisites included
This PR subsumes the changes from #250 (Windows spawn fix) and #251 (OAuth login method):
CODEX_BINenv var for Windows.cmdwrapper compatibilityshell: trueon win32 for all CodexspawnSynccallsCLAWSWEEPER_CODEX_LOGIN_METHODenv var for ChatGPT Pro OAuth login (centralized incodex-env.tswith validation)clawsweeper.ts(review + assist),commit-sweeper.ts,pr-close-coverage-proof.tsMerge order: if this lands first, close #250 and #251 as superseded. If either lands first, this PR needs a trivial rebase (identical changes on the same lines).
Usage
After-fix proof
Successfully reviewed the crabbox bootstrap-mount fix (openclaw/crabbox#204) locally before the GitHub PR existed:
Then self-reviewed this PR's own diff (meta!), which found and fixed a
--pr-body-filesilent-fallback bug.Changes
src/clawsweeper.ts: ~100 lines -localReviewCommand()function + command dispatch entrysrc/codex-env.ts:resolveCodexLoginMethod()+codexLoginMethodConfig()with validationsrc/commit-sweeper.ts: CODEX_BIN + shell + login methodsrc/pr-close-coverage-proof.ts: CODEX_BIN + shell + login method--target-dir,--repo,--base,--pr-body-file,--output-dir, plus all existing--codex-*flagsTest plan
pnpm buildcompiles cleanresolveCodexLoginMethodtests: default api, chatgpt override, invalid rejectioncodexLoginMethodConfigtest: valid TOML config stringrunCodexForTest