Repository navigation
Closed
Labels
codexA sage task handed to Codex: Codex builds and opens a PR; the sage reviews and merges
Description
Follow-up of PR #92 (issue #88, unit 1). Size: small. Sage task T209. Found in the sage's review; not blocking, because the probe runs only by hand.
Goal
The native Codex lifecycle probe (scripts/probe-codex-lifecycle.mjs and scripts/fixtures/codex-native/) always cleans up, never hangs, and stays isolated.
Findings to fix
- Medium, no clean-up. The probe never deletes its temporary folder in any exit path: success, a version failure, a listener failure, a setup assert or a fixture failure. Each run leaves a Codex profile in TMPDIR with a trusted hooks.json and config.toml, the capture script, session transcripts and the events folder. Delete it in a finally block with rmSync and the recursive and force options.
- Medium, no timeout. The probe waits without limit on codex --version, on codex app-server in the setup, and on codex exec. A stalled Codex hangs the probe forever, and then nothing cleans up. Add a wide timeout with a reason in the code (standing order 26). On timeout, end stdin, report the failure, and clean up.
- Low, the hook command path. setup-capture.mjs writes the hook command as node followed by the JSON-quoted script path, and Codex runs a command hook through a shell. JSON quoting does not stop command substitution or backticks inside double quotes. Refuse a root path that holds any character other than letters, digits, slash, dot, underscore and dash.
- Low, telemetry. The probe's environment sets no telemetry switch. Set DO_NOT_TRACK=1 and Codex's own analytics or OTEL off switch (standing order 10). The app-server setup run has no loopback provider override: confirm that it makes no model or network request, or add the override.
- Low, scope wording. claude-parity-audit.md and automatic-workflow-design.md say that unit 1 covers owner prompt identity, denial behaviour, ordering and compaction. The probe covers only the spawn, result, start and stop lifecycle. Make the unit-1 text say what this probe covers, and list the rest as later units on Missing feature: automatic Sage workflows and gated autopilot in Codex #88.
Acceptance
- A test, or the probe itself, shows that a failed run and a timed-out run leave no temporary folder.
- npm run build, npm run check and npm test pass. Every run puts fake ps, pgrep and kill first on PATH.
Metadata
Metadata
Assignees
Labels
codexA sage task handed to Codex: Codex builds and opens a PR; the sage reviews and merges
Activity
erickb336 commentedon Oct 11, 2026
Also from PR #92's QA (run R719): the two documents (packages/sage-codex/runtime/automatic-workflow-design.md and claude-parity-audit.md, and their built copies) use two words that the sage dictionary flags: "stage" (for example "first delivery stage") and "gates" (in "merge gates"). AGENTS.md asks for the approved words in writing/dictionary.md, and npm run check does not scan these files today. Use the approved words, and add these files to the dictionary check.
QA also found 9 old probe folders, of up to 3.9 MB each, in the user temp folder from earlier runs. The clean-up fix should say how to remove them.