Repository navigation
fix(chatgpt-web): wire tool/function calling via shared webTools shim (#5240) - #5349
Merged
Merged
Conversation
…#5240) chatgpt-web was the only web-session executor that never read body.tools — both response builders hardcoded finish_reason:stop and emitted only content, so tool calls were silently dropped. Now uses the shared webTools prompt-emulation shim (<tool> contract + response parsing) like its 9 sibling executors; it was omitted from the #3259 rollout. Tool mode buffers + emits tool_calls (gated off image-gen); plain chat unchanged. Orchestration extracted to chatgptWebTools.ts to keep the frozen executor within its size cap. Regression guard: tests/unit/chatgpt-web-tools-5240.test.ts.
Contributor
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
diegosouzapw
added a commit
that referenced
this pull request
Jun 29, 2026
…rges The sequential squash-merges of #5351/#5349/#5347 onto release/v3.8.41 auto-resolved the CHANGELOG and progressively ate sibling bullets — the section was left with only the oauth (#5326) bullet + a duplicate '### Bug Fixes' header, dropping routing/cli/dashboard/rerank (batch 3) and opencode (#5217) / chatgpt-web (#5240). All code landed correctly; this restores every bullet verbatim under a single header. Additive restore.
bxsang
added a commit
to bxsang/OmniRoute
that referenced
this pull request
Jul 29, 2026
The per-model registry toolCalling:false stays (it honestly means no NATIVE tool calling, matching chatgpt-web after diegosouzapw#5349). Combo/auto tools filters key off the provider-level toolCalling:"emulated" marker via providerSupportsEmulatedToolCalling() (diegosouzapw#8488/diegosouzapw#5240) — without it a combo carrying tools would filter out every copilot-m365 target even though the prompt-emulation shim now handles them.
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…diegosouzapw#5240) (diegosouzapw#5349) Integrated into release/v3.8.41 — wire tool/function calling into chatgpt-web via shared webTools shim (diegosouzapw#5240). Test: chatgpt-web-tools-5240 green (4/4).
tkgo11
pushed a commit
to tkgo11/OmniRoute
that referenced
this pull request
Sep 23, 2026
…rges The sequential squash-merges of diegosouzapw#5351/diegosouzapw#5349/diegosouzapw#5347 onto release/v3.8.41 auto-resolved the CHANGELOG and progressively ate sibling bullets — the section was left with only the oauth (diegosouzapw#5326) bullet + a duplicate '### Bug Fixes' header, dropping routing/cli/dashboard/rerank (batch 3) and opencode (diegosouzapw#5217) / chatgpt-web (diegosouzapw#5240). All code landed correctly; this restores every bullet verbatim under a single header. Additive restore.
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.
Closes #5240.
Problem
The
chatgpt-webprovider silently drops tool/function calls — it answers in prose even when the request carriestools.Root cause
chatgpt-webwas the only web-session executor that never wired the shared prompt-emulation tool layer (open-sse/translator/webTools.ts). It never readbody.tools; both response builders hardcodedfinish_reason:"stop"and emitted onlycontent. The shim is shipped and used by 9 sibling executors (qwen-web, perplexity-web, deepseek-web, …) — chatgpt-web was just omitted from the #3259 rollout.Fix
Wire it exactly like the siblings:
prepareToolMessagesprepends a<tool>-contract system message; on the response sidebuildToolAwareResultparses<tool>{…}</tool>back into OpenAItool_calls. Tool mode buffers the full answer and emitstool_calls+finish_reason:"tool_calls"(a single terminal chunk when streaming), gated off the image-gen path. Plain chat (no tools) is unchanged. Orchestration lives in a newchatgptWebTools.tsso the frozen executor stays within its size cap.Validation (Hard Rule #18)
tests/unit/chatgpt-web-tools-5240.test.ts(4): request-side<tool>contract; non-streamtool_calls; stream terminaldelta.tool_calls; no-tools regression → plain content +stop. Red→green. The frozenchatgpt-web.test.ts(80 tests) is byte-identical/untouched. typecheck + eslint clean;chatgpt-web.tskept ≤ its frozen size cap.Contradicts the earlier by-design triage: the shim isn't new — it's shipped and used by 9 providers.