Skip to content

fix(aikit): convert strict tool schemas to the strict subset - #61

Merged
sanchitrk merged 1 commit into
canaryfrom
claude/silly-varahamihira-2c18ed
Oct 10, 2026
Merged

sanchitrk merged 1 commit into
canaryfrom
claude/silly-varahamihira-2c18ed

Conversation

@sanchitrk

Copy link
Copy Markdown
Contributor

Summary

  • aikit: constrainedSampling: { type: "json_schema" } now sends a strict-subset schema (closed objects, all properties required, optional ones nullable) instead of the raw schema with strict: true, which Anthropic rejected (additionalProperties: true 400). "prefer" falls back to non-strict when the provider can't express the schema; "require" throws.
  • aikit: normalizeOptionalNulls strips nulls for omitted optional args before validation.
  • plugin: ToolDef.constrainedSampling, passed through toAikitTool.
  • harness: executor strips optional nulls and decodes with Schema.toCodecJson; bash opts into strict: "prefer".

Test plan

  • vp check, vp run typecheck, aikit + harness suites green
  • vp test run test/settings.live.test.ts green on all 6 live providers
  • Ad-hoc live checks: Anthropic accepts a strict Effect schema and nulls decode; OpenAI strict bash call with timeout: null runs

🤖 Generated with Claude Code

Port strict JSON-schema conversion with prefer/require fallback,
strip optional nulls before validation, pass constrainedSampling
through plugin ToolDef, and decode harness args via the JSON codec.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sanchitrk
sanchitrk merged commit db70539 into canary Oct 10, 2026
@sanchitrk
sanchitrk deleted the claude/silly-varahamihira-2c18ed branch October 10, 2026 04:13
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