Skip to content

feat(cli, config, conversation): Add --cfg reset keywords#849

Open
JeanMertz wants to merge 1 commit into
mainfrom
038-config-reset-keywords
Open

feat(cli, config, conversation): Add --cfg reset keywords#849
JeanMertz wants to merge 1 commit into
mainfrom
038-config-reset-keywords

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

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.

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>
@JeanMertz JeanMertz force-pushed the 038-config-reset-keywords branch from ef5cb47 to 1903e7b Compare July 8, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant