Skip to content

fix(acp): replay persisted session history on load/resume (salvage of #17652)#17874

Merged
teknium1 merged 2 commits into
mainfrom
hermes/hermes-0ac74712
Apr 30, 2026
Merged

fix(acp): replay persisted session history on load/resume (salvage of #17652)#17874
teknium1 merged 2 commits into
mainfrom
hermes/hermes-0ac74712

Conversation

@teknium1

Copy link
Copy Markdown
Contributor

Summary

Replays persisted ACP session history to the client on session/load and session/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() iterates state.history, skips system/tool/empty entries, emits user_message_chunk / agent_message_chunk notifications. Called at the end of load_session() and resume_session().
  • Follow-up: drop dead message_id kwarg. ACP's UserMessageChunk / AgentMessageChunk have no message_id field — pydantic silently dropped it on construction, and the test's .message_id assertions raised AttributeError. Removed the uuid import, the kwarg on both chunk types, the now-unused session_id/index parameters on _history_message_update, and the matching asserts in the test.

Validation

Before After
pytest tests/acp/test_server.py 1 failed (new test .message_id AttributeError), 53 passed 54 passed

Closes #17652.

Co-authored-by: Henkey noonou7@gmail.com

HenkDz and others added 2 commits April 30, 2026 02:32
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.
@teknium1 teknium1 merged commit 6589474 into main Apr 30, 2026
11 of 12 checks passed
@teknium1 teknium1 deleted the hermes/hermes-0ac74712 branch April 30, 2026 09:45
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/acp Agent Communication Protocol adapter labels Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/acp Agent Communication Protocol adapter P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants