Skip to content

fix: insert -- separator before positional prompt args in codex/opencode/pi-rust#106

Merged
c-h- merged 2 commits into
mainfrom
fix/dash-prompt-separator
Mar 6, 2026
Merged

fix: insert -- separator before positional prompt args in codex/opencode/pi-rust#106
c-h- merged 2 commits into
mainfrom
fix/dash-prompt-separator

Conversation

@c-h-
Copy link
Copy Markdown
Collaborator

@c-h- c-h- commented Mar 6, 2026

Summary

Prompts starting with dashes (e.g. YAML frontmatter ---) were silently crashing launches for adapters that pass the prompt as a positional CLI argument. The downstream arg parsers (codex, opencode, pi-rust) would interpret the leading dashes as unknown CLI options and exit immediately.

Fix: insert -- (end-of-options separator) immediately before the positional prompt argument in affected adapters.

Adapters fixed: codex, opencode, pi-rust (all use positional prompt args)
Unaffected: claude-code, pi (both use -p <value> flag syntax, not positional)

Replaces #99 (that PR diverged from main and inadvertently removed the isSessionRunningLightweight optimization from #100).

Fixes #91

Test plan

  • New test in opencode-launch.test.ts: verifies -- appears before prompt when prompt starts with ---
  • Updated existing opencode-launch tests to expect -- separator
  • pi-rust-launch tests verify prompt position (use toContain, no changes needed)
  • All 479 tests pass
  • TypeScript typecheck clean
  • Biome lint clean
  • Pre-push hooks (lint + typecheck + build + test) pass

Doink (OpenClaw) and others added 2 commits March 6, 2026 09:56
…ode/pi-rust

Prompts starting with dashes (e.g. YAML frontmatter '---') were being
parsed as unknown CLI options by the downstream arg parsers in codex,
opencode, and pi-rust, causing silent launch failures.

Inserting -- (end-of-options separator) before the positional prompt
argument prevents any parser from treating the prompt text as flags.

Adapters affected: codex, opencode, pi-rust (all use positional prompt args).
Claude Code and pi are unaffected (both use -p <value> flag syntax).

Fixes #91

Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>
Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>
@c-h- c-h- enabled auto-merge (squash) March 6, 2026 17:57
@c-h- c-h- merged commit a105e53 into main Mar 6, 2026
1 check passed
c-h- added a commit that referenced this pull request Mar 6, 2026
New features:
- feat: add --file flag to launch command (#95)

Bug fixes:
- fix: insert -- separator before positional prompt args (#106)
- fix: peek/status timeout on opencode sessions (#100)
- fix: use temp file for large prompts instead of CLI args (#101)

Performance:
- perf: use history.jsonl for Claude Code discover(), batch lsof calls (#96)

Co-Authored-By: Charlie Hulcher <charlie@kindo.ai>
@c-h- c-h- mentioned this pull request Mar 6, 2026
c-h- added a commit that referenced this pull request Mar 6, 2026
New features:
- feat: add --file flag to launch command (#95)

Bug fixes:
- fix: insert -- separator before positional prompt args (#106)
- fix: peek/status timeout on opencode sessions (#100)
- fix: use temp file for large prompts instead of CLI args (#101)

Performance:
- perf: use history.jsonl for Claude Code discover(), batch lsof calls (#96)

Co-authored-by: Doink (OpenClaw) <charlie+doink@kindo.ai>
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.

Bug: Prompts starting with '---' parsed as CLI options — silent launch failure

1 participant