feat(discord): add listen_to_bots config and fix model IDs across codebase (#280)

* fix(config): apply env overrides at runtime and fix Docker compose defaults

- Call apply_env_overrides() after Config::load_or_init() in main.rs so
  environment variables (API_KEY, PROVIDER, ZEROCLAW_GATEWAY_PORT, etc.)
  are actually applied at runtime, not just in tests
- Add ZEROCLAW_ALLOW_PUBLIC_BIND env var support for gateway bind policy
- Fix docker-compose.yml: correct volume path (/zeroclaw-data not /data),
  add ZEROCLAW_ALLOW_PUBLIC_BIND=true for container networking, make host
  port configurable via HOST_PORT env var
- Add docker-compose.override.yml to .gitignore for local dev overrides

* feat(discord): add listen_to_bots config and fix model IDs across codebase

Add listen_to_bots field to DiscordConfig so bot messages are processed
when explicitly enabled (defaults to false for backward compat). Remove
ZEROCLAW_MODEL from Dockerfile release stage so config.toml is the
source of truth for model selection. Fix all hardcoded model IDs from
the dated anthropic/claude-sonnet-4-20250514 to the valid OpenRouter
identifier anthropic/claude-sonnet-4.
This commit is contained in:
Vernon Stinebaker 2026-02-16 15:13:36 +08:00 committed by GitHub
parent d5e8fc1652
commit 40c41cf3d2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 34 additions and 25 deletions

View file

@ -406,7 +406,7 @@ fn default_model_for_provider(provider: &str) -> String {
"groq" => "llama-3.3-70b-versatile".into(),
"deepseek" => "deepseek-chat".into(),
"gemini" | "google" | "google-gemini" => "gemini-2.0-flash".into(),
_ => "anthropic/claude-sonnet-4-20250514".into(),
_ => "anthropic/claude-sonnet-4".into(),
}
}
@ -689,7 +689,7 @@ fn setup_provider() -> Result<(String, String, String)> {
let models: Vec<(&str, &str)> = match provider_name {
"openrouter" => vec![
(
"anthropic/claude-sonnet-4-20250514",
"anthropic/claude-sonnet-4",
"Claude Sonnet 4 (balanced, recommended)",
),
(
@ -1378,6 +1378,7 @@ fn setup_channels() -> Result<ChannelsConfig> {
bot_token: token,
guild_id: if guild.is_empty() { None } else { Some(guild) },
allowed_users,
listen_to_bots: false,
});
}
2 => {