Skip to content

fix(protocols): preserve Anthropic tool strict - #322

Merged
rmccorm4 merged 2 commits into
mainfrom
rmccormick/anthropic-tool-strict
Oct 8, 2026
Merged

rmccorm4 merged 2 commits into
mainfrom
rmccormick/anthropic-tool-strict

Conversation

@rmccorm4

@rmccorm4 rmccorm4 commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Anthropic tools containing strict: true lose the flag during deserialization. Add AnthropicTool.strict: Option<bool> so explicit true/false values survive serialization and an omitted value stays omitted. The companion Dynamo change (ai-dynamo/dynamo#15547) forwards this field to ChatCompletionTool.function.strict.

Relates to #320.

Internal tracking: DIS-3038.

Validation

  • New round-trip regression fails before the fix and passes afterward for true, false, and omitted strict.
  • cargo test -p dynamo-protocols --locked: 156 tests passed.
  • cargo fmt --all -- --check and git diff --check passed.
  • With the companion conversion fix and a local Cargo path override, 119 Dynamo Anthropic tests and 31 structural-tag/tool-choice tests passed. CPU tests only.

Signed-off-by: Ryan McCormick <rmccormick@nvidia.com>
Comment thread protocols/src/types/anthropic.rs Resolved
@rmccorm4 rmccorm4 changed the title fix(protocols): preserve Anthropic tool strict fix(protocols)!: preserve Anthropic tool strict Oct 2, 2026
@rmccorm4 rmccorm4 changed the title fix(protocols)!: preserve Anthropic tool strict fix(protocols): preserve Anthropic tool strict Oct 8, 2026
@luckyq
luckyq self-requested a review October 8, 2026 20:38
@rmccorm4
rmccorm4 merged commit 0546598 into main Oct 8, 2026
7 checks passed
@rmccorm4
rmccorm4 deleted the rmccormick/anthropic-tool-strict branch October 8, 2026 20:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants