Repository navigation
Store a chat message with its edges or not at all - #4243
Merged
Merged
Conversation
append_message no longer falls back to storing the message without its edges when the transactional create fails: the error is returned and nothing is written. When a turn's reply cannot be stored, the turn now posts a visible error message in the chat instead of ending silently. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
append_assistant_message now says which part failed: the reply not being stored, or the idle status not being written after a stored reply. Only the first posts a notice. The delete-confirmation reply gets the same notice. The notice no longer carries the database error (kept in the log) and says the turn's changes may already have been applied. Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
mstomar125
force-pushed
the
issue-4239-chat-edges
branch
from
November 5, 2026 10:42
c5244c5 to
8377aea
Compare
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.
Closes #4239
What changed
append_message(daemonchat_messages.rs) no longer falls back tocreate_node_with_parentwhencreate_node_with_relationshipsfails. The transaction's error is returned, so the message and its wrote / resolved / pending-delete edges are stored together or not at all. A skipped edge to a node that no longer exists still stores the message, as before.append_assistant_messagenow returnsAppendFailure::NotStored(the reply was not stored) orAppendFailure::StatusNotWritten(the reply is stored, the idle status is not). OnlyNotStoredposts a notice in the chat ("This turn's reply could not be saved. Changes it made may already have been applied, so check before repeating them."), with no edges and no outcome.StatusNotWrittenposts nothing and just resets idle. The database error stays in the log. The same handling now covers the delete-confirmation reply, which previously only reset idle.Tests
a_message_whose_edges_cannot_be_written_is_not_stored(store level; a trigger refuses the edge).a_turn_whose_reply_cannot_be_stored_says_so_in_the_chat(full turn with a stub engine; the notice is the only assistant message, no database detail, idle).a_status_write_failure_after_a_stored_reply_posts_no_notice(turn level and direct call returnsStatusNotWritten).a_delete_confirmation_whose_reply_cannot_be_stored_says_so_in_the_chat.-D warnings -D clippy::unused-async) on nodespace-daemon,local_agent_servicetests (116),chat_messages(8),bound_chat(17); pre-push gate.🤖 Generated with Claude Code