8 Commits

Author SHA1 Message Date
d785091d64 Typed chat: hosted free models, then the local model, nothing else; busy reply + Retry; llama-server watchdog
- Remove the keyword-rules agent from typed chat: fallback_agent, parse_look_command (+ tables), the copy-edit parser
  and _rules_check are gone. If every model fails: 'The assistant is busy, please try again in a moment.' with a Retry
  button (agent 'unavailable', no actions). Clicks, forms and payments stay deterministic (fallback_event); the landing
  view is a deterministic featured-listings panel; the Sell button opens the empty form.
- Local model via llama.cpp llama-server directly (ops/local-llm-watchdog.sh, loopback only, restart on exit/hang,
  crash backoff, log rotation; deploy.sh ensures it runs). Lean: no vision projector, no weight repack (mmapped), ctx
  6144, 1 slot, q8 KV, 6 threads at nice 10, poll 0, 1 GiB prompt cache. Idle 0% CPU, 2.9 GB RSS (0.6 GB private).
- Local requests use a JSON GBNF grammar, worked examples in the cached system prompt, and a labelled visitor message.
  10/10 correct on the real prompt, warm 4-13 s.
- Primer re-primes after a model-server restart (llama-server /metrics counter) and otherwise stays idle.
- Fix: hosted calls kept the Authorization header off when a local model was configured (cfg['local'] is a dict on
  hosted configs); now only the local server itself skips the key. Test added.
- Badge/chat header: 'AI: busy', 'AI: quota used up', 'AI: unavailable'; no 'built-in'/'checked by rules' texts.
- Tests: proxy checks expect the busy reply (never rules), clicks still work while busy, no-model server, local grammar/
  prompt/no key; browser checks for busy + Retry; e2e_http accepts busy for typed turns unless REQUIRE_LLM=1;
  test_copyedit.py replaced by test_copy_defaults.py; README updated.
2026-10-08 21:58:41 +08:00
55cccc4d9a Local backup model (Ollama, gemma3:4b): hosted chain -> local model -> keyword rules; own timeout, straight to local while the daily quota is used up, quota stop persisted; honest 'Local model' badge; mock + browser tests; watchdog script 2026-10-08 21:11:57 +08:00
89f18c27ef README: React frontend structure, build/deploy, adding a component; theme_check fail-closed customCss check 2026-10-08 19:49:25 +08:00
b30f8ef1e2 Tests for the React DOM: SPA shell + bundle, compare bar, chat popup, persistence, hostile stored theme, fake-model browser suite; deploy AM_EXTRA_ENV 2026-10-08 19:47:39 +08:00
9853c39ef0 Readability scrim behind page text on high-variance gradients 2026-10-08 19:40:24 +08:00
f91dd9df43 Keep page-level text readable on gradients/patterns; test fixes 2026-10-08 19:39:41 +08:00
b396a01bc4 Rule-based look commands for when the model is unavailable; daily-quota-aware cooldown; honest badge when the built-in agent answers; theme tests 2026-10-08 19:39:02 +08:00
2e10619b95 Agent controls the whole look: validated theme spec (tokens, presets, layout, copy, sections, chat), sanitised scoped customCss, protected banner/badge/fee panels with guaranteed contrast, per-browser theme, no ids in replies 2026-10-08 19:37:27 +08:00