managarten/packages/shared-llm/src
Till JS cf9f4ecd52 fix(llm): per-task tier override bypasses global allowedTiers gate
Bug: setting taskOverrides['companion.chat'] = 'byok' didn't work
when the user's allowedTiers was empty/['none']. The tier-too-low
check in run() compared task.minTier ('browser') against userMaxTier
('none') and threw TierTooLowError before the override was even read.

Same issue in canRun() and candidateTiers().

Fix: when a per-task override exists, treat it as opt-in to that tier
even if not in the global allowedTiers. The override is the user's
explicit per-task signal — overriding the global default is exactly
what an override is for.

- run(): effectiveMaxTier = max(override, userMaxTier)
- candidateTiers(task, override): adds override to baseTiers
- canRun(): now passes the override to candidateTiers

The Companion chat now correctly uses BYOK when selected from the
toolbar, even if the user hasn't enabled BYOK in their global LLM
settings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-14 16:19:50 +02:00
..
backends test(byok): add 35 unit tests + update docs to as-built status 2026-04-14 15:23:03 +02:00
errors.ts fix(mana/web): unwrap $state proxy in workbench-scenes Dexie writes 2026-04-09 00:44:00 +02:00
index.ts feat(llm): add BYOK tier + 4 provider adapters (OpenAI, Anthropic, Gemini, Mistral) 2026-04-14 15:06:48 +02:00
orchestrator.ts fix(llm): per-task tier override bypasses global allowedTiers gate 2026-04-14 16:19:50 +02:00
pricing.test.ts test(byok): add 35 unit tests + update docs to as-built status 2026-04-14 15:23:03 +02:00
pricing.ts feat(llm): add BYOK tier + 4 provider adapters (OpenAI, Anthropic, Gemini, Mistral) 2026-04-14 15:06:48 +02:00
queue.ts feat(shared-llm): Phase 4 — persistent LLM task queue 2026-04-09 01:51:20 +02:00
store.svelte.ts fix: dev startup — Redis eviction policy, mana-media port crash, Svelte warnings 2026-04-10 18:33:41 +02:00
task.ts fix(mana/web): unwrap $state proxy in workbench-scenes Dexie writes 2026-04-09 00:44:00 +02:00
tiers.ts feat(llm): add BYOK tier + 4 provider adapters (OpenAI, Anthropic, Gemini, Mistral) 2026-04-14 15:06:48 +02:00
types.ts fix(mana/web): unwrap $state proxy in workbench-scenes Dexie writes 2026-04-09 00:44:00 +02:00