chatmock: Add GPT-5.3-codex support, Copilot Ollama dynamic tools, and reasoning wrapping improvements#91
Open
punal100 wants to merge 1 commit intoRayBytes:mainfrom
Open
chatmock: Add GPT-5.3-codex support, Copilot Ollama dynamic tools, and reasoning wrapping improvements#91punal100 wants to merge 1 commit intoRayBytes:mainfrom
punal100 wants to merge 1 commit intoRayBytes:mainfrom
Conversation
…d reasoning wrapping improvements
Summary:
1. Added `gpt-5.3-codex` model support across routing and exposed reasoning model variants.
2. Added dynamic Copilot tool discovery to support GitHub Copilot Ollama provider without hardcoded tool lists.
3. Enabled default Copilot tools and MCP tools by parsing tool declarations from system instructions and inferring schemas from history.
4. Improved reasoning compatibility handling for Copilot Ollama flows and wrapped thinking output more reliably.
5. Updated documentation for model support and tool/reasoning behavior.
6. Total: 6 files changed, +1170 / -174 lines.
Features:
1. GPT-5.3 Codex: Added model recognition and reasoning-variant exposure for `gpt-5.3-codex`.
2. Dynamic Tool Discovery: Introduced runtime derivation of tool schemas from Copilot system instructions (`type ... = (_: {...}) => any;`) and historical function calls.
3. Copilot Ollama Compatibility: Added fallback path for requests that omit `tools`, preserving function-calling behavior with BYOK/OpenAI-compatible payloads.
4. Tool Passthrough Safety: Improved handling of `responses_tools` and tool-choice behavior for mixed client compatibility.
5. Reasoning Compatibility: Applied Copilot-specific reasoning compatibility mode to avoid conflicting `<think>` behavior in Copilot surfaces.
Changes:
1. Modified `chatmock/utils.py` (+651/-?):
- Added `extract_copilot_tools_from_system_instructions`.
- Added `infer_tools_from_chat_history`.
- Added `derive_copilot_tools_dynamically`.
- Improved SSE translation behavior around tool-call emission and stop-chunk handling.
2. Modified `chatmock/routes_openai.py` (+241/-?):
- Added `gpt-5.3-codex` handling.
- Added Copilot Ollama request detection and dynamic tool-derivation fallback.
- Applied Copilot-specific reasoning compatibility in response shaping.
- Updated exposed reasoning model variants list.
3. Modified `chatmock/routes_ollama.py` (+352/-?):
- Added Ollama-provider compatibility refinements for Copilot request/response behavior.
4. Modified `chatmock/reasoning.py` (+15/-?):
- Minor reasoning behavior alignment for compatibility flow.
5. Modified `chatmock/upstream.py` (+39/-?):
- Upstream request/compatibility adjustments for new tool/reasoning pathways.
6. Modified `README.md` (+46/-?):
- Documented `gpt-5.3-codex` support.
- Clarified tool-calling and reasoning/thinking options.
Bug Fixes:
1. Fixed Copilot Ollama sessions where missing `tools` in request body caused degraded/non-functional function calling.
2. Fixed instruction/tool-schema conflicts by avoiding incompatible static instruction overlays in Copilot Ollama paths.
3. Improved reliability of thinking wrapper output in SSE translation flow.
Tests:
1. Verified modified files via `git status` and `git diff`.
2. Validated change scope with `git diff --stat` (6 files, +1170 / -174).
3. Manual flow validation targeted for Copilot Ollama + tool calling + reasoning compatibility paths.
Task: ChatMock Copilot Ollama compatibility + GPT-5.3-codex enablement
Signed-off-by: Punal Manalan <punal100@gmail.com>
|
Hey @punal100, quick question, what is the benefit of Copilot Ollama dynamic tools? What cases are you using it for? |
Author
Hello! Use cases, Reason for this Round about way, Honestly, Also, |
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:
gpt-5.3-codexmodel support across routing and exposed reasoning model variants.Features:
gpt-5.3-codex.type ... = (_: {...}) => any;) and historical function calls.tools, preserving function-calling behavior with BYOK/OpenAI-compatible payloads.responses_toolsand tool-choice behavior for mixed client compatibility.<think>behavior in Copilot surfaces.Changes:
chatmock/utils.py(+651/-?):extract_copilot_tools_from_system_instructions.infer_tools_from_chat_history.derive_copilot_tools_dynamically.chatmock/routes_openai.py(+241/-?):gpt-5.3-codexhandling.chatmock/routes_ollama.py(+352/-?):chatmock/reasoning.py(+15/-?):chatmock/upstream.py(+39/-?):README.md(+46/-?):gpt-5.3-codexsupport.Bug Fixes:
toolsin request body caused degraded/non-functional function calling.Tests:
git statusandgit diff.git diff --stat(6 files, +1170 / -174).Task: ChatMock Copilot Ollama compatibility + GPT-5.3-codex enablement
Signed-off-by: Punal Manalan punal100@gmail.com