Repository navigation
Fix: a node with an old AI chat no longer crashes on start ("No agent set") - #2209
Merged
Merged
Conversation
Resource::save_as validated the commit for the default agent instead of the agent that signed it. The AI chat migration in Db::open saves the chat with the migration's own signer before the server has loaded its agent, so a node with an old AI chat failed to start with "No agent set". apply_signed_commit now takes the signing agent. Test: a store with an old AI chat reopens without an agent and migrates it.
joepio
marked this pull request as ready for review
October 11, 2026 00:57
joepio
added a commit
that referenced
this pull request
Oct 11, 2026
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.
Before: since the ChatLog migration (#2192), a server whose store holds an old AI chat exits on start with
No agent set. Call db.setup() or db.load_agent_from_secret() first.The managed node on node1 never opens its port, so saas deploys 104 and 105 rolled back.After: the store opens and migrates its AI chats before any agent is loaded.
The AI chat migration in
Db::openclears the chat'smessageslist withResource::save_as(&migration_signer).save_assigned with the given agent butapply_signed_committhen asked the store for its default agent to fillvalidate_for_agent. A server opens its store before it loads its agent, so that failed.How:
apply_signed_committakes the agent that signed the commit;save_asandsave_locallypass theirs. Plugins callingsave_as(store_host) are now validated for the agent that signs, not the server's.Test:
opening_a_store_without_an_agent_migrates_ai_chatsreopens a store with an old AI chat without an agent; it fails on develop with the node1 error and passes here.cargo test -p atomic_lib --features db-redb --lib: 773 passed.Note: a chat the crashed starts already got to may keep a stale
messagesvalue in its propvals (its Loro doc was signed without it before the crash). It points at removed resources and is harmless; the migration still finishes.🤖 Generated with Claude Code
https://claude.ai/code/session_01PTPBVY1HZccCxSD7faCM5f
Generated by Claude Code