fix: route chat to the selected agent instead of always MicroClaw (#53)#54
Open
yikkuro wants to merge 1 commit into
Open
fix: route chat to the selected agent instead of always MicroClaw (#53)#54yikkuro wants to merge 1 commit into
yikkuro wants to merge 1 commit into
Conversation
Selecting a non-default agent (Coder, Van Gogh, etc.) still routed messages to the main (MicroClaw) persona, and both the top-left brand button and the in-chat avatar reverted to MicroClaw. Root causes: - Session keys never encoded the agent, so every chat was normalised to agent:main server-side. - ensureEmptySession() kept an empty session bound to the previously selected agent instead of rebinding to the newly selected one. - The in-chat message avatar was hardcoded to normal.png (MicroClaw). Fixes: - chat.ts: newSession() encodes non-default agents as `agent:<id>:session-...`; add exported currentSessionAgentId computed. - SidePanel.vue: ensureEmptySession() starts/rebinds a session on agent mismatch and always tags it with the current agent. - ChatMessageList.vue: in-chat avatar is now a computed resolving the current session's agent avatar, falling back to the default. Adds 2 tests covering session-key encoding for default vs non-default agents. Verified live via the dev build: chatting with Van Gogh now shows Van Gogh in the header, brand button, and in-chat avatar, and the painter persona responds. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Fixes #53.
Selecting a non-default agent (Coder, Van Gogh, etc.) still routed messages to the main (MicroClaw) persona, and both the top-left brand button and the in-chat message avatar reverted to MicroClaw.
Root causes
agent:mainserver-side.ensureEmptySession()kept an empty session bound to the previously selected agent instead of rebinding to the newly selected one.normal.png(MicroClaw).Changes
stores/chat.ts—newSession()now encodes non-default agents into the session key asagent:<id>:session-...; added an exportedcurrentSessionAgentIdcomputed.components/SidePanel.vue—ensureEmptySession()starts/rebinds a session when the current chat has messages or belongs to a different agent, and always tags it with the current agent.components/chat/ChatMessageList.vue— the in-chat avatar is now a computed that resolves the current session's agent avatar, falling back to the default.Tests
Added 2 tests covering session-key encoding for default vs non-default agents. Full validation:
vue-tsctypecheck cleanManual verification
Verified live in the dev build: chatting with Van Gogh now shows Van Gogh in the header, the top-left brand button, and the in-chat avatar — and the
painterpersona responds (previously it reverted to MicroClaw).