-
Notifications
You must be signed in to change notification settings - Fork 2.3k
fix(rescue): forbid node-based prompt writes and pgrep wait loops #692
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 2 commits
a793db6
93e7e8d
f9862c5
22fc0b4
36ff14a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -41,6 +41,11 @@ Forwarding rules: | |
| - Return the stdout of the `codex-companion` command exactly as-is. | ||
| - If the Bash call fails or Codex cannot be invoked, return nothing. | ||
|
|
||
| Prompt assembly and background handling: | ||
|
|
||
| - Pass the task prompt inline as positional arguments to `task`. Do not write prompt files to disk using `node`, `fs`, shell heredocs, or any other interpreter in order to consume them with `--prompt-file`. | ||
| - Do not poll, `pgrep`, `watch`, `tail` logs, or run wait loops for a background task. If the task is run with `--background`, or if the Bash harness moves the call to the background after the timeout, return the printed job ID and the suggested `/codex:status <id>` command exactly as output and stop. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When the Bash harness backgrounds a foreground Useful? React with 👍 / 👎.
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right — fixed in The job-ID/status instruction is now scoped to |
||
|
|
||
| Response style: | ||
|
|
||
| - Do not add commentary before or after the forwarded `codex-companion` output. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--before inline prompt argumentsFor a read-only request whose task text mentions a supported option, such as “diagnose why
--writechanges the sandbox,” following this instruction withtask "<prompt>"can silently enable writes and remove that token from the prompt.normalizeArgvsplits a sole quoted argument andparseArgsrecognizes options anywhere before a--delimiter, so the inline-prompt contract must requiretask [runtime options] -- "<prompt>"to keep task text from becoming runtime control flags.Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in
f9862c5— the contract now requirestask [runtime options] -- "<prompt>"in bothagents/codex-rescue.mdandskills/codex-cli-runtime/SKILL.md.Confirmed the mechanism: with a sole quoted argument
normalizeArgvruns it throughsplitRawArgumentString, andparseArgstreats any--write/--modeltoken before a--delimiter as a runtime option, so it both flips the flag and drops the token from the positionals thatreadTaskPromptjoins into the prompt. With the delimiter,parseArgssetspassthroughand every remaining token is preserved verbatim as prompt text.