Skip to content

Comments

fix(core): strip schema metadata and fix doom loop detection for native tool calls#534

Merged
bug-ops merged 1 commit intomainfrom
fix/506-tool-schema-doom-loop
Feb 18, 2026
Merged

fix(core): strip schema metadata and fix doom loop detection for native tool calls#534
bug-ops merged 1 commit intomainfrom
fix/506-tool-schema-doom-loop

Conversation

@bug-ops
Copy link
Owner

@bug-ops bug-ops commented Feb 18, 2026

Summary

  • Strip $schema and title fields from schemars-generated JSON before passing tool definitions to Claude API, preventing schema metadata from confusing the model into omitting required parameters
  • Fix doom loop detection for native tool_use path by normalizing volatile tool_use_id values before comparing consecutive messages
  • Add unit tests for schema stripping, ID normalization, and mixed tag ordering

Test plan

  • cargo +nightly fmt --check passes
  • cargo clippy --workspace -- -D warnings passes
  • cargo nextest run --workspace --lib --bins — 1596 passed, 0 failed
  • New tests: tool_def_strips_schema_and_title, normalize_strips_tool_result_ids, normalize_strips_tool_use_ids, normalize_preserves_plain_text, normalize_handles_mixed_tag_order

Closes #506

@bug-ops bug-ops force-pushed the fix/506-tool-schema-doom-loop branch from 9f01fe7 to 534d204 Compare February 18, 2026 13:48
…ve tool calls

Remove $schema and title fields from schemars-generated JSON before
passing tool definitions to Claude API. Fix doom loop detection that
was broken for native tool_use path because tool_use_id uniqueness
defeated string comparison — normalize volatile IDs before comparing
consecutive messages.

Closes #506
@bug-ops bug-ops force-pushed the fix/506-tool-schema-doom-loop branch from 534d204 to 9cb4dc7 Compare February 18, 2026 15:18
@bug-ops bug-ops merged commit 2ee08f8 into main Feb 18, 2026
18 checks passed
@bug-ops bug-ops deleted the fix/506-tool-schema-doom-loop branch February 18, 2026 15:29
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.

fix: doom loop not detected for repeated identical tool validation errors

1 participant