Skip to content

VU-1015: require SDK structured output#478

Merged
hbanerjee74 merged 2 commits into
mainfrom
feature/vu-1015-sdk-structured-output
Apr 30, 2026
Merged

VU-1015: require SDK structured output#478
hbanerjee74 merged 2 commits into
mainfrom
feature/vu-1015-sdk-structured-output

Conversation

@hbanerjee74

Copy link
Copy Markdown
Contributor

Fixes VU-1015

Summary

  • remove result-text structured output fallback from sidecar outputFormat runs
  • require SDK structured_output and emit structured_output_missing when absent
  • keep the live SDK canary for nested-schema regression coverage
  • update design docs and schema review script to document the final no-fallback contract

Verification

  • cd app/sidecar && npx vitest run
  • cd app && npm run test:agents:structural
  • npx markdownlint docs/design/agent-specs/README.md docs/design/agent-specs/canonical-format.md docs/design/backend-design/agent-event-contracts.md docs/design/data-contracts/README.md docs/design/sdk-agent-options/README.md docs/design/workflow-state/README.md
  • node --check app/src-tauri/schemas-review/test-sdk-multiturn.mjs
  • live canary: cd app/sidecar && ANTHROPIC_API_KEY= npx vitest run tests/sdk-output-format.integration.test.ts

PR phase evidence

  • AC gate: pass by installed SDK canary evidence per scope clarification
  • Design conformance: not_applicable; no local design doc referenced by the issue
  • Promptfoo evals: not_applicable; no agent skill/eval prompt changes

hbanerjee74 and others added 2 commits May 1, 2026 02:03
The structured_output fallback used ?? to chain raw.result into
lastOutputText, but ?? only fires for null/undefined — a non-JSON prose
string in raw.result blocked the fallback and triggered a hard failure.
Now tries both sources independently so JSON in a prior assistant block
is always recovered when the SDK omits structured_output.

Adds unit tests for all fallback paths and an API-gated integration
canary (sdk-output-format.integration.test.ts) to detect when the
upstream SDK bug (anthropics/claude-agent-sdk-typescript#277) is fixed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Apr 30, 2026

Copy link
Copy Markdown

@hbanerjee74 hbanerjee74 merged commit e995399 into main Apr 30, 2026
17 checks passed
@hbanerjee74 hbanerjee74 deleted the feature/vu-1015-sdk-structured-output branch April 30, 2026 18:10
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