You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(compress): derive missing topics from the summary instead of erroring (#301)
'content[0] needs a topic' hard-failed compress calls whose entries had
no topic and no top-level fallback — another retry dead-end of the same
class as the acknowledgeRisk error. Topics are now optional: an entry
without its own topic falls back to the top-level topic, then to one
derived from the summary's first line (markdown headings stripped,
capped at 80 chars), so search_context still has something useful to
match on.
- lib/compress/range-utils.ts: drop the topic throw; add
deriveFallbackTopic; resolveRanges fills the fallback
- lib/compress/types.ts, prompts: topic documented as fully optional
- tests: the three throw-cases now assert validity; deriveFallbackTopic
unit coverage (heading strip, length cap, empty summary)
Copy file name to clipboardExpand all lines: lib/prompts/compress-range.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -35,7 +35,7 @@ Rules:
35
35
BATCHING
36
36
When multiple independent ranges are ready and their boundaries do not overlap, include all of them as separate entries in the \`content\` array of a single tool call. Each entry should have its own \`startId\`, \`endId\`, and \`summary\`.
37
37
38
-
When the ranges cover unrelated topics, give each entry its own \`topic\` for better summary quality — do not force unrelated content under a single shared topic. Omit the top-level \`topic\` when every entry has its own. Use the top-level \`topic\` only as a fallback when entries don't specify one.
38
+
When the ranges cover unrelated topics, give each entry its own \`topic\` for better summary quality — do not force unrelated content under a single shared topic. The top-level \`topic\` is an optional fallback; when no topic is provided at all, one is derived from the summary's first line automatically.
0 commit comments