Skip to content

[codex] Add literal mode for subcommand-shaped prompts#33

Draft
CoreyRDean wants to merge 1 commit into
mainfrom
ux/literal-natural-language
Draft

[codex] Add literal mode for subcommand-shaped prompts#33
CoreyRDean wants to merge 1 commit into
mainfrom
ux/literal-natural-language

Conversation

@CoreyRDean
Copy link
Copy Markdown
Owner

Non-technical summary

This adds a small but important escape hatch for intent's command-line UX: prompts that begin with words like version, report, or explain can now be forced through natural-language mode instead of being mistaken for subcommands. That matters now because the current dispatch rule makes some perfectly valid prompts awkward or impossible to express without rewriting them.

After this change, i --literal ... keeps the rest of the argv tail as prompt text, so users can intentionally say things that look like subcommands or flags without fighting the parser.

Technical summary

  • add dispatcher-level --literal handling in internal/cli/cli.go by collapsing everything after the first --literal into one prompt token before subcommand matching
  • preserve natural-language flags placed before --literal, while keeping everything after it inside the prompt text
  • extend unit coverage in internal/cli/cli_test.go for the argv rewrite behavior
  • add smoke coverage in internal/cli/smoke_test.go proving that version stays in natural-language mode under --literal and that tail flag-shaped words are not re-parsed
  • update docs/SPEC.md and README.md to document the new public flag
  • verification: go test ./internal/cli/..., go test ./..., go vet ./..., make build
  • breaking changes: none intended; this is an additive CLI alignment fix

Additional notes

Trade-off: --literal is intentionally narrow. It fixes the dispatch ambiguity without redesigning the broader natural-language flag parser.

Deferred: larger parser/prompting issues like file-edit grounding and other open natural-language behavior bugs remain separate increments.

Remaining gap: this makes subcommand-shaped prompts expressible, but it does not change how ordinary natural-language prompts are interpreted once they reach the model.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant