Conversation
`jp query --fork` has never run: it panicked while clap parsed its own arguments, before the command did any work, with or without a turn count. Forking from a query works now: `jp q "..." --fork` forks the active conversation and starts a turn on the fork, and `jp q --fork=2 "..."` gives the fork only the source's last two turns. A bare `--fork` takes the next word as its count, so the prompt goes first, or the count is attached with `=`. The flag paired `default_missing_value = ""` with a `value_parser` returning `Option<usize>`, so clap registered the value under one type and the derived reader asked for another. Without the default, clap's own `Option<Option<T>>` handling reports a bare `--fork` as `Some(None)`, the same "keep every turn" the empty string stood for, and the parser is left handling only the counts a user actually writes. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Quitting the editor without typing anything leaves no trace. `jp q -n` prints "Query is empty, ignoring." and the conversation it was about to start is gone: nothing on disk, and the session still points at whatever it pointed at before. Abandoning a query on an existing conversation the same way leaves its metadata and `events.json` untouched. Every flag that shapes the conversation waits for the request now. `--tmp` stamped the expiry and flushed it while the conversation was being created, `--fork` wrote the whole fork before the prompt was composed, `--compact` wrote its compaction events, and `--title` wrote the title, all before anyone knew whether there would be a turn. The same holds for a run that fails on the way to the turn, such as a missing API key or an editor that will not spawn. `ConversationMut::discard_on_drop` inverts guard-scoped persistence for a single scope: `flush` becomes the only thing that writes, and every other way out leaves storage alone. `jp query` stages its whole pre-turn phase in one such scope and flushes it once the request is known to be non-empty. `fork_conversation` hands its scope back unflushed, so the flush in `jp c fork` is what creates a fork, and a multi-source run that fails part-way no longer leaves an unreported conversation behind. 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.
Quitting the editor without typing anything leaves no trace.
jp q -nprints "Query is empty, ignoring." and the conversation it was about to
start is gone: nothing on disk, and the session still points at
whatever it pointed at before. Abandoning a query on an existing
conversation the same way leaves its metadata and
events.jsonuntouched.
Every flag that shapes the conversation waits for the request now.
--tmpstamped the expiry and flushed it while the conversation wasbeing created,
--forkwrote the whole fork before the prompt wascomposed,
--compactwrote its compaction events, and--titlewrotethe title, all before anyone knew whether there would be a turn. The
same holds for a run that fails on the way to the turn, such as a
missing API key or an editor that will not spawn.
ConversationMut::discard_on_dropinverts guard-scoped persistence fora single scope:
flushbecomes the only thing that writes, and everyother way out leaves storage alone.
jp querystages its wholepre-turn phase in one such scope and flushes it once the request is
known to be non-empty.
fork_conversationhands its scope backunflushed, so the flush in
jp c forkis what creates a fork, and amulti-source run that fails part-way no longer leaves an unreported
conversation behind.