Conversation
RFD 053 proposes periodic background re-titling of conversations that have accumulated a configurable number of new turns since their title was last generated. The core design introduces a `turn_interval` threshold (default 5) under `conversation.title.generate.auto_refresh`. When a `jp query` run starts, a background `TitleRefreshTask` scans all conversations, identifies stale candidates (those where `turn_count >= baseline + turn_interval`), and re-runs LLM title generation for up to `batch_size` of them — sorted by least recently activated to avoid churning active conversations. Key design decisions: - A new `title_generated_at_turn` field on `Conversation` tracks the turn count when the title was last auto-generated, serving as the staleness baseline. - A `retain_current` field in the title generation schema lets the LLM signal that the existing title is still accurate, advancing the checkpoint without replacing the title. - `turn_context` (default 10) caps how many recent turns are sent to the LLM, keeping costs predictable for long conversations. - Manual `conversation edit --title "..."` writes a `ConfigDelta` with `turn_interval = 0`, opting that conversation out of auto-refresh. - The full pipeline — scanning, loading, LLM calls — runs off the critical path and respects `CancellationToken` to avoid delaying CLI exit. RFD 020 is also updated to reflect that `get_conversation_mut` (not just `get_events_mut`) requires a `&ConversationLock`, as the title refresh sync phase needs to mutate conversation metadata under the same locking invariant. 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.
RFD 053 proposes periodic background re-titling of conversations that have accumulated a configurable number of new turns since their title was last generated.
The core design introduces a
turn_intervalthreshold (default 5) underconversation.title.generate.auto_refresh. When ajp queryrun starts, a backgroundTitleRefreshTaskscans all conversations, identifies stale candidates (those whereturn_count >= baseline + turn_interval), and re-runs LLM title generation for up tobatch_sizeof them — sorted by least recently activated to avoid churning active conversations.Key design decisions:
title_generated_at_turnfield onConversationtracks the turn count when the title was last auto-generated, serving as the staleness baseline.retain_currentfield in the title generation schema lets the LLM signal that the existing title is still accurate, advancing the checkpoint without replacing the title.turn_context(default 10) caps how many recent turns are sent to the LLM, keeping costs predictable for long conversations.conversation edit --title "..."writes aConfigDeltawithturn_interval = 0, opting that conversation out of auto-refresh.CancellationTokento avoid delaying CLI exit.RFD 020 is also updated to reflect that
get_conversation_mut(not justget_events_mut) requires a&ConversationLock, as the title refresh sync phase needs to mutate conversation metadata under the same locking invariant.