Files
openchamber/packages/web/server/lib/text/summarization.test.js
T
Bohdan Triapitsyn 174fa4e96d chore: retire zen-backed summarization
Disable the active Zen summarization flow because the unauthenticated/free Zen provider is no longer available and now returns usage-limit errors for this feature.

Keep /api/text/summarize as an API-compatible stub that returns local sanitized or distilled fallback text with summarized=false, rather than attempting external model calls.

Remove notification and voice playback summary behavior from runtime paths. Notification {last_message} now always uses normalized truncated text, and TTS playback ignores historical summarize request fields.

Hide the notification summary settings and voice summarize-before-playback controls while preserving legacy persisted settings for compatibility. Also disable Zen model startup validation and make Zen model list routes return empty results.

Update module documentation and tests to describe the retired provider behavior and the remaining compatibility stubs.
2026-05-19 02:06:52 +03:00

35 lines
1.3 KiB
JavaScript

import { describe, expect, it } from 'vitest';
import { summarizeText } from './summarization.js';
describe('text summarization stubs', () => {
it('does not call the retired zen provider', async () => {
const result = await summarizeText({
text: 'The implementation now correctly loads notification templates before dispatching the notification. It also fetches the latest assistant message when the event payload does not include message parts. This should make completion notifications match user settings.',
threshold: 0,
maxLength: 80,
zenModel: 'gpt-5-nano',
mode: 'notification',
});
expect(result.summarized).toBe(false);
expect(result.reason).toBe('Model summarization provider unavailable');
expect(result.summary).toBe('The implementation now correctly loads notification templates before dispatchin…');
});
it('returns local note fallback while provider is unavailable', async () => {
const result = await summarizeText({
text: 'First sentence. Second sentence with the useful insight.',
threshold: 0,
maxLength: 100,
mode: 'note',
});
expect(result).toMatchObject({
summary: 'First sentence.',
summarized: false,
reason: 'Model summarization provider unavailable',
});
});
});