feat: support CLAWSWEEPER_CODEX_LOGIN_METHOD for local OAuth runs#251
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 3, 2026, 5:39 PM ET / 21:39 UTC. Summary Reproducibility: yes. for the source-level failure mode: current main hardcodes Review metrics: 3 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 focused helper if maintainers accept the opt-in local OAuth auth-provider surface, keeping Do we have a high-confidence way to reproduce the issue? Yes for the source-level failure mode: current main hardcodes Is this the best way to solve the issue? Yes, assuming maintainers want the new env surface: the patch is narrow, allowlists AGENTS.md: found and applied where relevant. Codex review notes: model gpt-5.5, reasoning high; reviewed against 74f63a090af7. Label changesLabel 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
|
Centralize forced_login_method override into a shared helper in codex-env.ts with validation (only 'api' and 'chatgpt' accepted, invalid values fall back to 'api'). Applied to all 4 Codex spawn sites: - clawsweeper.ts runCodex() - clawsweeper.ts runCodexAssist() - commit-sweeper.ts - pr-close-coverage-proof.ts Tests: default api, chatgpt override, invalid rejection, config string format.
22b13c5 to
dae6f09
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 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).
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).
Summary
CLAWSWEEPER_CODEX_LOGIN_METHODenv var to override the hardcodedforced_login_method="api"Codex config"api"for CI/production (no behavioral change)"chatgpt"for local runs with ChatGPT Pro OAuth subscriptionsMotivation
forced_login_method="api"requires an OpenAI platform API key, which is correct for CI where API keys are stored as repository secrets. However, local deployments with ChatGPT Pro subscriptions authenticate via OAuth (codex login), and the hardcoded"api"override causes Codex to log users out with "API key login is required, but ChatGPT is currently being used."Proof
Tested on Windows 11 with
CLAWSWEEPER_CODEX_LOGIN_METHOD=chatgpt:Full 7-minute Codex review completed using ChatGPT Pro OAuth. 119k char prompt consumed. Structured review output with actionable findings produced.
Without the env var (default "api"):
Files changed
src/clawsweeper.ts-- bothrunCodex()andrunCodexAssist(): readCLAWSWEEPER_CODEX_LOGIN_METHODenv varTest plan
chatgptlogin: full review completed with OAuth authapi): no behavioral change for CI/production