Skip to content

feat: add conversation forking support with message ID tracking#407

Draft
rohan-patra wants to merge 1 commit intoagentclientprotocol:mainfrom
rohan-patra:conversation-forking
Draft

feat: add conversation forking support with message ID tracking#407
rohan-patra wants to merge 1 commit intoagentclientprotocol:mainfrom
rohan-patra:conversation-forking

Conversation

@rohan-patra
Copy link
Copy Markdown
Contributor

Summary

  • Adds message ID tracking to enable "edit previous message" UX via conversation forking
  • Maps ACP user message IDs to preceding SDK assistant UUIDs, so unstable_forkSession can fork at a specific point in the conversation using resumeSessionAt
  • Passes messageId through to ACP session notifications (text, image, thinking, tool_use chunks) so the client can correlate messages
  • Returns userMessageId in prompt responses for client-side message tracking
  • Uses user-provided messageId as the SDK message UUID (instead of random) when queuing messages during an active prompt

Test plan

  • Verify forking a session at a specific message replays conversation up to that point
  • Verify editing a previous user message creates a forked session from the correct position
  • Verify messageId appears on session update notifications
  • Verify userMessageId is returned in all prompt response stop reasons
  • Existing tests pass (messageIdMap added to test session fixtures)

@cla-bot cla-bot bot added the cla-signed label Mar 10, 2026
@SteffenDE
Copy link
Copy Markdown
Contributor

Should probably wait for agentclientprotocol/agent-client-protocol#629.

@rohan-patra
Copy link
Copy Markdown
Contributor Author

@SteffenDE yep, left it as a draft

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants