Skip to content

fix: add prt_ prefix to part IDs for OpenCode 1.2.25+ compatibility#30

Merged
MaheshtheDev merged 1 commit intosupermemoryai:mainfrom
NevermoreDDD:fix/part-id-prefix
Mar 24, 2026
Merged

fix: add prt_ prefix to part IDs for OpenCode 1.2.25+ compatibility#30
MaheshtheDev merged 1 commit intosupermemoryai:mainfrom
NevermoreDDD:fix/part-id-prefix

Conversation

@NevermoreDDD
Copy link
Contributor

Summary

  • Add prt_ prefix to part IDs created in chat.message hook
  • Fixes ZodError when using OpenCode 1.2.25+

Problem

OpenCode 1.2.25+ validates part IDs with a Zod schema requiring them to start with "prt". The chat.message hook was creating parts with IDs like supermemory-context-{timestamp} and supermemory-nudge-{timestamp}, which failed validation with:

ZodError: Invalid string: must start with "prt" at path ["id"]

Solution

Changed part ID format:

  • supermemory-nudge-{timestamp}prt_supermemory-nudge-{timestamp}
  • supermemory-context-{timestamp}prt_supermemory-context-{timestamp}

Testing

Tested locally with OpenCode 1.2.26 - context injection works without errors.

Fixes #29

OpenCode 1.2.25+ validates part IDs with Zod schema requiring 'prt' prefix.
The chat.message hook was creating parts with non-compliant IDs causing ZodError.

Fixes supermemoryai#29
@Yihao-G
Copy link

Yihao-G commented Mar 17, 2026

@Dhravya any possibility we can get this reviewed and merged please?

Copy link
Member

@MaheshtheDev MaheshtheDev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the contribution

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.

Part IDs in chat.message hook missing required 'prt' prefix

3 participants