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.
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest';
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import express from 'express';
|
||||
import request from 'supertest';
|
||||
|
||||
@@ -15,17 +15,7 @@ const createApp = () => {
|
||||
};
|
||||
|
||||
describe('tts routes', () => {
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals();
|
||||
});
|
||||
|
||||
it('retries note summarization with notification mode before failing', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn(async () => ({
|
||||
ok: false,
|
||||
status: 503,
|
||||
json: async () => ({ error: 'unavailable' }),
|
||||
})));
|
||||
|
||||
it('returns local note fallback while model summarization is retired', async () => {
|
||||
const response = await request(createApp())
|
||||
.post('/api/text/summarize')
|
||||
.send({
|
||||
@@ -35,54 +25,15 @@ describe('tts routes', () => {
|
||||
mode: 'note',
|
||||
});
|
||||
|
||||
expect(response.status).toBe(502);
|
||||
expect(fetch).toHaveBeenCalledTimes(2);
|
||||
expect(response.body).toEqual({
|
||||
error: 'Note summarization failed',
|
||||
reason: 'zen API returned 503',
|
||||
});
|
||||
});
|
||||
|
||||
it('uses notification summarizer result when note mode falls back', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn()
|
||||
.mockResolvedValueOnce({
|
||||
ok: false,
|
||||
status: 503,
|
||||
json: async () => ({ error: 'unavailable' }),
|
||||
})
|
||||
.mockResolvedValueOnce({
|
||||
ok: true,
|
||||
json: async () => ({
|
||||
output: [{
|
||||
type: 'message',
|
||||
content: [{ type: 'output_text', text: '**Keep provider state stable** during streaming.' }],
|
||||
}],
|
||||
}),
|
||||
}));
|
||||
|
||||
const response = await request(createApp())
|
||||
.post('/api/text/summarize')
|
||||
.send({
|
||||
text: 'First sentence. Preserve provider state references during streaming to avoid wide rerenders.',
|
||||
threshold: 0,
|
||||
maxLength: 100,
|
||||
mode: 'note',
|
||||
});
|
||||
|
||||
expect(response.status).toBe(200);
|
||||
expect(response.body).toMatchObject({
|
||||
summary: 'Keep provider state stable during streaming.',
|
||||
summarized: true,
|
||||
summary: 'First sentence.',
|
||||
summarized: false,
|
||||
reason: 'Model summarization provider unavailable',
|
||||
});
|
||||
});
|
||||
|
||||
it('keeps notification fallback behavior', async () => {
|
||||
vi.stubGlobal('fetch', vi.fn(async () => ({
|
||||
ok: false,
|
||||
status: 503,
|
||||
json: async () => ({ error: 'unavailable' }),
|
||||
})));
|
||||
|
||||
it('keeps notification fallback behavior without calling zen', async () => {
|
||||
const response = await request(createApp())
|
||||
.post('/api/text/summarize')
|
||||
.send({
|
||||
@@ -96,7 +47,7 @@ describe('tts routes', () => {
|
||||
expect(response.body).toMatchObject({
|
||||
summary: 'Notification text that should fall back cleanly.',
|
||||
summarized: false,
|
||||
reason: 'zen API returned 503',
|
||||
reason: 'Model summarization provider unavailable',
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user