Skip to content

fix: preserve task prompts as free text - #555

Draft
Epochex wants to merge 1 commit into
openai:mainfrom
Epochex:fix/task-prompt-argv-boundary
Draft

fix: preserve task prompts as free text#555
Epochex wants to merge 1 commit into
openai:mainfrom
Epochex:fix/task-prompt-argv-boundary

Conversation

@Epochex

@Epochex Epochex commented Jul 25, 2026

Copy link
Copy Markdown

Summary

  • stop re-tokenizing a task's sole free-text argument as a command line
  • keep runtime flags separate from prompt content with an explicit -- boundary
  • preserve multiline text, quotes, Windows paths, and flag-looking prose verbatim
  • update the rescue-agent contract and CLI usage to use the safe invocation shape

Fixes #512.

Root cause

normalizeArgv() treated every single argument as a raw command line. For task prompts, this fed user prose through shell-style quote/backslash removal and then through option parsing. Text such as --model or --write could therefore change runtime behavior instead of reaching Codex, while Windows paths, quotes, and newlines were silently corrupted.

The compatibility behavior remains in place for commands that receive Claude Code's quoted $ARGUMENTS; only task, whose positional payload is free text, opts out.

Impact

Codex rescue tasks now receive the exact prompt Claude Code forwarded. Prompts about CLIs can safely contain option names, and Windows paths and quoted diagnostics are no longer mangled. Explicit task controls still work before --.

Validation

  • node --test tests/*.test.mjs under Linux / Node 22.23.1: 93 passed, 0 failed
  • node_modules/.bin/tsc.cmd -p tsconfig.app-server.json
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

task prompts passed as a single argument are re-tokenized: quotes/backslashes stripped, prose --model/--write hijacked as real options

1 participant