Commit e4bc697
authored
docs(rfd): Add RFD 053 for auto-refresh conversation titles (#461)
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>1 parent af70d0d commit e4bc697
3 files changed
Lines changed: 449 additions & 10 deletions
File tree
- docs
- .vitepress
- rfd
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
209 | 213 | | |
210 | 214 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
302 | 302 | | |
303 | 303 | | |
304 | 304 | | |
305 | | - | |
306 | | - | |
| 305 | + | |
| 306 | + | |
307 | 307 | | |
308 | 308 | | |
309 | 309 | | |
| |||
312 | 312 | | |
313 | 313 | | |
314 | 314 | | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
315 | 321 | | |
316 | 322 | | |
317 | 323 | | |
318 | | - | |
319 | | - | |
320 | | - | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
321 | 328 | | |
322 | 329 | | |
323 | 330 | | |
324 | 331 | | |
| 332 | + | |
325 | 333 | | |
326 | 334 | | |
327 | 335 | | |
| 336 | + | |
328 | 337 | | |
329 | 338 | | |
330 | 339 | | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
335 | 344 | | |
336 | 345 | | |
337 | 346 | | |
| |||
0 commit comments