Skip to content

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

Closed as not planned
Closed as not planned

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.

Activity

  1. added
    core
    on Apr 7, 2026
  2. removed
    core
    on May 3, 2026
  3. github-actions commented on Jul 6, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions