fix(chatgpt-subscription): support Responses API tool calling#5490
Open
donk4488 wants to merge 2 commits into
Open
fix(chatgpt-subscription): support Responses API tool calling#5490donk4488 wants to merge 2 commits into
donk4488 wants to merge 2 commits into
Conversation
…ChatGPT tool fixes
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
Adds native Odysseus tool-calling support for ChatGPT Subscription models using the Codex Responses backend. Previously, the agent loop selected tools but the ChatGPT Subscription adapter did not include them in outbound requests, parse streamed function calls, or preserve structural tool-call history across rounds. This change implements Responses-compatible tool serialization, streamed function-call parsing, exact
call_idpreservation,function_call_outputreplay, parallel tool calls, and encrypted reasoning continuity.Target branch
dev, notmain. All PRs land indev;mainis curated by the maintainer at each release. If your PR is onmainby accident, click "Edit" on this PR and change the base.Linked Issue
Part of #[#199]
Type of Change
Checklist
devdocker compose uporuvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.How to Test
Configure and authenticate a ChatGPT Subscription endpoint, then confirm that the endpoint has
supports_tools=True.Start Odysseus:
Open a fresh agent-mode conversation using a ChatGPT Subscription/Codex model and send:
Confirm the logs show that tools were sent and executed:
Test a multi-round tool sequence:
Confirm that the model calls
get_workspace, thenread_file, and finally returns the heading from the actual file. In the tested environment, the final response was:Run the focused test suite:
Expected result:
Run syntax validation:
Implementation Notes
tool_callsevent structure.call_idvalues across model and tool-result rounds.function_call_outputitems.store=falsetool rounds.supports_tools=True.src/agent_loop.pyor bypass existing tool authorization and confirmation logic.Visual / UI changes — REQUIRED if you touched anything that renders
This PR does not modify UI rendering, CSS, HTML, SVG, visual components, or
static/js/DOM behavior.Screenshot or short clip of the change in the running app, attached below. Mobile screenshot too if the change affects mobile.
Not applicable — no visual or UI changes.
Style match: the change uses Odysseus's existing visual language. Specifically:
--red,--fg,--bg,--card,--border, etc.) — do not introduce new color values, font sizes, or spacing units.static/index.html) or plain text.Fira Code) for primary UI text. Don't override.Not applicable — no UI or styling files were changed.
No new component patterns. If a similar widget already exists in the app, extend it instead of writing a parallel one.
Not applicable — no components were added or modified.
I am not an LLM agent submitting a bulk PR. If you are, please open an issue describing the problem first — bulk auto-generated PRs that don't match the project's visual style are closed on sight, even when the underlying fix is correct.
Screenshots / clips
Not applicable — this is a provider-layer change with no visual or UI modifications.