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.
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
import { describe, expect, it } from 'vitest';
|
|
|
|
import { prepareNotificationLastMessage, truncateNotificationText } from './message.js';
|
|
|
|
describe('notification message helpers', () => {
|
|
it('truncates oversized notification text', () => {
|
|
expect(truncateNotificationText('abcdef', 3)).toBe('abc...');
|
|
});
|
|
|
|
it('ignores retired summarization settings and truncates original message', async () => {
|
|
const result = await prepareNotificationLastMessage({
|
|
message: '0123456789',
|
|
settings: {
|
|
summarizeLastMessage: true,
|
|
summaryThreshold: 5,
|
|
summaryLength: 3,
|
|
maxLastMessageLength: 4,
|
|
},
|
|
});
|
|
|
|
expect(result).toBe('0123...');
|
|
});
|
|
|
|
it('normalizes markdown message to plain text', async () => {
|
|
const result = await prepareNotificationLastMessage({
|
|
message: "**Committed.**\n\n- Commit: `85924b9d`\n- Message: `fix desktop notifications`",
|
|
settings: {
|
|
maxLastMessageLength: 200,
|
|
},
|
|
});
|
|
|
|
expect(result).toBe('Committed. Commit: 85924b9d Message: fix desktop notifications');
|
|
});
|
|
});
|