Paul Kloppers aae9ddd429 feat(redstone): /model picker (OpenRouter) + fix /clear leaving its own reply
Two changes:

1) /model — admin-only Telegram command that fetches GET
   https://openrouter.ai/api/v1/models, filters to models whose
   supported_parameters includes "tools", pins openrouter/free and
   openrouter/auto to the top, then sorts the rest free-first /
   alpha-by-name. Renders a vertically-stacked InlineKeyboard
   (one model per row, capped at 20) with badges:

      <current>   🟢 free / 💰 paid   🛠 tools   🧠 thinking

   Tap-to-select callback writes the model id into the new
   settings(key,value) table. callOpenRouterOnce resolves the
   model at every call (currentOpenRouterModel() → kvGet ??
   OPENROUTER_MODEL env ?? "openrouter/free"), so the new pick
   takes effect on the very next message — no restart, no
   container rebuild.

2) /clear — was leaving its own confirmation message ("🧹 cleared
   N messages from this chat.") in the DB, so the next /clear
   would count it. Now wipes once, replies, wipes again — the
   chat's messages row count truly stays at 0 across repeats.

Schema migration: CREATE TABLE IF NOT EXISTS settings(key, value,
updated_at) — idempotent, no Bun migration needed.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-14 00:00:08 +02:00
2026-05-11 21:51:59 +02:00
2026-04-21 20:33:22 +02:00
Description
No description provided
611 KiB
2026-05-14 21:39:15 +02:00
Languages
TypeScript 96.7%
Shell 2.6%
Dockerfile 0.7%