-
Notifications
You must be signed in to change notification settings - Fork 15.4k
SDK part input id type does not enforce prt prefix #21311
Copy link
Copy link
Open
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Description
Description
The server rejects part IDs that don't start with prt — but the SDK types id as string, so invalid IDs pass the type checker and only fail at runtime.
Steps to reproduce
- Install
@opencode-ai/sdk - Call the prompt API with a part containing
id: "task_something" - Runtime error:
Invalid string: must start with "prt"
Root cause
openapi.json already has "pattern": "^prt.*" on these id fields, but the generator doesn't translate that into a template-literal type.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
coreAnything pertaining to core functionality of the application (opencode server stuff)Anything pertaining to core functionality of the application (opencode server stuff)
Type
Fields
Give feedbackNo fields configured for issues without a type.