Bug Description
OpenCode throws a ZodError after sending a message, but recovers after toggling fullscreen mode.
Error Message
schema validation failure
ZodError: {
"origin": "string",
"code": "invalid_format",
"format": "starts_with",
"prefix": "prt",
"path": "id",
"message": "Invalid string: must start with \"prt\""
}
Stack trace:
result5 at /$bunfs/root/src/cli/cmd/tui/worker.js:103962:20
createUserMessage at /$bunfs/root/src/cli/cmd/tui/worker.js:189832:35
Steps to Reproduce
- Start OpenCode in terminal
- Send any message
- Error appears immediately
- Toggle fullscreen (or resize terminal)
- Error clears and app works normally
Environment
- OpenCode version: 1.2.27
- Platform: Windows WSL2
- Distro: Ubuntu 24.04.4 LTS
- Kernel: 5.15.167.4-microsoft-standard-WSL2
Additional Context
The error appears to be related to an ID validation schema that requires id.startsWith("prt"). This might be related to:
- Config file ID format
- Supermemory storage record IDs
- Session/agent ID generation
- Conversation/message ID handling
Workaround
- Toggling fullscreen mode clears the error
- Resizing terminal window also helps
Suggested Fix
Either:
- Make the
prt prefix validation more lenient or provide fallback
- Ensure all generated IDs include the required prefix
- Add better error handling/recovery for this validation failure
- Auto-retry or regenerate ID when validation fails
Bug Description
OpenCode throws a ZodError after sending a message, but recovers after toggling fullscreen mode.
Error Message
Stack trace:
result5at/$bunfs/root/src/cli/cmd/tui/worker.js:103962:20createUserMessageat/$bunfs/root/src/cli/cmd/tui/worker.js:189832:35Steps to Reproduce
Environment
Additional Context
The error appears to be related to an ID validation schema that requires
id.startsWith("prt"). This might be related to:Workaround
Suggested Fix
Either:
prtprefix validation more lenient or provide fallback