Files
openchamber/packages/web/server/lib/tts/routes.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

54 lines
1.5 KiB
JavaScript

import { describe, expect, it } from 'vitest';
import express from 'express';
import request from 'supertest';
import { registerTtsRoutes } from './routes.js';
const createApp = () => {
const app = express();
app.use(express.json());
registerTtsRoutes(app, {
resolveZenModel: async () => 'gpt-5-nano',
sayTTSCapability: null,
});
return app;
};
describe('tts routes', () => {
it('returns local note fallback while model summarization is retired', async () => {
const response = await request(createApp())
.post('/api/text/summarize')
.send({
text: 'First sentence. Second sentence with the useful insight.',
threshold: 0,
maxLength: 100,
mode: 'note',
});
expect(response.status).toBe(200);
expect(response.body).toMatchObject({
summary: 'First sentence.',
summarized: false,
reason: 'Model summarization provider unavailable',
});
});
it('keeps notification fallback behavior without calling zen', async () => {
const response = await request(createApp())
.post('/api/text/summarize')
.send({
text: 'Notification text that should fall back cleanly.',
threshold: 0,
maxLength: 100,
mode: 'notification',
});
expect(response.status).toBe(200);
expect(response.body).toMatchObject({
summary: 'Notification text that should fall back cleanly.',
summarized: false,
reason: 'Model summarization provider unavailable',
});
});
});