[codex] Add literal mode for subcommand-shaped prompts#33
Draft
CoreyRDean wants to merge 1 commit into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Non-technical summary
This adds a small but important escape hatch for
intent's command-line UX: prompts that begin with words likeversion,report, orexplaincan 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
--literalhandling ininternal/cli/cli.goby collapsing everything after the first--literalinto one prompt token before subcommand matching--literal, while keeping everything after it inside the prompt textinternal/cli/cli_test.gofor the argv rewrite behaviorinternal/cli/smoke_test.goproving thatversionstays in natural-language mode under--literaland that tail flag-shaped words are not re-parseddocs/SPEC.mdandREADME.mdto document the new public flaggo test ./internal/cli/...,go test ./...,go vet ./...,make buildAdditional notes
Trade-off:
--literalis 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.