Repository navigation
Fix Code tool placement for ChatGPT subscriptions - #11628
Conversation
|
Confirmed that on main the Code toggle for ChatGPT subscription models requests hosted code_execution, which that connection never runs, so Python and Terminal never reach the model. Thanks for tracking this down, will get this reviewed. |
Assert the Codex Code pill resolves to python/terminal/edit_file and stays offered, not only that the hosted sandbox flag is off, and correct the composer comment that named Anthropic as the only hosted code-execution provider.
|
Pushed
No production behavior change. Both mutations (restoring the removed Codex branch, and adding Codex to the sandbox set) fail exactly this test. |
Derive tools.code from the Code placement the request actually sends, so an external connection without a hosted sandbox (ChatGPT/Codex, self-hosted) reports Code as enabled when it sends python/terminal/edit_file.
providerSupportsBuiltinCodeExecution and providerHostsCodeExecution must only claim a provider sandbox where PROVIDER_REGISTRY declares code_execution in hosted_tools. unslothai#11557 was the per-model check answering true for openai_codex, which hosts nothing, so Code sent code_execution to a connection that never runs it. Fails on both the removed Codex branch and on adding openai_codex to the sandbox set.
|
Review record for #11628, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#71. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1 — reviewed mirror
|
A full tests/studio run on main turned up five more contracts and two Playwright drivers pinned to spellings those two PRs changed on purpose: - test_update_release_notes: the update banners are 448px at the default scale, now written scale-wrapped; widths are read back through the scale before comparing. - test_ui_font_scale_contract: the CSS default lives in the fallback of the derived --ui-font-scale, and icons scale linearly with it (unslothai#11648 said so), not at half rate. - test_chat_response_details_ui_contract: response details record Code from the placement actually sent, hosted sandbox or local tools (unslothai#11628). - playwright_chat_ui / playwright_update_banner_layout: --ui-font-scale is now a calc() and an unregistered custom property reads back as that text, so float() failed ('unreadable --ui-font-scale') and the banner's 'is it scaled' string compare could no longer fail. Both resolve the scale through a length instead.
…lacement in the studio contracts (unslothai#11673) * Follow unslothai#11648's UI-scale layout in four studio contract tests unslothai#11648 merged with Repo tests (CPU, studio) red, and main has failed those four since: - The Images and Audio rails are now min(408px, 100% - 13rem) at the default scale, so the canvas keeps the 13rem its header column reserves. Both pages pin that exact expression through a shared RAIL_WIDTH, so they still have to match each other. - The settings dialog stacks on its own measured width (data-stacked) rather than the max-sm viewport breakpoint, which a larger interface scale does not move. The test now requires the attribute to be set and the stacking class keyed on it. - The Thinking caret is 15px at the default scale in either spelling, since the composer's lengths are now wrapped in the space scale. * Cover the rest of unslothai#11648's and unslothai#11628's studio fallout A full tests/studio run on main turned up five more contracts and two Playwright drivers pinned to spellings those two PRs changed on purpose: - test_update_release_notes: the update banners are 448px at the default scale, now written scale-wrapped; widths are read back through the scale before comparing. - test_ui_font_scale_contract: the CSS default lives in the fallback of the derived --ui-font-scale, and icons scale linearly with it (unslothai#11648 said so), not at half rate. - test_chat_response_details_ui_contract: response details record Code from the placement actually sent, hosted sandbox or local tools (unslothai#11628). - playwright_chat_ui / playwright_update_banner_layout: --ui-font-scale is now a calc() and an unregistered custom property reads back as that text, so float() failed ('unreadable --ui-font-scale') and the banner's 'is it scaled' string compare could no longer fail. Both resolve the scale through a length instead. * Read the Code placement inside buildResponseDetails, not anywhere in the adapter * Pin the rail's scale wrapper as written, since the default-scale read cannot see it * Pin the scaled spelling of the Thinking caret and the update notes width * Read the font-size setter and the stacking attribute where they take effect
* fix(studio): route Codex Code to local tools * test(studio): pin Codex Code placement to local tools Assert the Codex Code pill resolves to python/terminal/edit_file and stays offered, not only that the hosted sandbox flag is off, and correct the composer comment that named Anthropic as the only hosted code-execution provider. * fix(studio): record local Code in response details Derive tools.code from the Code placement the request actually sends, so an external connection without a hosted sandbox (ChatGPT/Codex, self-hosted) reports Code as enabled when it sends python/terminal/edit_file. * test(studio): pin hosted Code claims to the backend registry providerSupportsBuiltinCodeExecution and providerHostsCodeExecution must only claim a provider sandbox where PROVIDER_REGISTRY declares code_execution in hosted_tools. unslothai#11557 was the per-model check answering true for openai_codex, which hosts nothing, so Code sent code_execution to a connection that never runs it. Fails on both the removed Codex branch and on adding openai_codex to the sandbox set. * test(studio): tighten registry guard comments * Add GPT-6 Sol and Luna to ChatGPT subscription models --------- Co-authored-by: Lyxot <[email protected]> Co-authored-by: Daniel Han <[email protected]> Co-authored-by: wasimysaid <[email protected]>
…lacement in the studio contracts (unslothai#11673) * Follow unslothai#11648's UI-scale layout in four studio contract tests unslothai#11648 merged with Repo tests (CPU, studio) red, and main has failed those four since: - The Images and Audio rails are now min(408px, 100% - 13rem) at the default scale, so the canvas keeps the 13rem its header column reserves. Both pages pin that exact expression through a shared RAIL_WIDTH, so they still have to match each other. - The settings dialog stacks on its own measured width (data-stacked) rather than the max-sm viewport breakpoint, which a larger interface scale does not move. The test now requires the attribute to be set and the stacking class keyed on it. - The Thinking caret is 15px at the default scale in either spelling, since the composer's lengths are now wrapped in the space scale. * Cover the rest of unslothai#11648's and unslothai#11628's studio fallout A full tests/studio run on main turned up five more contracts and two Playwright drivers pinned to spellings those two PRs changed on purpose: - test_update_release_notes: the update banners are 448px at the default scale, now written scale-wrapped; widths are read back through the scale before comparing. - test_ui_font_scale_contract: the CSS default lives in the fallback of the derived --ui-font-scale, and icons scale linearly with it (unslothai#11648 said so), not at half rate. - test_chat_response_details_ui_contract: response details record Code from the placement actually sent, hosted sandbox or local tools (unslothai#11628). - playwright_chat_ui / playwright_update_banner_layout: --ui-font-scale is now a calc() and an unregistered custom property reads back as that text, so float() failed ('unreadable --ui-font-scale') and the banner's 'is it scaled' string compare could no longer fail. Both resolve the scale through a length instead. * Read the Code placement inside buildResponseDetails, not anywhere in the adapter * Pin the rail's scale wrapper as written, since the default-scale read cannot see it * Pin the scaled spelling of the Thinking caret and the update notes width * Read the font-size setter and the stacking attribute where they take effect
Treat ChatGPT/Codex subscription models as using Unsloth's local Code tools, so the Code toggle exposes Python, Terminal, and edit_file instead of an unavailable hosted code_execution tool.
Focused frontend and backend regression tests pass.
Fixes #11557
Before / after
ChatGPT subscription connection, model
gpt-5.6-sol, only Code on, prompt "Use Python to compute 6*7". Left is main (ffa4ff6f9), right is this PR. On main the request asks forcode_execution, Codex is offered no tools and the model answers without running anything. With the PR the request carriespython,terminal,edit_file, the model calls Python and the card shows42. The Codex upstream is stubbed identically on both sides; Studio, its tool loop and the Python run are real.