feat(ai): let an admin pick which bot the AI assistant posts as (LC-693) #660
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-693-pick-assistant-bot"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Adds an admin control to choose which bot the AI assistant posts as. Fixes LC-693.
Before:
/askanswers (and catch-up summaries, post-call recaps, triage, weekly recap) always posted as the hard-codedassistantbot. Creating a second bot (standup-bot) on Admin > Bots had no effect on the assistant, and the page never said which bot the assistant uses.How
assistant_bot_username.routes::assistant::assistant_bot()(the single resolver every assistant surface shares) reads it first: when it names an existing, active bot, the assistant posts as that bot; unset / renamed / disabled falls through to the built-inassistant(still lazily created), so a stale setting never breaks the assistant./askwith no restart, same pattern as thellm_enabledkill switch.POST /admin/bots/assistant, plus an "AI assistant" pill on whichever bot row is currently selected. Selecting the default clears the setting; picking a bot validates it is a real, active bot first.Bot API-token scopes are irrelevant here - the assistant posts internally via
finalize_message_send, not through the bot's token - so any bot account can be the identity; only the displayed name/avatar changes.Template stays comparison-free: the selected/active bot is resolved in the handler (
BotRowView.is_assistant), matching the LC-683 pattern.Scope
routes/assistant.rs(setting key + resolver),routes/admin.rs(read setting, POST handler, route),views/admin.rs(BotRowView.is_assistant,BotsPage.assistant_bot),templates/admin/bots.html(selector card + row pill),locales/en+es/admin.ftl(6 strings each). No schema change, no new CSS.Verification
cargo check/cargo clippy --lib: clean.cargo fmt --check: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_011M7CNRsGzgzc48KinZUAQ8