Skip to content

Telegram default_agent not routed and agent model override not persisted #228

@ntamero

Description

@ntamero

Bug Description

Two related issues with fresh install + Telegram channel setup:

1. Telegram messages not routed without default_agent

When Telegram is configured in config.toml with just [channels.telegram] and enabled = true, incoming messages are silently dropped. No error in logs, no response to user.

Fix required: default_agent = "assistant" must be explicitly set, but the dashboard setup wizard does not configure this field.

2. Agent model config from disk not respected after DB agent creation

When an agent is created via the dashboard or API, its model configuration is stored in the database. However, edits to the on-disk agents/assistant/agent.toml (e.g., changing provider from groq to openrouter) are ignored — the DB version takes priority.

This means:

  • Fresh install creates agent templates with provider = "groq" as default
  • User sets OPENROUTER_API_KEY and configures [default_model] as openrouter
  • Dashboard creates agent → stored in DB with groq provider
  • Editing agent.toml on disk has no effect
  • Telegram messages fail with: Missing API key: Set GROQ_API_KEY environment variable for provider 'groq'

Expected Behavior

  • default_agent should be auto-set to "assistant" when Telegram channel is enabled
  • Agent model should respect [default_model] from config.toml if no per-agent override is set
  • Or at minimum, dashboard agent creation should use the configured default provider, not hardcoded groq

Environment

  • OpenFang v0.3.2
  • Ubuntu 24.04
  • OpenRouter provider (only key configured)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions