Skip to content

docs(extension): clarify LLMParsedResponseSchema validation path - #2714

Open
HaoChiBao wants to merge 1 commit into
browserbase:mainfrom
HaoChiBao:fix/llm-parsed-response-validation
Open

docs(extension): clarify LLMParsedResponseSchema validation path#2714
HaoChiBao wants to merge 1 commit into
browserbase:mainfrom
HaoChiBao:fix/llm-parsed-response-validation

Conversation

@HaoChiBao

@HaoChiBao HaoChiBao commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the stale response_model TODO on LLMParsedResponseSchema with a note that AISdkClient already validates structured output through AI SDK Output.object.
  • Avoid a redundant second Zod .parse() that can break transform/pipe schemas (per review feedback).

Test plan

  • Confirm AISdkClient.createChatCompletion still returns objectResponse.output for structured responses
  • No behavior change expected beyond comment accuracy

@changeset-bot

changeset-bot Bot commented Aug 13, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 5bf0829

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files

Architecture diagram
sequenceDiagram
    participant Client as LLM Client
    participant SDK as AISdkClient
    participant Model as LLM Model
    participant Schema as response_model.schema
    participant Caller as Calling code

    Note over Client,Caller: Structured LLM response flow

    Client->>SDK: createChatCompletion(prompt, response_model)
    SDK->>SDK: Build request with response_model schema
    SDK->>Model: Send completion request
    Model-->>SDK: objectResponse.output (raw)

    SDK->>Schema: Validate objectResponse.output

    alt Validation succeeds
        Schema-->>SDK: Parsed data
        SDK-->>Client: Return data + usage
    else Validation fails
        Schema-->>SDK: ZodError thrown
        SDK-->>Client: Error propagates
    end

    Client-->>Caller: Return structured result or error
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread packages/extension/llm/aisdk.ts Outdated
Comment thread packages/extension/llm/aisdk.ts Outdated
Replace the stale response_model TODO with a note that AISdkClient validates structured output through AI SDK Output.object.
@HaoChiBao
HaoChiBao force-pushed the fix/llm-parsed-response-validation branch from 9e411cd to 5bf0829 Compare August 13, 2026 19:06
@HaoChiBao HaoChiBao changed the title fix(extension): validate structured LLM data with response_model docs(extension): clarify LLMParsedResponseSchema validation path Aug 13, 2026
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