Skip to content

Commit d05faf8

Browse files
Galin IlievGalin Iliev
authored andcommitted
revert(autoreview): drop nested codex config changes
1 parent 917d503 commit d05faf8

2 files changed

Lines changed: 3 additions & 93 deletions

File tree

.agents/skills/autoreview/SKILL.md

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -121,32 +121,12 @@ The helper:
121121
- writes only to stdout unless `--output` or `AUTOREVIEW_OUTPUT` is set
122122
- supports `--dry-run`, `--parallel-tests`, and commit refs
123123
- runs nested review with `--dangerously-bypass-approvals-and-sandbox --sandbox danger-full-access` by default
124-
- uses Codex's normal shell environment filtering by default, including when `--codex-config` or `AUTOREVIEW_CODEX_CONFIG` is supplied; use `--shell-env-inherit all|default` or `AUTOREVIEW_SHELL_ENV_INHERIT=all|default` to force either policy
125-
- supports repeated `--codex-config KEY=VALUE` and newline-delimited `AUTOREVIEW_CODEX_CONFIG` / legacy `CODEX_REVIEW_CODEX_CONFIG` for local Codex provider overrides that were originally supplied as CLI `-c` flags; explicit `--codex-config` entries are passed after env entries so command-line overrides win
126124
- injects maintainer-only OpenClaw validation policy into native Codex review when `OPENCLAW_TESTBOX=1` or `AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION=1`, so local memory-heavy Node/Vitest checks are avoided in favor of Crabbox/Testbox proof
127125
- branch mode may fail on Codex CLI versions that reject `--base` plus the helper's stdin prompt; on that exact parser error, rerun plain `codex review --base <ref>` instead of falling back to a non-Codex reviewer
128126
- keeps accepting `--full-access`; use `--no-yolo` or `AUTOREVIEW_YOLO=0` to opt out
129127
- still accepts legacy `CODEX_REVIEW_*` env vars when the matching `AUTOREVIEW_*` var is unset
130128
- prints `autoreview clean: no accepted/actionable findings reported` when the selected review command exits 0
131129

132-
Local gateway/Copilot-style Codex launchers may need both exported env vars and
133-
the matching nested Codex config, because parent CLI `-c` flags are not process
134-
environment variables. Use explicit env inheritance only for trusted local
135-
launchers that require those exported variables:
136-
137-
```bash
138-
export OPENAI_API_KEY="sk-dummy-00000000000000000000000000000000000000000000"
139-
export AUTOREVIEW_SHELL_ENV_INHERIT=all
140-
export AUTOREVIEW_CODEX_CONFIG='openai_base_url="http://localhost:8080/v1"
141-
model_provider="copilot"
142-
model_providers.copilot.name="Copilot"
143-
model_providers.copilot.base_url="http://localhost:8080/v1"
144-
model_providers.copilot.env_key="OPENAI_API_KEY"
145-
model_providers.copilot.supports_websockets=false
146-
model="gpt-5.5"'
147-
.agents/skills/autoreview/scripts/autoreview
148-
```
149-
150130
## Final Report
151131

152132
Include:

.agents/skills/autoreview/scripts/autoreview

Lines changed: 3 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ Options:
2020
--opencode-bin PATH OpenCode binary. Default: opencode.
2121
--droid-bin PATH Droid binary. Default: droid.
2222
--copilot-bin PATH GitHub Copilot binary. Default: copilot.
23-
--codex-config KEY=VALUE Pass a Codex -c config override to nested codex review. Repeatable.
24-
--shell-env-inherit auto|all|default
25-
Environment inheritance policy for commands run by nested Codex. Default: auto.
2623
--full-access Keep yolo/full-access mode enabled. Default.
2724
--no-yolo Run nested Codex review with normal sandbox/approval prompts.
2825
--output FILE Also save output to file.
@@ -32,14 +29,6 @@ Options:
3229
-h, --help Show help.
3330
3431
Environment:
35-
Nested Codex review keeps Codex's default shell environment filtering unless
36-
AUTOREVIEW_SHELL_ENV_INHERIT=all or --shell-env-inherit all is set.
37-
AUTOREVIEW_SHELL_ENV_INHERIT
38-
Set to all or default to force the nested Codex shell env policy.
39-
CODEX_REVIEW_SHELL_ENV_INHERIT
40-
Legacy alias when AUTOREVIEW_SHELL_ENV_INHERIT is unset.
41-
AUTOREVIEW_CODEX_CONFIG Newline-delimited Codex -c config overrides.
42-
CODEX_REVIEW_CODEX_CONFIG Legacy alias when AUTOREVIEW_CODEX_CONFIG is unset.
4332
OPENCLAW_TESTBOX=1 or AUTOREVIEW_OPENCLAW_MAINTAINER_VALIDATION=1
4433
Enable maintainer-only OpenClaw Crabbox/Testbox validation policy.
4534
@@ -63,9 +52,6 @@ opencode_bin=${OPENCODE_BIN:-opencode}
6352
droid_bin=${DROID_BIN:-droid}
6453
copilot_bin=${COPILOT_BIN:-copilot}
6554
codex_args=()
66-
codex_config_overrides=()
67-
codex_cli_config_overrides=()
68-
shell_env_inherit=${AUTOREVIEW_SHELL_ENV_INHERIT:-${CODEX_REVIEW_SHELL_ENV_INHERIT:-auto}}
6955
yolo=${AUTOREVIEW_YOLO:-${CODEX_REVIEW_YOLO:-1}}
7056
output=${AUTOREVIEW_OUTPUT:-${CODEX_REVIEW_OUTPUT:-}}
7157
parallel_tests=
@@ -122,14 +108,6 @@ while [[ $# -gt 0 ]]; do
122108
copilot_bin=${2:-}
123109
shift 2
124110
;;
125-
--codex-config)
126-
codex_cli_config_overrides+=("${2:-}")
127-
shift 2
128-
;;
129-
--shell-env-inherit)
130-
shell_env_inherit=${2:-}
131-
shift 2
132-
;;
133111
--full-access)
134112
yolo=1
135113
shift
@@ -166,37 +144,6 @@ case "$yolo" in
166144
*) codex_args+=(--dangerously-bypass-approvals-and-sandbox --sandbox danger-full-access) ;;
167145
esac
168146

169-
codex_config_env=${AUTOREVIEW_CODEX_CONFIG:-${CODEX_REVIEW_CODEX_CONFIG:-}}
170-
if [[ -n "$codex_config_env" ]]; then
171-
while IFS= read -r codex_config_line; do
172-
[[ -n "$codex_config_line" ]] || continue
173-
codex_config_overrides+=("$codex_config_line")
174-
done <<< "$codex_config_env"
175-
fi
176-
177-
case "$shell_env_inherit" in
178-
auto)
179-
shell_env_inherit=default
180-
;;
181-
all|default) ;;
182-
*)
183-
echo "invalid --shell-env-inherit: $shell_env_inherit" >&2
184-
exit 2
185-
;;
186-
esac
187-
if [[ "$shell_env_inherit" == all ]]; then
188-
# Deliberate for local Codex launchers that rely on inherited provider,
189-
# proxy, or gateway variables; use default to restore Codex filtering.
190-
codex_args=(-c shell_environment_policy.inherit=all "${codex_args[@]}")
191-
fi
192-
193-
for codex_config_override in "${codex_config_overrides[@]}"; do
194-
codex_args+=(-c "$codex_config_override")
195-
done
196-
for codex_config_override in "${codex_cli_config_overrides[@]}"; do
197-
codex_args+=(-c "$codex_config_override")
198-
done
199-
200147
case "$mode" in
201148
auto|local|branch|commit) ;;
202149
*)
@@ -311,25 +258,6 @@ EOF
311258
fi
312259
fi
313260

314-
print_review_command() {
315-
local redact_next=false
316-
local arg
317-
318-
printf 'review:'
319-
for arg in "${review_cmd[@]}"; do
320-
if [[ "$redact_next" == true ]]; then
321-
printf ' %q' '<codex-config-redacted>'
322-
redact_next=false
323-
continue
324-
fi
325-
printf ' %q' "$arg"
326-
if [[ "$arg" == "-c" || "$arg" == "--config" ]]; then
327-
redact_next=true
328-
fi
329-
done
330-
printf '\n'
331-
}
332-
333261
printf 'autoreview target: %s\n' "$review_kind"
334262
printf 'branch: %s\n' "${current_branch:-detached}"
335263
if [[ -n "$pr_url" ]]; then
@@ -347,7 +275,9 @@ case "$reviewer" in
347275
;;
348276
esac
349277
if [[ "$reviewer" == auto || "$reviewer" == codex ]]; then
350-
print_review_command
278+
printf 'review:'
279+
printf ' %q' "${review_cmd[@]}"
280+
printf '\n'
351281
if [[ "$codex_review_stdin_prompt" == true || "$codex_review_prompt_file" == true ]]; then
352282
printf 'review policy: OpenClaw maintainer Crabbox/Testbox-aware validation prompt injected\n'
353283
fi

0 commit comments

Comments
 (0)