Skip to content

SDK part input id type does not enforce prt prefix #21311

@StatPan

Description

@StatPan

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

  1. Install @opencode-ai/sdk
  2. Call the prompt API with a part containing id: "task_something"
  3. 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.

Metadata

Metadata

Assignees

Labels

coreAnything pertaining to core functionality of the application (opencode server stuff)

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions