Skip to content

fix: handle Moonshot union type lists#28322

Open
honor2030 wants to merge 1 commit into
NousResearch:mainfrom
honor2030:fix/moonshot-union-type-list
Open

fix: handle Moonshot union type lists#28322
honor2030 wants to merge 1 commit into
NousResearch:mainfrom
honor2030:fix/moonshot-union-type-list

Conversation

@honor2030

Copy link
Copy Markdown
Contributor

Summary

  • Preserve JSON Schema union type lists when sanitizing Moonshot tool schemas
  • Avoid unhashable-list crashes in _fill_missing_type() and scalar enum cleanup
  • Add a regression test for sanitize_moonshot_tools() with type: ["number", "string"]

Fixes #28291

Test Plan

  • RED: python -m pytest tests/agent/test_moonshot_schema.py::TestToolListSanitizer::test_preserves_json_schema_union_type_lists -q failed with TypeError: unhashable type: 'list'
  • GREEN: python -m pytest tests/agent/test_moonshot_schema.py -q → 43 passed, 11 warnings
  • python -m ruff check agent/moonshot_schema.py tests/agent/test_moonshot_schema.py → All checks passed
  • git diff --check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists provider/kimi Kimi / Moonshot type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: moonshot_schema._fill_missing_type crashes on JSON Schema union types (list type)

2 participants