Repository navigation
fix(chat): drop empty assistant_message from projection - #738
Merged
Merged
Conversation
Tool-call-only model rounds persist assistant_message facts with empty
content. Connected-chat projection mapped those to text="" and then
failed payload validation, so GET /sessions, GET /sessions/{id}, and
GET /sessions/{id}/chat-events returned 500.
Drop the empty fact at projection time. Existing EventRecords stay in
the audit log (ADR-0077).
Verified: tests/coding_agent/test_connected_chat_projection.py (17 passed);
poisoned dogfood session 0c9c82a8 GET endpoints now 200.
New-runtime transitions copied engine pending facts into EventRecords without run_id. After restore, snapshot LEFT JOIN could not attach the superseded run, so the chat view kept the post-checkpoint turn. Stamp state_version.run_id when the payload omits it; keep an explicit child run_id. Empty assistant_message drop stays in the projection.
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
Two dogfood bugs on the new runtime chat path.
Tool-call-only model rounds persist
assistant_messagewith{"content": ""}. Projection mapped that totext=""and validation 500'dGET /sessions,GET /sessions/{id}, andGET /sessions/{id}/chat-events. Fix:project_chat_eventreturnsNonefor empty assistant text. EventRecords are not deleted (ADR-0077)._transition_unitcopied pending facts withoutrun_id. After restore, snapshotLEFT JOIN agent_runsonpayload.run_idcould not attach the superseded run, so the chat view kept the post-checkpoint turn. Fix: stampstate_version.run_idwhen the payload omits it; keep an explicit childrun_id.Test plan
uv run pytest tests/coding_agent/test_connected_chat_projection.py tests/coding_agent/test_durable_commit_ports.py -q0c9c82a8GET endpoints 200 after (1)