Skip to content

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
punal100:Dev_Punal
Open

chatmock: Add GPT-5.3-codex support, Copilot Ollama dynamic tools, and reasoning wrapping improvements#91
punal100 wants to merge 1 commit intoRayBytes:mainfrom
punal100:Dev_Punal

Conversation

@punal100
Copy link

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

…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>
@XBadFellaX
Copy link

Hey @punal100, quick question, what is the benefit of Copilot Ollama dynamic tools? What cases are you using it for?

@punal100
Copy link
Author

Hey @punal100, quick question, what is the benefit of Copilot Ollama dynamic tools? What cases are you using it for?

Hello!

Use cases,
Utilising my GPT Subscription in copilot release version via ollama Wrapper/Proxy,

Reason for this Round about way,
Vscode Insider has Open AI Compatible Endpoint, while the current release version of does not have it,

Honestly,
I am not using this round about way anymore
Because copilot just released GPT-5.3 Codex already.

Also,
Thanks for taking a look at this Pull Request!

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.

2 participants

Comments