Merge remote-tracking branch 'origin/master' into worktree/web-multimodal-image-input
# Conflicts: # .agents/notes/implemented/architecture/2026-07-05-reconstructable-requests.i18n.yaml # docs/core-data-structures/core.i18n.yaml # docs/module-graph.md # packages/client/ui-conversation/src/client/chat/AssistantMarkdown.tsx # packages/client/ui-conversation/src/client/index.ts # packages/compact/compact-basic/README.i18n.yaml
This commit is contained in:
@@ -43,7 +43,7 @@ interface PreparedCompaction extends SurfaceSelection {
|
||||
readonly input: SummarizationInput
|
||||
}
|
||||
|
||||
interface SummarizedCompaction extends PreparedCompaction, SummaryResult {
|
||||
type SummarizedCompaction = PreparedCompaction & SummaryResult & {
|
||||
readonly checkpointMessage: UserMessage
|
||||
}
|
||||
|
||||
@@ -415,16 +415,18 @@ function commitCompactionBody(
|
||||
shadowedSeqs,
|
||||
shadowedTokenCount,
|
||||
summary,
|
||||
rawOutput,
|
||||
provider,
|
||||
model,
|
||||
maxTokens,
|
||||
usage,
|
||||
checkpointMessage,
|
||||
} = summarized
|
||||
const callProvenance = summarized.llmStreamCall === true
|
||||
? { rawOutput: summarized.rawOutput, llmStreamCall: true as const }
|
||||
: summarized.rawOutput === undefined ? {} : { rawOutput: summarized.rawOutput }
|
||||
const summaryEvent = session.append('compact/summary', {
|
||||
summary,
|
||||
...rawOutput === undefined ? {} : { rawOutput },
|
||||
...callProvenance,
|
||||
shadowedRange: { start, end },
|
||||
shadowedSeqs: [...shadowedSeqs],
|
||||
shadowedTokenCount,
|
||||
|
||||
@@ -85,16 +85,27 @@ export interface SummarizationInput {
|
||||
}
|
||||
|
||||
/** Safe summary content plus the exact auxiliary call envelope recorded in provenance. */
|
||||
export interface SummaryResult {
|
||||
export type SummaryResult = {
|
||||
summary: ContentBlock[]
|
||||
/** Complete provider output before the text-only summary projection. */
|
||||
rawOutput?: ContentBlock[]
|
||||
provider: string
|
||||
model: string
|
||||
maxTokens?: number
|
||||
/** Provider-reported usage for this summarization request. */
|
||||
usage?: TokenUsage
|
||||
}
|
||||
} & (
|
||||
| {
|
||||
/** Complete provider output before the text-only summary projection. */
|
||||
rawOutput: ContentBlock[]
|
||||
/** Identifies exactly one call through this context's `ctx.llm.stream()`. */
|
||||
llmStreamCall: true
|
||||
}
|
||||
| {
|
||||
/** Optional complete output from an unmarked template, remote, or other summarizer. */
|
||||
rawOutput?: ContentBlock[]
|
||||
/** An unmarked result does not identify a call through this context's LLM seam. */
|
||||
llmStreamCall?: never
|
||||
}
|
||||
)
|
||||
|
||||
/**
|
||||
* Run the default cache-reusing `ctx.llm.stream()` summarization call: replay
|
||||
@@ -162,6 +173,7 @@ export async function summarizeWithLlm(
|
||||
return {
|
||||
summary,
|
||||
rawOutput,
|
||||
llmStreamCall: true,
|
||||
provider: options.provider,
|
||||
model: options.model,
|
||||
maxTokens: config.maxTokens,
|
||||
|
||||
Reference in New Issue
Block a user