Skip to content

feat(session): allow stream message IDs#64

Open
theadriann wants to merge 1 commit into
Factory-AI:mainfrom
theadriann:droid-session-stream-message-id
Open

feat(session): allow stream message IDs#64
theadriann wants to merge 1 commit into
Factory-AI:mainfrom
theadriann:droid-session-stream-message-id

Conversation

@theadriann
Copy link
Copy Markdown

Description

Adds optional messageId support to DroidSession.stream() by forwarding it through MessageOptions to the underlying add_user_message request.

Why

Some SDK consumers need a stable, client-generated id for the user message that starts a stream. Without this, they have to bypass DroidSession and call lower-level client APIs just to correlate later session notifications with the originating message.

SDK impact

This is additive. Existing callers keep the same behavior when messageId is omitted. When provided, the SDK includes it in add_user_message.params.messageId, matching the existing protocol field.

What this enables

Higher-level DroidSession users can track message identity for UI state, persistence, replay, and session operations without dropping down to DroidClient.addUserMessage().

Testing

  • pnpm lint
  • pnpm typecheck
  • pnpm exec vitest run tests/session.test.ts
  • pnpm format:check
  • pnpm test
  • pnpm build

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.

1 participant