feat(cli, config, conversation): Add --cfg reset keywords#849
Open
JeanMertz wants to merge 1 commit into
Open
Conversation
Adds `NONE` and `WORKSPACE` as reserved `--cfg` values, plus a `--no-cfg` shorthand for a leading `--cfg=NONE`. `jp q --cfg=NONE` skips implicit config loading and starts from program defaults; `jp q --cfg=WORKSPACE` discards prior `--cfg` state and restarts from the workspace's fully-resolved config. Both accept further `--cfg` values layered on top, e.g. `jp q --cfg=NONE --cfg assistant.model.id=openai/gpt`. A config file can also declare `loader.reset = "none"` to reset state at that point in the `--cfg` list; the section is read only from the entry file itself (not through `extends`) and never leaks into resolved or persisted config. On a continuing or forked conversation, a reset keyword is persisted into the conversation's event stream as a new `Reset` config-delta variant, followed by an `Apply` for whatever this invocation layered on top. `ConfigDelta` is now an enum (`Apply`/`Reset`) instead of a struct; the on-disk `Apply` shape is unchanged (no `op` field), and legacy events without `op` keep decoding as `Apply`. `Reset` writes `"op": "reset"` and discards all state accumulated before it, including the base config, when the stream is resolved. Signed-off-by: Jean Mertz <git@jeanmertz.com>
ef5cb47 to
1903e7b
Compare
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.
Adds
NONEandWORKSPACEas reserved--cfgvalues, plus a--no-cfgshorthand for a leading--cfg=NONE.jp q --cfg=NONEskips implicit config loading and starts from program defaults;jp q --cfg=WORKSPACEdiscards prior--cfgstate and restarts from the workspace's fully-resolved config. Both accept further--cfgvalues layered on top, e.g.jp q --cfg=NONE --cfg assistant.model.id=openai/gpt. A config file can also declareloader.reset = "none"to reset state at that point in the--cfglist; the section is read only from the entry file itself (not throughextends) and never leaks into resolved or persisted config.On a continuing or forked conversation, a reset keyword is persisted into the conversation's event stream as a new
Resetconfig-delta variant, followed by anApplyfor whatever this invocation layered on top.ConfigDeltais now an enum (Apply/Reset) instead of a struct; the on-diskApplyshape is unchanged (noopfield), and legacy events withoutopkeep decoding asApply.Resetwrites"op": "reset"and discards all state accumulated before it, including the base config, when the stream is resolved.