mirror of https://github.com/garrytan/gstack.git
Merge PR #1270: codex exec resume drops -C/-s flags, uses sandbox_mode config
# Conflicts: # codex/SKILL.md # codex/SKILL.md.tmpl
This commit is contained in:
commit
9cffb1575d
|
|
@ -1235,7 +1235,7 @@ If no project-scoped match, fall back to `ls -t "$PLAN_ROOT"/*.md 2>/dev/null |
|
||||||
but warn: "Note: this plan may be from a different project — verify before sending to Codex."
|
but warn: "Note: this plan may be from a different project — verify before sending to Codex."
|
||||||
|
|
||||||
**IMPORTANT — embed content, don't reference path:** Codex runs sandboxed to the repo
|
**IMPORTANT — embed content, don't reference path:** Codex runs sandboxed to the repo
|
||||||
root (`-C`) and cannot access `~/.claude/plans/` or any files outside the repo. You MUST
|
root and cannot access `~/.claude/plans/` or any files outside the repo. You MUST
|
||||||
read the plan file yourself and embed its FULL CONTENT in the prompt below. Do NOT tell
|
read the plan file yourself and embed its FULL CONTENT in the prompt below. Do NOT tell
|
||||||
Codex the file path or ask it to read the plan file — it will waste 10+ tool calls
|
Codex the file path or ask it to read the plan file — it will waste 10+ tool calls
|
||||||
searching and fail.
|
searching and fail.
|
||||||
|
|
@ -1324,8 +1324,9 @@ if [ -z "$PYTHON_CMD" ]; then
|
||||||
echo "ERROR: Python 3 is required to parse Codex JSON output. Install python3 or python and retry." >&2
|
echo "ERROR: Python 3 is required to parse Codex JSON output. Install python3 or python and retry." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cd "$_REPO_ROOT" || exit 1
|
||||||
# Fix 1: wrap with timeout (gtimeout/timeout fallback chain via probe helper)
|
# Fix 1: wrap with timeout (gtimeout/timeout fallback chain via probe helper)
|
||||||
_gstack_codex_timeout_wrapper 600 codex exec resume <session-id> "<prompt>" -C "$_REPO_ROOT" -s read-only -c 'model_reasoning_effort="medium"' --enable web_search_cached --json < /dev/null 2>"$TMPERR" | PYTHONUNBUFFERED=1 "$PYTHON_CMD" -u -c "
|
_gstack_codex_timeout_wrapper 600 codex exec resume <session-id> "<prompt>" -c 'sandbox_mode="read-only"' -c 'model_reasoning_effort="medium"' --enable web_search_cached --json < /dev/null 2>"$TMPERR" | PYTHONUNBUFFERED=1 "$PYTHON_CMD" -u -c "
|
||||||
<same python streaming parser as above, with flush=True on all print() calls>
|
<same python streaming parser as above, with flush=True on all print() calls>
|
||||||
"
|
"
|
||||||
# Fix 1: same hang detection pattern as new-session block
|
# Fix 1: same hang detection pattern as new-session block
|
||||||
|
|
|
||||||
|
|
@ -398,7 +398,7 @@ If no project-scoped match, fall back to `ls -t "$PLAN_ROOT"/*.md 2>/dev/null |
|
||||||
but warn: "Note: this plan may be from a different project — verify before sending to Codex."
|
but warn: "Note: this plan may be from a different project — verify before sending to Codex."
|
||||||
|
|
||||||
**IMPORTANT — embed content, don't reference path:** Codex runs sandboxed to the repo
|
**IMPORTANT — embed content, don't reference path:** Codex runs sandboxed to the repo
|
||||||
root (`-C`) and cannot access `~/.claude/plans/` or any files outside the repo. You MUST
|
root and cannot access `~/.claude/plans/` or any files outside the repo. You MUST
|
||||||
read the plan file yourself and embed its FULL CONTENT in the prompt below. Do NOT tell
|
read the plan file yourself and embed its FULL CONTENT in the prompt below. Do NOT tell
|
||||||
Codex the file path or ask it to read the plan file — it will waste 10+ tool calls
|
Codex the file path or ask it to read the plan file — it will waste 10+ tool calls
|
||||||
searching and fail.
|
searching and fail.
|
||||||
|
|
@ -487,8 +487,9 @@ if [ -z "$PYTHON_CMD" ]; then
|
||||||
echo "ERROR: Python 3 is required to parse Codex JSON output. Install python3 or python and retry." >&2
|
echo "ERROR: Python 3 is required to parse Codex JSON output. Install python3 or python and retry." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
cd "$_REPO_ROOT" || exit 1
|
||||||
# Fix 1: wrap with timeout (gtimeout/timeout fallback chain via probe helper)
|
# Fix 1: wrap with timeout (gtimeout/timeout fallback chain via probe helper)
|
||||||
_gstack_codex_timeout_wrapper 600 codex exec resume <session-id> "<prompt>" -C "$_REPO_ROOT" -s read-only -c 'model_reasoning_effort="medium"' --enable web_search_cached --json < /dev/null 2>"$TMPERR" | PYTHONUNBUFFERED=1 "$PYTHON_CMD" -u -c "
|
_gstack_codex_timeout_wrapper 600 codex exec resume <session-id> "<prompt>" -c 'sandbox_mode="read-only"' -c 'model_reasoning_effort="medium"' --enable web_search_cached --json < /dev/null 2>"$TMPERR" | PYTHONUNBUFFERED=1 "$PYTHON_CMD" -u -c "
|
||||||
<same python streaming parser as above, with flush=True on all print() calls>
|
<same python streaming parser as above, with flush=True on all print() calls>
|
||||||
"
|
"
|
||||||
# Fix 1: same hang detection pattern as new-session block
|
# Fix 1: same hang detection pattern as new-session block
|
||||||
|
|
|
||||||
|
|
@ -1297,6 +1297,16 @@ describe('Codex skill', () => {
|
||||||
expect(content).toContain('codex exec resume');
|
expect(content).toContain('codex exec resume');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('codex/SKILL.md resume command only uses resume-supported flags', () => {
|
||||||
|
const content = fs.readFileSync(path.join(ROOT, 'codex', 'SKILL.md'), 'utf-8');
|
||||||
|
const match = content.match(/codex exec resume[^\n]+/);
|
||||||
|
expect(match).not.toBeNull();
|
||||||
|
const resumeCommand = match![0];
|
||||||
|
expect(resumeCommand).not.toContain(' -C ');
|
||||||
|
expect(resumeCommand).not.toContain(' -s read-only');
|
||||||
|
expect(resumeCommand).toContain("-c 'sandbox_mode=\"read-only\"'");
|
||||||
|
});
|
||||||
|
|
||||||
test('codex/SKILL.md contains cost tracking', () => {
|
test('codex/SKILL.md contains cost tracking', () => {
|
||||||
const content = fs.readFileSync(path.join(ROOT, 'codex', 'SKILL.md'), 'utf-8');
|
const content = fs.readFileSync(path.join(ROOT, 'codex', 'SKILL.md'), 'utf-8');
|
||||||
expect(content).toContain('tokens used');
|
expect(content).toContain('tokens used');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue