Skip to content

feat(cli, llm): Add jp conversation title command - #895

Open
JeanMertz wants to merge 5 commits into
mainfrom
title-generation-compaction
Open

feat(cli, llm): Add jp conversation title command#895
JeanMertz wants to merge 5 commits into
mainfrom
title-generation-compaction

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

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.

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>
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