Skip to content

fix(conversation, llm): Mark mid-range summaries - #1209

Open
JeanMertz wants to merge 1 commit into
mainfrom
summary-bug
Open

JeanMertz wants to merge 1 commit into
mainfrom
summary-bug

Conversation

@JeanMertz

Copy link
Copy Markdown
Collaborator

A summary compaction was always introduced to the model as [Summary of previous conversation]. That is only true when the summary opens the conversation. After jp c compact --turn=18..38 --summary "...", the model read the marker as "everything above this was replaced", treated turns 1..17 as trimmed, and refused to quote text it demonstrably had in its context. A wire capture confirmed the earlier turns reached the API; adding "turns before and after this are still in your context" to the summary text alone made the model quote them verbatim.

The synthetic request now says which part of the conversation the summary stands for: the earlier part, a middle part, the latest part, or the whole conversation so far, and states that the surrounding messages are still in the model's context. Conversations that already carry a summary see a new marker, costing one prompt-cache miss.

With JP_DEBUG=1, the Anthropic subscription (ACP) route keeps the Claude Code transcript it writes for each request instead of deleting it, and logs its path. That file is the only record of what JP handed Claude Code, which the trace log cannot show on this route. Without JP_DEBUG, the path is logged at debug level and the file is removed as before. Kept transcripts are not cleaned up automatically.

A summary compaction was always introduced to the model as
`[Summary of previous conversation]`. That is only true when the
summary opens the conversation. After `jp c compact --turn=18..38
--summary "..."`, the model read the marker as "everything above this
was replaced", treated turns 1..17 as trimmed, and refused to quote
text it demonstrably had in its context. A wire capture confirmed the
earlier turns reached the API; adding "turns before and after this are
still in your context" to the summary text alone made the model quote
them verbatim.

The synthetic request now says which part of the conversation the
summary stands for: the earlier part, a middle part, the latest part,
or the whole conversation so far, and states that the surrounding
messages are still in the model's context. Conversations that already
carry a summary see a new marker, costing one prompt-cache miss.

With `JP_DEBUG=1`, the Anthropic subscription (ACP) route keeps the
Claude Code transcript it writes for each request instead of deleting
it, and logs its path. That file is the only record of what JP handed
Claude Code, which the trace log cannot show on this route. Without
`JP_DEBUG`, the path is logged at debug level and the file is removed
as before. Kept transcripts are not cleaned up automatically.

Signed-off-by: Jean Mertz <git@jeanmertz.com>

This branch has not been deployed

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