Redstone now hits OpenRouter's `openrouter/free` auto-router first,
falling back to direct Gemini if the OpenRouter call fails (no key,
network error, or `:free` upstream rejected tool use). The auto-
router filters its free-model pool by the request's tool-calling
requirement, so we don't have to pin a specific free model.
- bot/bot.ts:
- OPENROUTER_API_KEY / _FILE env (mirrors GEMINI_API_KEY_FILE)
- OPENROUTER_MODEL defaults to "openrouter/free"
- openRouterTools[] derived from existing geminiFunctionDeclarations
(OpenAI-style {type:"function", function:{name,description,parameters}})
- callOpenRouterOnce + runRedstoneTurnViaOpenRouter (parses JSON-string
tool_calls.arguments, replies with role:"tool" + tool_call_id)
- Existing Gemini path moved into runRedstoneTurnViaGemini
- runRedstoneTurn dispatches OpenRouter first, Gemini on null
- Early-return gate now passes if either key is configured
- docker-compose.yml:
- new openrouter_token secret -> ./openrouter.token (gitignored)
- OPENROUTER_API_KEY_FILE + OPENROUTER_MODEL env wired to the bot
- .gitignore: add openrouter.token (plus pre-existing gitea.token entry
that was sitting uncommitted).
The key file itself is NOT committed (verified via git check-ignore).
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
71 KiB
71 KiB