test(gemini): add missing schema conversion edge case tests#1702
Merged
test(gemini): add missing schema conversion edge case tests#1702
Conversation
Covers five previously untested paths in the Gemini schema pipeline:
- oneOf Option<T> pattern (same handling as anyOf)
- null-first anyOf order: [{type:"null"}, {type:T}]
- unknown $ref fallback (→ OBJECT / "unresolved reference")
- nested multi-level $ref chain (A→B→C leaf resolution)
- parameterless tools still produce non-empty declarations
Part of #1592.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #1637. Part of #1592.
Summary
test_normalize_schema_oneof_option_pattern—oneOfOption treated identically toanyOf(null variant stripped,nullable: trueset)test_normalize_schema_anyof_null_first_order— null-firstanyOforder[{type:"null"}, {type:T}]correctly extracts Ttest_inline_refs_unknown_ref_fallback—$refpointing to missing key falls back to{type: OBJECT, description: "unresolved reference"}test_inline_refs_nested_multi_level— chained$refchain A→B→C fully resolves to leaf type/descriptiontest_build_tool_request_parameterless_tools_still_includes_tools_field— tools with empty-object schemas still produce non-emptydeclarations(second empty-guard path)Test plan
cargo nextest run -p zeph-llm --lib— 608 tests pass (+5 new)cargo +nightly fmt --check— cleancargo clippy --workspace --features full -- -D warnings— 0 warningscargo nextest run --config-file .github/nextest.toml --workspace --features full --lib --bins— 5305 passed