,, becomes one-shot: top fix on the prompt line, --pick for alternatives - #10
Merged
Conversation
Before: `,,` always opened the fzf picker, even for obvious typos
(`-tpye` → `-type`). One keystroke too many for the common case.
And `,, <prompt>` was overloaded — sometimes "fix with intent",
sometimes "propose with context" — which made the model guess.
After:
,, one-shot fix. Top suggestion drops on the
prompt line via `print -z`; diagnosis prints
above. User reads both, hits Enter to run, or
edits, or Ctrl-C. Never auto-executes.
,, <intent> same flow, but the intent narrows the model
("use ripgrep", "I meant the dev branch").
,, --pick [intent] escape hatch — full picker for ambiguous
cases where alternatives matter.
, --ctx <prompt> the old "propose with context" use case
moves to a flag on `,` since it's
refinement, not repair.
Implementation:
- comma.py adds `--pick`. In fix mode the default is `chosen =
items[0]["command"]`, bypassing `_pick()`. `--pick` restores the
picker path. `--ctx` and `--fix` are otherwise mutually exclusive.
- The `,,` zsh function always invokes `--fix`. It pops a leading
tier flag for routing (--fast/--balanced/--smart) and a `--pick`
flag anywhere in the args; everything else becomes intent. Bash
adapter (`llmf`) mirrors the shape.
- `, --ctx <prompt>` already existed as a flag, so the migration is
just the docs telling users where to go.
The "comma never executes" invariant stays — `print -z` puts the
command on the next prompt line, the user's finger on Enter is what
runs it.
Demo Beat 2 gets one keystroke shorter — the diagnosis line and
corrected `find . -type f -name '*.py'` land together, the user
just confirms.
Tests added: bare --fix prints top to stdout without `_pick`;
`--fix --pick` restores the picker; `--pick` coexists with a
free-form intent; plain `,` still uses the picker. 264 tests pass.
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.
Summary
Before this PR,
,,always opened the fzf picker, even for obvious typos (-tpye→-type). One keystroke too many for the common case. And,, <prompt>was overloaded — sometimes "fix with intent", sometimes "propose with context" — which left the model guessing.After:
,,,, <intent>,, use ripgrep,,, I meant the dev branch).,, --pick [intent], --ctx <prompt>,since it's refinement, not repair.What changed
comma.pyadds--pick. In fix mode the default path is nowchosen = items[0]["command"], skipping_pick()entirely;--pickrestores the picker.,,zsh function always invokes--fix. It pops a leading tier flag (--fast/--balanced/--smart) for routing, recognises--pickanywhere in the args, and treats everything else as intent.llmf) mirrors the same shape., --ctx <prompt>flag already existed; the migration is documentation telling users where to go.The comma never executes invariant stays intact:
print -zputs the command on the next prompt line; the user's finger on Enter is what runs it.Demo
Beat 2 is one keystroke shorter — diagnosis line and the corrected
find . -type f -name '*.py'land together. The audience reads both, then Enter to run. New gif rendered, committed in this PR.Test plan
pytest -qclean (264 tests, 4 new):--fixprints top suggestion to stdout, does not invoke_pick--fix --pickrestores the picker path--pickcoexists with a free-form intent (both reach the model),still uses the pickerruff checkandruff format --checkcleanzsh/shellllm.zsh, run a failing command, verify,,drops the corrected command on the prompt line ready for Enter