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:
@@ -1,10 +1,10 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { describe, expect, expectTypeOf, it, vi } from 'vitest'
|
||||
import { Context } from 'cordis'
|
||||
import { AttachmentId } from '@deepseek-ai/dsh-attachment'
|
||||
import BasicCompactService from '@deepseek-ai/dsh-compact-basic'
|
||||
import type { BasicCompactConfig } from '@deepseek-ai/dsh-compact-basic'
|
||||
import { selectCompactableRange } from '@deepseek-ai/dsh-compact-basic/src/region.ts'
|
||||
import type { SummarizationInput } from '@deepseek-ai/dsh-compact-basic/src/summarizer.ts'
|
||||
import type { SummarizationInput, SummaryResult } from '@deepseek-ai/dsh-compact-basic/src/summarizer.ts'
|
||||
import { toolPairingBalancedAfter, toolPairingBalancedBefore } from '@deepseek-ai/dsh-compact'
|
||||
import {
|
||||
resolveCompactSpec,
|
||||
@@ -869,6 +869,7 @@ describe('compaction region transaction', () => {
|
||||
rawOutput: compact.rawOutput,
|
||||
usage: compact.usage,
|
||||
})
|
||||
expect(summary?.data).not.toHaveProperty('llmStreamCall')
|
||||
const head = session.deriveMessages()[0]!
|
||||
expect(head.content[0]?.type).toBe('text')
|
||||
expect(head.content[0]?.type === 'text' ? head.content[0].text : '').toContain('<compacted-summary>')
|
||||
@@ -1166,6 +1167,15 @@ async function summarizerHarness(
|
||||
}
|
||||
|
||||
describe('default one-shot summarizer', () => {
|
||||
it('requires complete raw output when a subclass marks one local LLM stream call', () => {
|
||||
expectTypeOf<{
|
||||
summary: ContentBlock[]
|
||||
llmStreamCall: true
|
||||
provider: string
|
||||
model: string
|
||||
}>().not.toExtend<SummaryResult>()
|
||||
})
|
||||
|
||||
it('uses configured model/default cap, forwards cancellation, and keeps only safe text', async () => {
|
||||
const { adapter, compact } = await summarizerHarness([
|
||||
{ type: 'reasoning', text: 'private' },
|
||||
@@ -1188,6 +1198,7 @@ describe('default one-shot summarizer', () => {
|
||||
{ type: 'text', text: 'public summary' },
|
||||
{ type: 'tool-call', id: CallId('unexpected'), name: 'x', arguments: '{}' },
|
||||
],
|
||||
llmStreamCall: true,
|
||||
provider: MODEL,
|
||||
model: MODEL,
|
||||
maxTokens: 321,
|
||||
@@ -1313,6 +1324,7 @@ describe('default one-shot summarizer', () => {
|
||||
await compact.compactRegion(nodes[0]!, nodes[3]!, agent(session, MODEL), SIGNAL)
|
||||
expect(session.events.findLast(event => event.type === 'compact/summary')?.data).toMatchObject({
|
||||
summary: [{ type: 'text', text: 'routed summary' }],
|
||||
llmStreamCall: true,
|
||||
provider: 'routed-summary-provider',
|
||||
model: 'routed-summary-model',
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user