Skip to content

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

Open
NevermoreDDD wants to merge 1 commit intosupermemoryai:mainfrom
NevermoreDDD:fix/part-id-prefix
Open

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

Conversation

@NevermoreDDD
Copy link

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
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

1 participant