Problem
Act mode currently routes system prompts with a binary choice: full SYSTEM_PROMPT_ACT vs SYSTEM_PROMPT_ACT_COMPACT (via provider useCompactPrompt + compact/mid/full tool tiers).
TODOs.md §1 documents a deeper issue: small local models need more explicit guidance, not a shorter prompt. The compact prompt strips worked examples and nuance that small models rely on — while still paying the token cost of a large tool schema on mid/full tiers.
Evidence cited in TODOs: qwen3.6-27b trace re-downloading the same files because scratchpad/download state fell out of attention — compact prompt would have made this worse by removing SCRATCHPAD guidance.
Current mismatch:
| User cohort |
What they need |
What they get |
| Frontier cloud (Sonnet, GPT-4o) |
Trimmed rules, trust planning |
Full ~7K prompt |
| Mid local (32B–70B) |
Rules + 1–2 examples per rule |
Full prompt |
| Small local (7B–27B) |
More examples + failure-mode reminders |
Often compact prompt (too thin) OR full prompt (token-heavy) |
Tool tier (compact / mid / full) and prompt tier are orthogonal but today only loosely coupled via useCompactPrompt.
Proposed solution
Introduce three prompt tiers routed in _getActPrompt():
| Tier |
Target models |
Prompt |
Approx size |
frontier |
Sonnet, Opus, GPT-4o, Gemini Pro |
Trim examples, keep rules |
~3K tokens |
mid |
Llama 70B, Qwen 35B, GPT-4o-mini |
Full rules + selective examples |
~5K tokens |
small |
7B–30B local (Ollama, llama.cpp, LM Studio) |
Full rules + more examples + imperative scaffolding |
~6–7K tokens |
Implementation sketch
- Provider config — replace or extend
useCompactPrompt with promptTier: 'frontier' | 'mid' | 'small' (default heuristics: cloud flagship → frontier, OpenRouter mid → mid, local servers → small).
- New prompt bodies in
tools.js (Chrome + Firefox):
SYSTEM_PROMPT_ACT_FRONTIER
- Keep
SYSTEM_PROMPT_ACT as mid default
SYSTEM_PROMPT_ACT_SMALL (expanded, not shrunk — per TODOs analysis)
_getActPrompt() — route by promptTier, not binary compact flag.
- Settings (optional v1) — advanced dropdown “Prompt detail: Auto / Frontier / Mid / Small” overriding heuristic.
- Token budget guard — if
promptTier === 'small' and contextWindow < 12k, warn in verbose mode or auto-compact tools to compact tier.
Verification
Why this matters now
WebBrain is on the Chrome Web Store and Firefox AMO — many new users try local LLMs first. Small-model experience directly drives ratings and “doesn’t work” reports.
Scope
Medium–large (~400–600 lines across prompts + routing + tests + settings). Can be phased:
- Phase 1: tier enum + routing +
SYSTEM_PROMPT_ACT_SMALL authoring + tests
- Phase 2: settings override + context-window coupling
Derived from maintainer engineering TODO §1. Happy to implement if assigned.
Problem
Act mode currently routes system prompts with a binary choice: full
SYSTEM_PROMPT_ACTvsSYSTEM_PROMPT_ACT_COMPACT(via provideruseCompactPrompt+ compact/mid/full tool tiers).TODOs.md§1 documents a deeper issue: small local models need more explicit guidance, not a shorter prompt. The compact prompt strips worked examples and nuance that small models rely on — while still paying the token cost of a large tool schema on mid/full tiers.Evidence cited in TODOs: qwen3.6-27b trace re-downloading the same files because scratchpad/download state fell out of attention — compact prompt would have made this worse by removing SCRATCHPAD guidance.
Current mismatch:
Tool tier (
compact/mid/full) and prompt tier are orthogonal but today only loosely coupled viauseCompactPrompt.Proposed solution
Introduce three prompt tiers routed in
_getActPrompt():frontiermidsmallImplementation sketch
useCompactPromptwithpromptTier: 'frontier' | 'mid' | 'small'(default heuristics: cloud flagship → frontier, OpenRouter mid → mid, local servers → small).tools.js(Chrome + Firefox):SYSTEM_PROMPT_ACT_FRONTIERSYSTEM_PROMPT_ACTas mid defaultSYSTEM_PROMPT_ACT_SMALL(expanded, not shrunk — per TODOs analysis)_getActPrompt()— route bypromptTier, not binary compact flag.promptTier === 'small'andcontextWindow < 12k, warn in verbose mode or auto-compact tools tocompacttier.Verification
npm test— tier routing unit testsWhy this matters now
WebBrain is on the Chrome Web Store and Firefox AMO — many new users try local LLMs first. Small-model experience directly drives ratings and “doesn’t work” reports.
Scope
Medium–large (~400–600 lines across prompts + routing + tests + settings). Can be phased:
SYSTEM_PROMPT_ACT_SMALLauthoring + testsDerived from maintainer engineering TODO §1. Happy to implement if assigned.