Repository navigation
fix(api): accept bash as a terminal tool alias - #18084
Merged
danielhanchen merged 3 commits intoNov 17, 2026
Merged
Conversation
… terminal [skip ci]
Member
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. 🎉 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
danielhanchen
added a commit
that referenced
this pull request
Nov 17, 2026
… -bf16 check by its new call (10 failures since #18061) (#18110) `tests/python/test_loader_resolution_reporting.py` has 10 failures on main in the CPU `studio` shard since #18061 (seen on the staging runs of #18084 and #18087): ``` unsloth/models/loader.py:1555: in <module> if bf16_repo_loads_16bit(model_name, load_in_16bit): E NameError: name 'bf16_repo_loads_16bit' is not defined test_adapter_base_resolution_updates_report_before_base_config_load[*] E StopIteration ``` This is the same root cause as #18096, in a second harness that test did not cover. ## Cause The test runs slices of the real `from_pretrained` bodies in a hand-built scope. #18061 moved the inline `model_name.lower().endswith("-bf16") and (...)` check into `mapper.bf16_repo_loads_16bit`, which is correct, but: - the scopes do not define `bf16_repo_loads_16bit`, so 8 cases die with `NameError`; - the adapter test found the end of its slice by the `if model_name.lower().endswith(...)` statement in the `is_peft` block, which no longer exists, so `next()` raises `StopIteration`. ## Fix - `_mapper_function` lifts the real `bf16_repo_loads_16bit` out of `mapper.py` by AST (the file deliberately avoids importing unsloth), and each scope gets it, so the check runs for real instead of being stubbed. - `_is_bf16_check` finds the slice end by either form (the helper call or the old inline check). ## Verification - main: 10 failed, 2 passed. - this branch: 12 passed.
1 of 5 tasks
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
bashas anenabled_toolsvalue, but the built-in shell tool is namedterminaland built-ins are filtered by exact name, so"enabled_tools": ["bash"]silently dropped the shell tool.bashis now mapped toterminalby a field validator onenabled_toolsinChatCompletionRequest,ChatCountTokensRequestandAnthropicMessagesRequest, so/v1/chat/completions,/v1/messagesand token counting all see the canonical name (tool selection, the confirmation gate and sandbox checks included).terminal. The docs are corrected separately in unslothai/docs#50.Verification
python -m pytest -q studio/backend/tests/test_full_access_tool_prompt.py(57 passed); the new test fails with the validator reverted (['bash', 'python'] != ['terminal', 'python']).enabled_tools(except the live-servertest_studio_api.py): 8906 passed, 0 failed.