Add tool_search support and compatibility alignment#107
Open
PenguinDOOM wants to merge 10 commits intoRayBytes:mainfrom
Open
Add tool_search support and compatibility alignment#107PenguinDOOM wants to merge 10 commits intoRayBytes:mainfrom
PenguinDOOM wants to merge 10 commits intoRayBytes:mainfrom
Conversation
Updated the response API test to utilize TOOL_SEARCH_CHAT_TOOL instead of TOOL_SEARCH_RESPONSES_TOOL for the post request in RouteTests.
There was a problem hiding this comment.
Pull request overview
This PR adds VS Code-oriented tool_search support and introduces a CLIENT_COMPAT mode to gate/align behavior across the OpenAI, Ollama, and Responses surfaces, with expanded test coverage for these compatibility rules.
Changes:
- Add
CLIENT_COMPATconfiguration (default vsvscode) wired throughcreate_app()and the CLI. - Normalize/convert Chat Completions-style function tools (including
tool_search) into Responses-style tool schema, and enforce compat gating forresponses_*extensions. - Extend route and model-registry tests to validate unknown model passthrough, upstream error passthrough, and compat-specific behavior (HTTP + websocket).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_routes.py | Adds extensive compatibility + tool conversion tests, including websocket coverage and server startup helper. |
| tests/test_models.py | Adds tests for unknown-model passthrough and model listing expectations. |
| chatmock/routes_openai.py | Adds compat gating for responses_* fields and improves upstream error JSON passthrough. |
| chatmock/routes_ollama.py | Adds compat gating for responses_* fields and refactors upstream response handling. |
| chatmock/responses_api.py | Adds CLIENT_COMPAT checks, tool schema detection, tool conversion, and strips additional unsupported fields. |
| chatmock/model_registry.py | Adds public_aliases support and includes them in public model listings/alias normalization. |
| chatmock/cli.py | Adds --client-compat flag and plumbs it into app creation. |
| chatmock/app.py | Adds CLIENT_COMPAT config to the app config defaults. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Prevent forwarding of truncation hints to the upstream as the Codex backend rejects them. - Set the store field to False to comply with the upstream contract that rejects stored responses. Co-authored-by: Copilot <copilot@github.com>
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.
Summary
Compatibility Notes
Added In This Update
Notes