fix: add API key/auth token support across all model clients

This commit is contained in:
William Valentin
2026-02-05 10:56:40 -08:00
parent 747a7f44a2
commit f891c7aee8
4 changed files with 52 additions and 7 deletions
+19 -1
View File
@@ -68,10 +68,28 @@ export function createTelegramBot(config: TelegramBotConfig): Bot {
bot.command('status', async (ctx) => {
const pending = hookEngine?.getPendingConfirmations() ?? [];
const statusMsg = `Flynn is running.\nPending confirmations: ${pending.length}`;
const currentTier = config.agent.getModelTier();
const tierDisplay = currentTier === 'local' ? '🏠 Local (Qwen)' : '☁️ Cloud (Claude)';
const statusMsg = `Flynn is running.\nModel: ${tierDisplay}\nPending confirmations: ${pending.length}`;
await ctx.reply(statusMsg);
});
bot.command('local', async (ctx) => {
config.agent.setModelTier('local');
await ctx.reply('🏠 Switched to local model (Qwen 2.5 14B)');
});
bot.command('cloud', async (ctx) => {
config.agent.setModelTier('default');
await ctx.reply('☁️ Switched to cloud model (Claude Opus 4.5)');
});
bot.command('model', async (ctx) => {
const currentTier = config.agent.getModelTier();
const tierDisplay = currentTier === 'local' ? '🏠 Local (Qwen 2.5 14B)' : '☁️ Cloud (Claude Opus 4.5)';
await ctx.reply(`Current model: ${tierDisplay}\n\nCommands:\n/local - Switch to local model\n/cloud - Switch to cloud model`);
});
// Message handler
bot.on('message:text', async (ctx) => {
const text = ctx.message.text;