fix(acp): replay persisted session history on load/resume (salvage of #17652)#17874
Merged
Conversation
UserMessageChunk and AgentMessageChunk do not have a message_id field in the ACP schema. Passing it silently dropped the kwarg (pydantic does not raise on unknown init kwargs here) and the subsequent test assertions on .message_id raised AttributeError. Strip the dead plumbing (uuid import, message_id= kwarg on both chunk types, unused session_id/index parameters) and remove the matching .message_id asserts from the test.
This was referenced May 16, 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.
Summary
Replays persisted ACP session history to the client on
session/loadandsession/resume, so Zed's Agents sidebar shows the prior transcript instead of an empty thread.Salvage of #17652 by @HenkDz, plus a small follow-up.
Changes
acp_adapter/server.py: new_replay_session_history()iteratesstate.history, skips system/tool/empty entries, emitsuser_message_chunk/agent_message_chunknotifications. Called at the end ofload_session()andresume_session().message_idkwarg. ACP'sUserMessageChunk/AgentMessageChunkhave nomessage_idfield — pydantic silently dropped it on construction, and the test's.message_idassertions raisedAttributeError. Removed the uuid import, the kwarg on both chunk types, the now-unusedsession_id/indexparameters on_history_message_update, and the matching asserts in the test.Validation
pytest tests/acp/test_server.py.message_idAttributeError), 53 passedCloses #17652.
Co-authored-by: Henkey noonou7@gmail.com