feat(ai): per-bot AI persona - a custom /ask system prompt per assistant bot (LC-695) #662
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/LC-695-bot-personas"
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
Gives each assistant bot its own
/askpersona (a custom system prompt), building on LC-693 (which chose which bot the assistant posts as, but left one fixed behavior for all). Implements LC-695.How
/asksystem prompt is nowpersona+ an invariantASSISTANT_RULEShalf (safety refusal, the "answer from the room's context, don't invent facts" contract, formatting).effective_system_prompt(persona)always appends the rules, so a custom persona shapes tone/role but can never remove the safety refusal or the retrieval contract. A blank persona falls back to the default opener (mirrors LC-693's identity fallback).bot_persona:<username>- no schema change, consistent with LC-693'sassistant_bot_username./askonly. Catch-up, recap, triage, and weekly-recap keep their own task-specific prompts (they don't use the assistant persona prompt).effective_assistant_username, which does not lazily create the built-in bot), so a stale client can't write another bot's persona. Site-admin only.Tests
New unit tests: the default prompt still carries the safety/retrieval clauses; a custom persona is applied but cannot drop the envelope; a blank persona falls back to the default.
Scope
routes/assistant.rs(prompt split + composer + persona lookup + non-creating username helper),routes/admin.rs(persona read,POST /admin/bots/persona, route),views/admin.rs(BotsPage.assistant_username/.assistant_persona),templates/admin/bots.html(persona textarea),locales/en+es/admin.ftl. No schema change.Verification
cargo check/cargo clippy --lib: clean.cargo fmt --check: clean.🤖 Generated with Claude Code
https://claude.ai/code/session_011M7CNRsGzgzc48KinZUAQ8