Skip to content

fix: prefix part IDs with 'prt_' to satisfy OpenCode v1.2.27+ validation#31

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

fix: prefix part IDs with 'prt_' to satisfy OpenCode v1.2.27+ validation#31
selimdev00 wants to merge 1 commit intosupermemoryai:mainfrom
selimdev00:fix/part-id-prt-prefix

Conversation

@selimdev00
Copy link

Problem

OpenCode v1.2.27+ enforces that all part IDs must start with prt (validated via Zod schema in the TUI worker). The supermemory plugin was injecting parts with IDs like:

  • supermemory-context-<timestamp>
  • supermemory-nudge-<timestamp>

This causes the TUI worker to throw Invalid string: must start with "prt" on every first message in a session, breaking the session entirely.

Fix

Prefix both part IDs with prt_:

// before
id: `supermemory-context-${Date.now()}`
id: `supermemory-nudge-${Date.now()}`

// after
id: `prt_supermemory-context-${Date.now()}`
id: `prt_supermemory-nudge-${Date.now()}`

Impact

Without this fix, any user on OpenCode v1.2.27+ with the supermemory plugin enabled will have their session crash immediately after sending the first message.

OpenCode v1.2.27+ validates that all part IDs must start with 'prt'
(enforced via Zod schema in the TUI worker). The supermemory plugin
was injecting parts with IDs like 'supermemory-context-<timestamp>'
and 'supermemory-nudge-<timestamp>', causing a crash on every first
message in a session.

Prefix both IDs with 'prt_' to comply with the expected format.
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