feat(cli, llm): Add jp conversation title command - #895
Open
JeanMertz wants to merge 5 commits into
Open
Conversation
Users can now regenerate a conversation's title on demand with `jp conversation title` (alias `t`), without going through `conversation edit --title`. It offers the generated candidates as a picker that can request another batch or fall back to a hand-written title, supports `--count`/`-n` to change how many candidates are generated, `--model`/ `-m` to run generation on a specific model, and `--dry-run` to print candidates without applying one. Without a terminal, the first candidate is applied automatically. `conversation edit --title` (bare) now delegates to this same path, so both commands behave identically. Title generation, previously duplicated between `conversation edit` and `TitleGeneratorTask`, is consolidated into `jp_llm::title::generate` and `resolve_model`. Both callers now also fit the conversation into the title model's context window, dropping older turns the same way the inquiry backend already did; that truncation logic is extracted into a new `jp_llm::window` module shared by inquiry handling, title generation, and conversation summarization. `jp conversation compact --summarize` now rejects a turn range that doesn't fit the summarizing model's context window instead of silently truncating it, since a stored summary has to cover the full range it claims. The error suggests narrowing `--from`/`--to` or picking a larger-window model. Provider errors that report an oversized prompt (Anthropic, OpenAI, Google) are now classified as `ContextWindowExceeded` instead of falling through to generic retry heuristics, since retrying sends the same oversized request again. Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
Signed-off-by: Jean Mertz <git@jeanmertz.com>
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.
Users can now regenerate a conversation's title on demand with
jp conversation title(aliast), without going throughconversation edit --title. It offers the generated candidates as a picker that can request another batch or fall back to a hand-written title, supports--count/-nto change how many candidates are generated,--model/-mto run generation on a specific model, and--dry-runto print candidates without applying one. Without a terminal, the first candidate is applied automatically.conversation edit --title(bare) now delegates to this same path, so both commands behave identically.Title generation, previously duplicated between
conversation editandTitleGeneratorTask, is consolidated intojp_llm::title::generateandresolve_model. Both callers now also fit the conversation into the title model's context window, dropping older turns the same way the inquiry backend already did; that truncation logic is extracted into a newjp_llm::windowmodule shared by inquiry handling, title generation, and conversation summarization.jp conversation compact --summarizenow rejects a turn range that doesn't fit the summarizing model's context window instead of silently truncating it, since a stored summary has to cover the full range it claims. The error suggests narrowing--from/--toor picking a larger-window model.Provider errors that report an oversized prompt (Anthropic, OpenAI, Google) are now classified as
ContextWindowExceededinstead of falling through to generic retry heuristics, since retrying sends the same oversized request again.