Repository navigation
Studio: keep Claude's web search to the sites it asks for - #14046
Conversation
Codex Review SummaryThis 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. |
|
The Appending |
|
@codex review |
NilayYadav
left a comment
There was a problem hiding this comment.
Review + reproduction evidence
Pinned review: ff53c72922ac58c458c1ef17c00675570ed1898b. 3 findings, fixed in a2a1886a and ff53c729; 1 pre-existing gap left for a follow-up (below).
I reproduced a web search with a site list through the claude CLI (2.1.302, same environment unsloth start claude sets) against Studio on fresh upstream main (Linux, NVIDIA L4, unsloth/Qwen3-4B-Instruct-2507-GGUF Q4_K_M):
- main
db0e78c1:allowed_domains: ["docs.python.org"]returned 0 of 5 links on docs.python.org (geeksforgeeks.org, runebook.dev, superfastpython.com, async-concurrency.com x2).blocked_domains: ["wikipedia.org"]returnedhttps://en.wikipedia.org/wiki/Alan_Turingas the first link. - PR head: 5 of 5 links on docs.python.org, and no Wikipedia link for the blocked case. The page fetch the model did next (
docs.python.org/3/library/asyncio-task.html) also stayed inside the list. - Same request with no site list: identical results on main and the PR, and Studio's own chat web search is unchanged.
Fixed on the branch:
allowed_domains: ["docs.python.org/3"]and["docs.python.org/*"]returned400 Invalid website domainon the head as submitted, where main served the request. The upstream Messages API accepts a path after the domain (domain filtering), and the CLI surfaced it asAPI Error: 400to the model. A path entry now limits by its domain (5 of 5 on docs.python.org). Entries with a scheme still get a 400, as they do upstream.allowed_domains: ""or{}was taken as "no limit" (200, Wikipedia in the results). Only a missing or null list means no limit now; anything else that is not a list is a 400./v1/messages/count_tokensreturned 200 for a site list that/v1/messagesrejects. It now validates the same way, before any model switch.
Not covered by this PR: when the resident model is a transformers or MLX model, /v1/messages still ignores the site lists (unsloth/Qwen3-1.7B with blocked_domains: ["wikipedia.org"] returned en.wikipedia.org/wiki/Alan_Turing). That is the same on main and needs the policy threaded through chat's in-process tool loops, so it is better as its own change.
Tests (web search, domain and count_tokens tests in test_anthropic_messages.py and test_llama_cpp_tool_loop.py, CPU Linux): on main with the new tests overlaid, 8 failed and 40 passed. On this head, 48 passed. All other web search tests have the same result on both sides.
Conclusion: the issue is real on main and fixed on the PR for GGUF models, which unsloth start claude loads by default. With the fixes above it accepts every domain-list shape the upstream Messages API accepts.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ff53c72922
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| if isinstance(entry, str) and "://" not in entry: | ||
| return entry.split("/", 1)[0] | ||
| return entry |
There was a problem hiding this comment.
Reject boolean entries in domain lists
When a client submits blocked_domains: [true], this helper returns the boolean unchanged, and normalize_website_policy later converts it via str(value or "") into the syntactically accepted domain "true". Both Messages endpoints therefore accept a malformed restriction and leave normal web results unrestricted instead of returning invalid_request_error; require every list entry to be a string before path normalization.
Useful? React with 👍 / 👎.
|
Codex Review: Didn't find any major issues. Can't wait for the next one! 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". |
## Summary `Chat UI Tests (extra)` failed on main at `eb0617b6` (run 38980950910) and on #14046 in the same window, with the same error: ``` playwright_chat_ime_i18n.py, line 645: composer.click() Locator.click: Timeout 60000ms exceeded. <p class="mt-1 text-ui-11 text-muted-foreground/70">54 MB download · No restart needed after update</p> from <div data-testid="overlay-rail" ...> ``` The job's screenshot shows the card: "New audio.cpp update, v0.9.1-unsloth.1 to v0.9.2-unsloth.1". The job installed audio.cpp at 00:54 UTC, and `unslothai/audio.cpp` published v0.9.2-unsloth.1 at 01:00:49. Studio's update check then saw the fresh install as one behind and put the card in the bottom-right overlay rail, on top of the composer. This is the same race #14007 fixed for studiobench (a llama.cpp release mid-job), now hitting the Chat UI smoke through the audio.cpp half of the same update item. Neither the product nor the IME script is wrong. Any llama.cpp, whisper.cpp or audio.cpp release that lands during a run can do this to any script in the job that clicks near the bottom-right. ## Change - **`studio-ui-smoke.yml`:** the `ui-smoke` job sets `UNSLOTH_DISABLE_UPDATE_CHECK: '1'` in its job env, with a comment explaining why. - These scripts test chat, not live update checks. - The two update banner scripts in this job stub `/api/studio/update-status`, `/api/llama/update-status` and `/api/llama/update-changelog` with `context.route`, so they do not depend on the live check. - The switch also defers the startup hardware warm, but this job already runs as `chat_only` on the CPU runner (`[ui-extra] chat_only mode: True` in the failing run). Loading a model still triggers detection as before. - **`tests/studio/test_studiobench_ci_update_checks_off.py`:** the existing studiobench guard now covers both workflows. - It is parametrized over `studiobench-ci.yml` and `studio-ui-smoke.yml`. - It requires the switch on every job that runs `boot-studio`. - It also fails if a step-level env sets the switch to anything other than `1`. ## Testing - **Guard:** the guard file gives 3 passed. With the workflow change reverted, it fails with `studio-ui-smoke.yml job 'ui-smoke' boots Studio without UNSLOTH_DISABLE_UPDATE_CHECK=1`. - **Other tests that read `studio-ui-smoke.yml`:** 123 passed. - **The job itself:** this PR changes `studio-ui-smoke.yml`, so its own Chat UI smoke run exercises all shards with the switch on.
|
@codex review |
1 similar comment
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8b20ac8933
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
| declared[key] = entries | ||
| declared = normalize_website_policy(declared) | ||
| for key in policy: | ||
| policy[key] += declared[key] |
There was a problem hiding this comment.
Keep each server tool's allowed-domain scope separate
When one request includes both supported server types (for example, web_search_20250305 allowed only docs.python.org and web_fetch_20250910 allowed only example.com), both are accepted and alias to Studio's single web_search, but this concatenation turns the active tool's allowlist into {docs.python.org, example.com}. A forced web-search call can therefore return example.com even though that tool's own allowed_domains excludes it; retain the selected tool's policy or reject conflicting per-tool scopes instead of unioning allowlists.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Not changing: web_search and web_fetch both map onto Studio's one web tool, which serves search and fetch alike, so the union is what lets each declared scope keep working; intersecting would block both tools, and two server tools with different allowlists in one request is not a shape real clients send.
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. What shall we delve into next? 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". |

When Claude runs on Studio through
unsloth start claudeand limits a web search to certain sites, for example "only docs.python.org" or "skip reddit.com", the limit was dropped. The search ran on the open web, and Claude got back and cited results from sites it had asked to leave out, with no sign that the limit was ignored.The allowed and blocked site lists on Claude's web search tool now reach Studio's own web search. The query is scoped to the allowed sites, and results and page fetches from any other site are left out. An entry with a path, such as
docs.python.org/3, limits to its domain. An entry that is not a domain, such as one withhttps://, or a list that is not a list, gets a 400 error instead of being silently ignored, on both /v1/messages and /v1/messages/count_tokens.Searches without a site list behave as before. This covers GGUF models, which
unsloth start claudeuses by default.