Files
llama.cpp/tools/ui/tests/unit/agentic-max-turns-default.test.ts
T
Aleksander Grygier fd55cb98fe fix(ui): take the agentic turns default from DEFAULT_AGENTIC_CONFIG (#30582)
The registry hard-coded 10 for AGENTIC_MAX_TURNS while DEFAULT_AGENTIC_CONFIG
said 100. The registry seeds SETTING_CONFIG_DEFAULT, so the loop's
`|| DEFAULT_AGENTIC_CONFIG.maxTurns` fallback never fires and users got 10
turns. Reference the shared constant, as the adjacent MCP timeout does.

Assisted by: llama-ui (ggml-org/Qwen3.8-Flash-Next:IQ4_NL)
2026-10-15 12:36:06 +02:00

19 lines
746 B
TypeScript

import { DEFAULT_AGENTIC_CONFIG, SETTINGS_KEYS } from '$lib/constants';
import { describe, expect, it } from 'vitest';
/**
* The registry `defaultValue` is the effective default: the store seeds its
* config from SETTING_CONFIG_DEFAULT, so the loop's
* `Number(setting) || DEFAULT_AGENTIC_CONFIG.maxTurns` fallback never fires.
* Once these disagreed (10 vs 100) and the loop silently stopped early.
*/
describe('AGENTIC_MAX_TURNS default value', () => {
it('sources the settings default from DEFAULT_AGENTIC_CONFIG.maxTurns', async () => {
const { SETTING_CONFIG_DEFAULT } = await import('$lib/constants');
expect(SETTING_CONFIG_DEFAULT[SETTINGS_KEYS.AGENTIC_MAX_TURNS]).toBe(
DEFAULT_AGENTIC_CONFIG.maxTurns
);
}, 15000);
});