Public Access
docs: Sprint 16 — fix kimi-k2.6:cloud latent bug across all 6 running docs
Sprint 16 (commit 25e29c7) is a 2-line fix that switches
OLLAMA_MODEL from kimi-k2.6:cloud to gpt-oss:20b and bumps
max_tokens from 800 to 4000. The Sprint 13 LLM endpoint has
returned picked_count=0 silently since 2026-06-05 because
kimi-k2.6 is a reasoning model that burns the token budget
on internal reasoning and never produces the JSON answer.
The library fill (Sprint 6+) silently took over. Discovered
while answering the user's "is there anything else to refine?"
question.
Live verification: 5/5 test weeks return picked_count 15-21
(was 0/5 before). 11/11 vitest cases pass (4 new from S16 +
7 from S14). npm run build green. No new runtime deps. No
schema change. No UI change.
This commit updates the 6 running docs that track sprints:
- .agent/plan.md — Sprint 16 section (S16.1-S16.4 + Done
when + Out of scope) added after the Sprint 15 sections.
Documents the diagnosis (kimi-k2.6 reasoning model), the
fix (gpt-oss:20b + max_tokens=4000), the 4-case Vitest
contract test, and the live verification commands.
- .agent/context.md — Sprint 16 decisions (D1-D5), open Q1,
and file:line references added.
- Review/sprint16-verification.md — NEW: full diagnosis +
2-line fix + 4-test contract + live verification (5/5
test weeks return picks, table) + 5-risk table + 4
follow-up tickets.
- Review/ui-nielsen-audit.md — Sprint 16 status block added
after the Sprint 15 Round 3 block.
- fix-ui-audit.md — Sprint 16 section (T9.1-T9.5) added
after the Sprint 15 section. T9.1 documents the 2-line
fix in detail (config.py + llm_plan.py + .env). T9.5
surfaces 3 follow-up tickets.
- Review/handoff-ui-audit.md — Batch L line in the deploy
list, Sprint 16 section after the Sprint 15 section, TL;DR
Sprint 16 line, Last-updated footer updated.
- docs/HANDOFF.md — Sprint 16 section after Sprint 15, Last-
updated footer updated. Notes the corrected model choice
and the 4 follow-up tickets.
All 6 docs now reflect Sprint 16. The Sprint 13 LLM endpoint
now works as designed. Every future "Ask the LLM" click
will actually use the LLM to pick meals from the 77-recipe
library (was silently using the library fill instead). The
_ask_llm helper is still the single F9-full seam.
This commit is contained in:
@@ -24,7 +24,8 @@ If you are a new agent continuing this work, do this **in order**:
|
||||
- **Batch I:** Sprint 13 (one `git pull`, `docker compose up -d --build backend frontend` — backend has the new `llm_plan.py` router, frontend has the new prompt modal).
|
||||
- **Batch J:** Sprint 14 (one `git pull`, `npm install` in `frontend/`, `npm test` to confirm 7/7, then `docker compose up -d --build frontend` — no backend change, no migration; the 5 new devDeps land on `npm install`).
|
||||
- **Batch K:** Sprint 15 (one `git pull`, `docker compose up -d --build backend frontend` — backend picks up the `main.py` mount-order fix; the 18 new recipes are already in the DB; frontend has no changes).
|
||||
4. **Open issues** in `.agent/plan.md` (the "Phase R1-R3" section is a prior plan; the **Sprint 15 active-sprint** section is the current state) and in `.agent/context.md` (decisions + open Qs for the current sprint).
|
||||
- **Batch L:** Sprint 16 (one `git pull`, `docker compose up -d --build backend frontend` — backend picks up the OLLAMA_MODEL switch (kimi-k2.6:cloud → gpt-oss:20b) and max_tokens bump (800 → 4000); the new llm.test.ts Vitest contract test runs at `npm test`. No frontend rebuild strictly required, but the .env / docker-compose env must also have `OLLAMA_MODEL=gpt-oss:20b`).
|
||||
4. **Open issues** in `.agent/plan.md` (the "Phase R1-R3" section is a prior plan; the **Sprint 16 active-sprint** section is the current state) and in `.agent/context.md` (decisions + open Qs for the current sprint).
|
||||
5. **Do not** touch the pre-existing WIP files: `backend/app/api/recipes.py`, `backend/app/schemas/recipe.py`, `nginx/nginx.conf` (untouched since before this work; user's to manage).
|
||||
6. **When you commit,** use the `fix(ui):`, `feat(ui):`, `refactor(frontend):`, `docs(review):` Conventional Commit style. Force-add new files in `frontend/src/lib/` (the `.gitignore` line 17 `lib/` is a pre-existing bug that catches it).
|
||||
|
||||
@@ -36,6 +37,7 @@ If you are a new agent continuing this work, do this **in order**:
|
||||
- **Sprint 15 (Seed 50 family-friendly recipes + Sprint 12 latent-bug fix) code complete on 2026-06-06.** 18 Spoonacular recipes imported (free-tier 50-pt cap hit; remaining 32 to be seeded on later days). DB went 31 → 49 total recipes. LLM test for week 2026-07-06: `picked_count=0 / filled_count=19 / failed_count=2` (library fill covered 19/21 slots). Sprint 12 latent-bug fix: `main.py` mount order. Awaiting commit + push.
|
||||
- **Sprint 15 Round 2 (2026-06-07):** +18 recipes via `scripts/seed_recipes_round2.py`. Library at 67 total. LLM test for week 2026-07-20: `picked_count=0 / filled_count=21 / failed_count=0` (library now covers all 21 slots of a week). Awaiting commit + push.
|
||||
- **Sprint 15 Round 3 (2026-06-07):** +10 recipes via re-running `scripts/seed_recipes.py` (idempotent — skipped 37 duplicates). Library at 77 total. LLM test for week 2026-08-03: `picked_count=0 / filled_count=21 / failed_count=0`. **Library well past the 4-week coverage threshold.** Awaiting commit + push.
|
||||
- **Sprint 16 (Fix Sprint 13 LLM-model latent bug) code complete on 2026-06-08.** Discovered while answering "is there anything else to refine?" — every `/api/llm/plan` call has returned `picked_count=0` since 2026-06-05 because `kimi-k2.6:cloud` is a reasoning model that burns the `max_tokens` budget on internal `reasoning`. Library fill (Sprint 6+) silently took over. Two-line fix: switch `OLLAMA_MODEL` to `gpt-oss:20b`; bump `max_tokens` to 4000. + `frontend/src/api/llm.test.ts` (4 cases). Live verification: 5/5 test weeks return `picked_count` 15-21 (was 0/5 before). Awaiting commit + push.
|
||||
- Pre-existing repo issues: 1 failing test (`test_filter_blocks_by_cost` — verified pre-Sprint 8), `.gitignore` `lib/` bug, no CI. Documented.
|
||||
|
||||
---
|
||||
@@ -171,6 +173,23 @@ If you are a new agent continuing this work, do this **in order**:
|
||||
|
||||
**Sprint 15 Round 3 (2026-06-07):** +10 recipes via re-running `scripts/seed_recipes.py` (idempotent — skipped 37 duplicates; picked up cap-blocked Asian + American queries from round 1). Library at 77 total. Imports: 2 Asian leftovers (Pho With Zucchini Noodles, Kung Pao Chicken With Peanuts) + 8 American comfort dishes (Superbowl Chili, Veggie Meatloaf, Crab Mac and Cheese, BBQ Chicken, Classic Pot Roast, Lean Shepherd's Pie, Amazing Chicken Pot Pie, Slow Cooker Beef Stew). LLM test for week 2026-08-03: `picked_count=0 / filled_count=21 / failed_count=0`. **Library well past the 4-week coverage threshold (77 unique vs 84 picks needed).** Tracking: appended to `Review/sprint15-verification.md`.
|
||||
|
||||
### Sprint 16 — Fix Sprint 13 LLM-model latent bug (kimi-k2.6:cloud → gpt-oss:20b) (user-driven)
|
||||
|
||||
**Status: CODE COMPLETE on 2026-06-08. 11/11 tests green (4 new + 7 from S14). `npm run build` green. Live verification: 5/5 test weeks return `picked_count` 15-21 (was 0/5 before). Awaiting user commit + push.** No migration, no schema change, no new runtime dep.
|
||||
|
||||
**Root cause (one-liner):** Sprint 13 set `OLLAMA_MODEL=kimi-k2.6:cloud` (a reasoning model). kimi-k2.6 burns the entire `max_tokens=800` budget on internal `reasoning` and returns `content=''` (empty) for the Sprint 13 prompt. The library fill (Sprint 6+) silently took over every call. Every "Ask the LLM" click since 2026-06-05 paid Ollama costs for nothing.
|
||||
|
||||
**Scope (3 boxes):**
|
||||
1. **`backend/app/config.py:38`** — `OLLAMA_MODEL: str = "gpt-oss:20b"` (was `kimi-k2.6:cloud`). gpt-oss:20b is OpenAI's open-source 20B non-reasoning model. Same `chat/completions` endpoint, same `messages` format, no API change needed.
|
||||
2. **`backend/app/api/llm_plan.py:117`** — `max_tokens: 4000` (was 800). 21 picks × ~100 chars + reasoning + boilerplate ≈ 2100+ chars. 4000 gives 2x headroom.
|
||||
3. **`backend/.env`** (or `docker-compose` env) — `OLLAMA_MODEL=gpt-oss:20b`. Pydantic settings read env first, so the `.env` change is what actually fixed the running container. The `config.py` default is a backup for new deploys.
|
||||
|
||||
Plus `frontend/src/api/llm.test.ts` (NEW, 4 cases) — Vitest contract test on the LLM response shape. Locks `plan_id` (UUID), `picked_count` / `filled_count` / `failed_count` (non-negative integers summing to ≤ 21), and `reasoning` (string|null). Catches response-shape regressions so a future model swap that breaks the JSON contract is caught at `npm test` time.
|
||||
|
||||
**No pre-existing WIP files touched.** No new runtime dependencies. No schema change. No UI change.
|
||||
|
||||
**Tracking docs:** `Review/sprint16-verification.md` (full diagnosis + 2-line fix + live verification + 5-risk table + 4 follow-up tickets), `Review/ui-nielsen-audit.md` Sprint 16 status block, `fix-ui-audit.md` T9.1-T9.5, this file, `docs/HANDOFF.md` Sprint 16 section.
|
||||
|
||||
### Sprint 7 — Fix webui "empty meal plan" (date-semantics mismatch)
|
||||
|
||||
**Status: COMMITTED `09c7525` on 2026-06-05. Build green.** Awaiting user to `git pull` + run the SQL fix + rebuild.
|
||||
@@ -448,4 +467,4 @@ cd frontend && npm run build
|
||||
|
||||
Trust the build output. Trust the smoke checklist. Don't trust the deployment host's UI until the user confirms. The verification model is "I shipped, you verified, you reported, I fixed" — the agent in this role never sees the live UI directly.
|
||||
|
||||
**Last updated: 2026-06-06** — Sprint 1 deployed; Sprints 2-6 awaiting user deploy; **Sprint 7 (`09c7525`), Sprint 8 (`efd1fc6`), Sprint 9 (F1 Onboarding Tour) + post-deploy fix (`1562929`), Sprint 10 (Deny Forever on Recipes), Sprint 11 (Wire the dead "Generate Meal Plan" CTA), Sprint 12 (F8 Spoonacular search), and Sprint 13 (F9-lite Ollama Cloud plan synthesis) committed on 2026-06-05, awaiting user deploy; Sprint 14 (Vitest for `useOnboarding`) committed on 2026-06-05, awaiting user push; Sprint 15 (Seed 50 family-friendly recipes + Sprint 12 latent-bug fix) code complete on 2026-06-06, 18 recipes imported, awaiting user commit + push**. See the "How to take over" and "Pending user deploy" sections at the top of this file.
|
||||
**Last updated: 2026-06-08** — Sprint 1 deployed; Sprints 2-6 awaiting user deploy; **Sprint 7 (`09c7525`), Sprint 8 (`efd1fc6`), Sprint 9 (F1 Onboarding Tour) + post-deploy fix (`1562929`), Sprint 10 (Deny Forever on Recipes), Sprint 11 (Wire the dead "Generate Meal Plan" CTA), Sprint 12 (F8 Spoonacular search), and Sprint 13 (F9-lite Ollama Cloud plan synthesis) committed on 2026-06-05, awaiting user deploy; Sprint 14 (Vitest for `useOnboarding`) committed on 2026-06-05, awaiting user push; Sprint 15 (Seed 50 family-friendly recipes + Sprint 12 latent-bug fix) code complete on 2026-06-06, 18 recipes imported, awaiting user commit + push; Sprint 15 Round 2 (committed 2026-06-07, awaiting user push) +18 recipes; Sprint 15 Round 3 (committed 2026-06-07, awaiting user push) +10 recipes; library at 77 total; **Sprint 16 (code complete 2026-06-08, awaiting user commit + push) — switches `OLLAMA_MODEL` from `kimi-k2.6:cloud` to `gpt-oss:20b` + bumps `max_tokens` to 4000; 11/11 tests green; live 5/5 test weeks return `picked_count` 15-21 (was 0/5 before)**. See the "How to take over" and "Pending user deploy" sections at the top of this file.
|
||||
|
||||
Reference in New Issue
Block a user