Skip to content

v2 SDK message builder assigns the placeholder id "asdasd" #41051

Description

@Mute-404

packages/sdk/js/src/v2/data.ts assigns the literal string "asdasd" as the id for the message and for every part it builds:

const info: UserMessage = {
  ...rest,
  id: "asdasd",
  ...
}

return {
  info,
  parts: input.parts.map((part) => ({
    ...part,
    id: "asdasd",
    ...
  }) as Part),
}

data is exported from src/v2/index.ts (export * as data from "./data.js") and ./v2 is in the package exports, so this is public API. Every message and every part built through it comes out with the same id.

grep -rn "asdasd" packages/ only finds these two lines, so it doesn't look like a sentinel value anyone checks for.

I have a patch that generates msg_/prt_ ids in the same monotonic format the server uses. Can open a PR if that's the direction you want.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions