feat(agents): multi-agent personas with per-agent identity and memory#97
Open
feat(agents): multi-agent personas with per-agent identity and memory#97
Conversation
…mory Enable named agent personas — each with its own identity (name, emoji, creature, vibe), soul/system prompt, workspace directory, and memory store. Sessions can be assigned to an agent via the UI header dropdown or the Telegram /agent command. The "main" agent maps to the existing root-level workspace, so no file migration is needed. Feature-gated behind `agent` (enabled by default in CLI). New files: - agent_persona.rs: AgentPersonaStore with SQLite CRUD + unit tests - page-agents.js: Settings > Agents page (create/edit/delete agents) - agents.spec.js: E2E tests for the agents settings page - Two SQL migrations (agents table + session agent_id column) Key changes: - Per-agent config loader functions (identity, soul, workspace paths) - Agent-aware prompt assembly in chat.rs - Per-agent memory managers (lazily created) in state.rs - Agent-scoped identity RPC methods (get/update/update_soul) - Session agent selector in header + emoji badges in sidebar - /agent command for Telegram channels
Adds a new icon-user-group CSS class (Heroicons user-group outline) and uses it for the Settings > Agents sidebar item so it's visually distinct from the Identity (single person) icon.
Replace the plain text input for agent emoji with the shared EmojiPicker component (same as Identity page). Move the New Agent button inline next to the heading to match other settings pages.
The agents page mounts and calls sendRpc before the WebSocket is assigned to S.ws, causing an immediate "WebSocket not connected" error. Add the same retry-with-backoff pattern used by other pages (up to 30 attempts at 200ms intervals).
When creating a new agent, fetch the main agent's soul via agents.identity.get and use it as the default value for the soul textarea, so new agents start with the same base personality.
The AgentForm useEffect that loads the soul (main's SOUL.md for new agents) also races with WebSocket initialization. Add the same retry pattern so the soul textarea gets pre-filled reliably.
The description field adds clutter without enough value — agent id/name is sufficient. The DB column is kept for backwards compat but the UI no longer sends or displays it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/agentcommandagentcargo feature (enabled by default in CLI)What's included
AgentPersonaStorewith SQLite CRUD + unit testschat.rsMemoryManagerlazily created instate.rsagents.*CRUD +agents.identity.*+agents.set_session/agentcommand to list/switch agentsagentstable +session.agent_idcolumnagents.spec.js+ updatedsettings-nav.spec.jsValidation
Completed
cargo build— passescargo test— all tests pass (0 failures)just format-check— cleancargo clippy --all-targets— cleanbiome ci crates/gateway/src/assets/js/— clean (0 errors)biome check --writeon new JS files — appliedRemaining
cd crates/gateway/ui && npx playwright test e2e/specs/agents.spec.jsjust release-preflight(blocked by pre-existing CUDA Toolkit requirement on this machine)Manual QA