Files
Maurice 123e27643d feat(assistant): one AI tile for assistant, parsing and MCP, a planner-aware chat
The three AI addons share one tile in the integration column; a dialog holds
the connection, the assistant's limits and AI parsing, which now reads with
the assistant's connection unless an install keeps its own. Existing parsing
configs stay where they are and keep winning.

The chat sees the map on screen, offers next questions under an answer,
shows its live step in the window head, previews waiting changes inside the
day list, checks whether a day still works, folds a multi-day plan into a
week grid, keeps per-trip notes and can estimate costs. An empty or cut-off
answer gets one push instead of ending silently, and the assistant's own
step and size limits are raised.
2026-10-22 21:30:26 +00:00

29 lines
1.3 KiB
TypeScript

import { prepareLlmAddonConfigForWrite } from '../../../../src/nest/llm-parse/llm-config';
import { describe, it, expect } from 'vitest';
describe('prepareLlmAddonConfigForWrite: the vision setting', () => {
it('stores a known mode as sent', () => {
for (const vision of ['auto', 'on', 'off']) {
expect(prepareLlmAddonConfigForWrite({ provider: 'local', vision }, undefined).vision).toBe(vision);
}
});
it('stores anything else as auto, so the resolver never meets a value it cannot read', () => {
expect(prepareLlmAddonConfigForWrite({ vision: 'maybe' }, undefined).vision).toBe('auto');
expect(prepareLlmAddonConfigForWrite({ vision: true }, undefined).vision).toBe('auto');
});
it('adds no vision key to a config that sent none', () => {
expect(prepareLlmAddonConfigForWrite({ provider: 'openai', model: 'm' }, undefined)).not.toHaveProperty('vision');
});
});
describe('prepareLlmAddonConfigForWrite: back on the shared connection', () => {
it('LLMCFG-SHARED-001: a config without a provider keeps no key, neither sent nor stored', () => {
const stored = { provider: 'anthropic', model: 'm', apiKey: 'enc:old' };
expect(prepareLlmAddonConfigForWrite({ vision: 'on' }, stored)).toEqual({ vision: 'on' });
expect(prepareLlmAddonConfigForWrite({ apiKey: 'sk-new' }, stored)).toEqual({});
});
});