Why
PR #172 fixed the worst observed small-model failure modes (composite namespace/name 404 loops, idle screen), but the prompts have still never been tuned against measured results — the #69 harness landed after the prompt wording did, and no eval-driven prompt iteration has happened since. The wording in agent/prompts.py is best-effort, not evidence-backed.
Industry check (verified 2026-08, across aider, Cline, OpenHands, smolagents, Goose, RA.Aid, Continue.dev, opencode): no product maintains separate per-model system prompts. The dominant pattern is one shared prompt template plus per-model settings (tool-call format, temperature, capability flags) — aider's model-settings.yml is the clearest expression. korvid's full/small capability-profile design (#71) is already the right architecture; what's missing is closing the loop between eval failures and prompt wording.
What
An eval-driven prompt optimization pass, measured before/after on the #69 harness with the bundled 24-scenario pack (≥3 reps), against at least two small models (e.g. qwen3:4b, qwen3:8b — current BFCL open-weight FC leaders at these sizes).
- Baseline: run
python -m korvid.evals --profile small (and full on the larger model) per model; commit the reports as the "before" numbers.
- Failure-mode analysis: classify failed runs from the event streams — wrong tool, wrong arguments, gave up early, answered without evidence, misdiagnosis keyword, iteration exhaustion.
- Targeted prompt edits in
agent/prompts.py (SMALL_SYSTEM_PROMPT, SMALL_TOOL_DESCRIPTIONS, and the shared clauses where evidence points there), one failure mode at a time. Candidate levers, each only if the eval shows the failure:
- worked-example coverage (the single OOM example may over-anchor answers toward OOM),
- explicit stop-condition wording ("answer once the evidence names the cause; do not keep exploring"),
- negative-control handling ("say the resource is healthy when checks pass" — the pack has 3 healthy scenarios),
diagnose_pod-first routing strength.
- After: re-run the same matrix; a change lands only with a non-regressing overall success rate and an improved target metric. Numbers go into the PR description and the scoreboard (companion issue).
Invariants
Out of scope
- Per-model prompt files (anti-pattern per the industry check; capability tiers are the unit of prompt variation).
- New profile tiers or automatic capability detection (revisit only if the eval shows the two-tier split is insufficient).
- Tool-format fallbacks for models without native tool calling (e.g. Gemma 3) — separate concern, needs its own design.
Why
PR #172 fixed the worst observed small-model failure modes (composite
namespace/name404 loops, idle screen), but the prompts have still never been tuned against measured results — the #69 harness landed after the prompt wording did, and no eval-driven prompt iteration has happened since. The wording inagent/prompts.pyis best-effort, not evidence-backed.Industry check (verified 2026-08, across aider, Cline, OpenHands, smolagents, Goose, RA.Aid, Continue.dev, opencode): no product maintains separate per-model system prompts. The dominant pattern is one shared prompt template plus per-model settings (tool-call format, temperature, capability flags) — aider's
model-settings.ymlis the clearest expression. korvid's full/small capability-profile design (#71) is already the right architecture; what's missing is closing the loop between eval failures and prompt wording.What
An eval-driven prompt optimization pass, measured before/after on the #69 harness with the bundled 24-scenario pack (≥3 reps), against at least two small models (e.g. qwen3:4b, qwen3:8b — current BFCL open-weight FC leaders at these sizes).
python -m korvid.evals --profile small(andfullon the larger model) per model; commit the reports as the "before" numbers.agent/prompts.py(SMALL_SYSTEM_PROMPT,SMALL_TOOL_DESCRIPTIONS, and the shared clauses where evidence points there), one failure mode at a time. Candidate levers, each only if the eval shows the failure:diagnose_pod-first routing strength.Invariants
tests/agent/pin any new behavioral wording.Out of scope