feat(cli, editor): Allow editing configuration in query editor#310
Merged
feat(cli, editor): Allow editing configuration in query editor#310
Conversation
Users can now modify the active configuration directly within the `QUERY_MESSAGE.md` editor when using `jp query`. The editor displays a subset of the current configuration in a TOML code block below a cut marker, which can be edited (and amended) before submitting the query. Invalid configuration will cause the editor to reopen with an error message, allowing immediate correction. Currently, the configuration section shows the model ID and reasoning parameters, but any valid configuration properties can be set in this code block. Changes made in the editor are merged with the existing configuration and stored with the conversation message, eliminating the need to close the editor and restart with different CLI arguments. The editor also shows an improved conversation history section with timestamps, model information, and properly formatted markdown for assistant responses including reasoning content when available. Implementation adds a new `QueryDocument` parser in `crates/jp_cli/src/editor/parser.rs` that handles the structured format of the query file, separating the query content from metadata sections. The `edit_query` function now returns both the query text and any configuration changes, which are merged into the partial config before storing messages. Error handling includes validation feedback displayed directly in the editor to streamline the correction workflow. Related: #217 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.
Users can now modify the active configuration directly within the
QUERY_MESSAGE.mdeditor when usingjp query. The editor displays a subset of the current configuration in a TOML code block below a cut marker, which can be edited (and amended) before submitting the query. Invalid configuration will cause the editor to reopen with an error message, allowing immediate correction.Currently, the configuration section shows the model ID and reasoning parameters, but any valid configuration properties can be set in this code block. Changes made in the editor are merged with the existing configuration and stored with the conversation message, eliminating the need to close the editor and restart with different CLI arguments.
The editor also shows an improved conversation history section with timestamps, model information, and properly formatted markdown for assistant responses including reasoning content when available.
Implementation adds a new
QueryDocumentparser incrates/jp_cli/src/editor/parser.rsthat handles the structured format of the query file, separating the query content from metadata sections. Theedit_queryfunction now returns both the query text and any configuration changes, which are merged into the partial config before storing messages. Error handling includes validation feedback displayed directly in the editor to streamline the correction workflow.Related: #217