feat(session-anchors): configurable budget scale + research-backed truncation fix

Remove 500-char assistant text truncation in anchor serializer — research
consensus (JetBrains NeurIPS 2025, SWE-agent, OpenDev ACC) is that agent
reasoning must never be truncated; only tool outputs get observation-masked.

Add AnchorBudgetScale type with 4 presets (Small=2K, Medium=6K, Large=12K,
Full=20K) and per-project range slider in SettingsTab. Remove Ollama-specific
warning toast — budget slider handles context limits generically.
This commit is contained in:
Hibryda 2026-03-11 03:03:53 +01:00
parent 64e040ebfe
commit 0d9c473a06
9 changed files with 104 additions and 23 deletions

View file

@ -31,6 +31,7 @@ import { extractWritePaths, extractWorktreePath } from './utils/tool-files';
import { hasAutoAnchored, markAutoAnchored, addAnchors, getAnchorSettings } from './stores/anchors.svelte';
import { selectAutoAnchors, serializeAnchorsForInjection } from './utils/anchor-serializer';
import type { SessionAnchor } from './types/anchors';
import { getEnabledProjects } from './stores/workspace.svelte';
let unlistenMsg: (() => void) | null = null;
let unlistenExit: (() => void) | null = null;
@ -418,7 +419,8 @@ function triggerAutoAnchor(
): void {
markAutoAnchored(projectId);
const settings = getAnchorSettings(projectId);
const project = getEnabledProjects().find(p => p.id === projectId);
const settings = getAnchorSettings(project?.anchorBudgetScale);
const { turns, totalTokens } = selectAutoAnchors(
messages,
sessionPrompt,