Skip to content

refactor(llm): type provider tool choices#2737

Draft
Jordan-Jarvis wants to merge 5 commits into
vectorize-io:mainfrom
Jordan-Jarvis:upstream/refactor-typed-tool-choice-20260716
Draft

refactor(llm): type provider tool choices#2737
Jordan-Jarvis wants to merge 5 commits into
vectorize-io:mainfrom
Jordan-Jarvis:upstream/refactor-typed-tool-choice-20260716

Conversation

@Jordan-Jarvis

Copy link
Copy Markdown
Contributor

Summary

  • replace the internal str | dict tool-choice union with a canonical typed value
  • serialize provider-specific tool-choice wire shapes only at provider boundaries
  • make named-tool validation explicit and remove runtime payload-shape guessing
  • preserve provider retry configuration and response-usage tracing from current upstream main

Dependency

This is intentionally stacked on #2734 because it types the named-tool behavior introduced there. Review the final refactor commit 7a71d8c11; after #2734 lands, the base will contain the prerequisite behavior and this PR will show only the typed cutover.

Validation

  • Ruff check passed on all 17 changed files
  • Ruff format check passed on all 17 changed files
  • 41 focused provider/Reflect tests passed sequentially
  • engine compileall passed

A broader local file-level run reached 82 passing tests; four unrelated integration/setup cases failed because the local environment had no .env API key and two parallel workers timed out waiting on the shared embeddings fixture lock. The focused deterministic suite above is the authoritative change validation.

@Jordan-Jarvis

Copy link
Copy Markdown
Contributor Author

Updated the stack to current upstream main and the refreshed #2734 head. The typed cutover remains draft until #2734 merges so its final review diff stays focused.

Validation on the updated head:

  • Ruff check and format check across all 17 changed Python files: passed
  • focused provider/Reflect suite: 96 passed
  • the three real-LLM fixtures requiring HINDSIGHT_API_LLM_API_KEY were excluded from this deterministic run

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