Skip to content

The chat's persona is kept on the server, and nobody is slipped into a chat - #339

Merged
Khoality-dev merged 2 commits into
mainfrom
fix/334-no-silent-default-persona
Sep 28, 2026
Merged

Khoality-dev merged 2 commits into
mainfrom
fix/334-no-silent-default-persona

Conversation

@Khoality-dev

Copy link
Copy Markdown
Owner

Closes #334

What was wrong

  • The server slipped a persona in. A new chat that named no persona was silently answered by assistants.default_persona_id. The desktop header said "Assistant" while Kurisu answered.
  • The desktop's pick lived in local storage. Signing in again (the pick is cleared) opened an empty chat under "Assistant". Kurisu's conversation was in her bucket, and the desktop only looked in the assistant's.

What changed (the owner's decisions)

  • Nothing is injected. A chat_request that names no persona is the assistant's own. pick_persona has no default step.
  • The selection is saved on the server and loaded on open.
    • assistants.default_persona_id becomes selected_persona_id: who the chat is on. Clients read it when they open and write it when the user picks someone, and the server never applies it.
    • The migration 40309c742302 is a column rename (the FK constraint too), so each account opens on the persona it had.
    • Disabling a persona clears it, and deleting one clears it through the FK.
  • Wire protocol 8. A removed field is a bump by the rules in version.py. Backend, constants.ts, the Android BuildConfig and protocol/events.json are all updated. The next release should be a new minor.
  • Desktop:
    • personaStore loads the selection from GET /assistant and saves it with PATCH /assistant, instead of local storage. The old key is dropped with the other legacy keys.
    • The Personas page's Default badge and Make/Clear default become In the chat, Talk to and Use the assistant, all the same selection as the chat.
    • The assistant's update_assistant app tool takes selected_persona_id and goes through the store.
  • Android:
    • The rename: the Personas page's tap selects, and the chat opens on the selection.
    • The header's Assistant row now works in a chat that has not started yet. It used to be held back because the server would have slipped the default in.
  • Mock: follows the backend, including validation on PATCH /assistant.
  • Docs updated throughout.

Tests

Each new test was run first against the unfixed code and failed:

  • Backend: test_the_selected_persona_is_not_slipped_into_a_chat_that_names_none answered as Kurisu, and the TestTheChatSelection tests had no field.
  • Desktop store: personaSelection.test.ts failed on load and on save.
  • Android e2e: a_new_chat_can_be_the_assistants_own_while_a_default_persona_is_set found the row held back.

After the fix, all local:

  • Backend 1366 passed; the one failure is the known local-only TestMime[notes.md].
  • Mock 117/117. Workspace npm test: all suites pass. npm run typecheck: clean.
  • Android JVM 276 tests. Android e2e MockBackendChatTest, NoPersonaTest and ConversationsTest: 7/7.
  • Desktop Playwright: the full suite, 80 passed and 1 failed. The failure was the new sign-in-again spec, which wiped the server URL along with local storage. I fixed the spec, and personaOptional.spec.ts then passed 6/6.

🤖 Generated with Claude Code

https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv

akn-sfu and others added 2 commits September 27, 2026 17:18
… into a chat (#334)

A new chat that named no persona was silently answered by the account's
default persona, so the desktop said "Assistant" in its header while
Kurisu answered, and a sign-in again opened an empty chat under
"Assistant" because the desktop kept its pick in local storage.

The server no longer adopts anyone: a chat request that names no persona
is the assistant's own. assistants.default_persona_id becomes
selected_persona_id by migration (a rename, so each account opens on the
persona it had): who the chat is on, which the clients read when they open
and write when the user picks someone, and which the server never applies.
Removed field, so the wire protocol goes to 8.

Desktop: the persona store loads and saves the selection through
/assistant instead of local storage; the Personas page's Default badge and
Make/Clear default become "In the chat", "Talk to" and "Use the assistant".
Android: the rename, and the chat's Assistant row works in a chat that has
not started yet. The mock follows the backend.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
)

The selection now comes back with GET /assistant after sign-in, where local
storage had it at once. A message sent inside that round trip named nobody
and the assistant answered instead of the persona the chat is on — Windows
CI sent inside it. The first send of a new chat now waits for the selection
to load, at most ten seconds; sign-out marks it unknown again.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014L9pxjp1MTSJe5DZG9A9sv
@Khoality-dev
Khoality-dev merged commit f2c7b34 into main Sep 28, 2026
6 checks passed
@Khoality-dev
Khoality-dev deleted the fix/334-no-silent-default-persona branch September 28, 2026 00:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Desktop: signing in again opens an empty chat under "Assistant" instead of my conversation with the default persona

2 participants