Skip to content

fix: replay conversation history via session/update on session/load#1186

Merged
lewis617 merged 2 commits into
mainfrom
fix/acp-load-replay-history
Jun 4, 2026
Merged

fix: replay conversation history via session/update on session/load#1186
lewis617 merged 2 commits into
mainfrom
fix/acp-load-replay-history

Conversation

@lewis617
Copy link
Copy Markdown
Collaborator

@lewis617 lewis617 commented Jun 4, 2026

Summary

Fixes #1185

session/load now replays the full conversation history via session/update notifications before returning, as required by the ACP v1 spec.

Changes

  • Added replayConversationHistory() method that iterates the agent's message history and emits ACP notifications:
    • user_message_chunk for user text blocks
    • agent_message_chunk for assistant text blocks
    • agent_thought_chunk for reasoning blocks
    • tool_call + tool_call_update for tool blocks (with proper status, content, locations)
  • Uses agent.getFullMessageThread() for complete history including compacted sessions, with fallback to agent.messages
  • Skips isMeta messages during replay
  • Added 2 unit tests (replay + fallback) and an E2E example (acp-load-replay.ts)

Test plan

  • Unit tests pass (51/51)
  • E2E example verified: creates session → kills process → loads session → history replayed correctly → follow-up prompt works

lewis617 added 2 commits June 4, 2026 11:06
loadSession() now replays the full conversation history via
user_message_chunk, agent_message_chunk, agent_thought_chunk,
and tool_call/tool_call_update notifications before returning,
as required by the ACP v1 spec.

Uses agent.getFullMessageThread() for complete history including
compacted sessions, with fallback to agent.messages.

Fixes #1185
Covers: tool without id, failed tool, tool without name,
unparseable parameters, running stage, and skipped block types.
@lewis617 lewis617 merged commit b0ead73 into main Jun 4, 2026
1 check passed
@lewis617 lewis617 deleted the fix/acp-load-replay-history branch June 4, 2026 03:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

session/load does not replay conversation history via session/update notifications

1 participant