feat(cli, config): Accept comma-separated tool names - #1066
Merged
Conversation
`--tool` and `--no-tool` take several tool names in one flag, separated
by commas, so a query that opens up three tools no longer needs three
flags:
```sh
jp query -t cargo_check,cargo_test,fs_read_file "Does this compile?"
```
Space around a name is ignored, repeating the flag still works and
composes with the comma form, and each name keeps its place in the
left-to-right order that `--no-tool --tool=write` relies on. A bare
`--tool` or `--no-tool` is unchanged: it still covers every configured
tool.
A missing value is refused rather than guessed at, wherever a comma
separates values. `-t read,,write` reports the stray comma instead of
reading it as the bare flag and enabling everything, and a `--cfg` list
does the same instead of quietly dropping the gap. Assigning nothing at
all is untouched: `conversation.labels.crate=` still names no values and
remains the way to clear a list, and a value that genuinely contains a
comma is written with the JSON form, `crate:="feat,exp"`.
The tool-use documentation is corrected alongside. It described
`--tool=false`, `--tool=true`, and `--tool=<name>`, which are spellings
of `--tool-use` and `--no-tool-use`; `--tool=false` asks for a tool
named "false" and errors.
BREAKING CHANGE: A tool name cannot contain a comma
Configuring a tool whose name contains a comma is rejected when the
configuration resolves, naming the offending key:
conversation.tools.read,write: a tool name cannot contain a comma,
because `--tool` and `--no-tool` read it as a separator between names
Rename the tool to clear the error.
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
--tooland--no-tooltake several tool names in one flag, separated by commas, so a query that opens up three tools no longer needs three flags:jp query -t cargo_check,cargo_test,fs_read_file "Does this compile?"Space around a name is ignored, repeating the flag still works and composes with the comma form, and each name keeps its place in the left-to-right order that
--no-tool --tool=writerelies on. A bare--toolor--no-toolis unchanged: it still covers every configured tool.A missing value is refused rather than guessed at, wherever a comma separates values.
-t read,,writereports the stray comma instead of reading it as the bare flag and enabling everything, and a--cfglist does the same instead of quietly dropping the gap. Assigning nothing at all is untouched:conversation.labels.crate=still names no values and remains the way to clear a list, and a value that genuinely contains a comma is written with the JSON form,crate:="feat,exp".The tool-use documentation is corrected alongside. It described
--tool=false,--tool=true, and--tool=<name>, which are spellings of--tool-useand--no-tool-use;--tool=falseasks for a tool named "false" and errors.BREAKING CHANGE: A tool name cannot contain a comma
Configuring a tool whose name contains a comma is rejected when the configuration resolves, naming the offending key:
Rename the tool to clear the error.