Repository navigation
Studio: search for llama.cpp and other file names in the address bar - #13661
Conversation
|
@codex review |
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. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c966dfbc21
ℹ️ 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".
| // A dotted host (optionally with port and path), no spaces: "docs.unsloth.ai/x", "пример.рф", "example.xn--p1ai". | ||
| const HOST_LIKE = /^(?:[\p{L}\p{N}_-]+\.)+(?:\p{L}{2,}|xn--[a-z\d-]+)(?::\d+)?(?:[/?#]\S*)?$/iu; | ||
| // File extensions that are not TLDs, so "llama.cpp" is a search (.py, .md and .rs are real TLDs). | ||
| const FILE_NAME = /^[^/?#:]+\.(?:cpp|jsx?|tsx?|jsonl?|html?|css|txt|csv|ya?ml|toml|ipynb|gguf|safetensors|bin|pdf|png|jpe?g)(?:[:/?#]|$)/i; |
There was a problem hiding this comment.
Preserve URL-shaped hosts ending in file extensions
When a custom-DNS host ends in one of these strings and the user supplies an explicit numeric port—for example build.ts:8443—both HOST_LIKE and FILE_NAME now match because : is accepted after the extension, so the negation in resolveAddress sends this unambiguously URL-shaped value to the search engine. Such hosts were accepted before this commit, so this regresses private/split-DNS sites; reserve the filename override for the bare-name case, or bypass it when a port is present.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8eba631: host:port inputs stay hosts (test asserts build.ts:8443).
|
@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: 8eba63163d
ℹ️ 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".
| // A dotted host (optionally with port and path), no spaces: "docs.unsloth.ai/x", "пример.рф", "example.xn--p1ai". | ||
| const HOST_LIKE = /^(?:[\p{L}\p{N}_-]+\.)+(?:\p{L}{2,}|xn--[a-z\d-]+)(?::\d+)?(?:[/?#]\S*)?$/iu; | ||
| // File extensions that are not TLDs, so "llama.cpp" is a search (.py, .md and .rs are real TLDs). | ||
| const FILE_NAME = /^[^/?#:]+\.(?:cpp|jsx?|tsx?|jsonl?|html?|css|txt|csv|ya?ml|toml|ipynb|gguf|safetensors|bin|pdf|png|jpe?g)(?:[/?#]|$)/i; |
There was a problem hiding this comment.
Preserve custom-DNS hosts that include URL suffixes
When a split-DNS host ending in one of these extensions includes a path, query, or fragment but no explicit port (for example, build.ts/admin), it still matches both HOST_LIKE and FILE_NAME, so resolveAddress sends it to the search engine instead of returning the https://build.ts/admin navigation produced by the parent. The port-only follow-up removed : from this delimiter branch but leaves /, ?, and #, even though those suffixes make the input URL-shaped too; restrict the filename exception to the bare-name form or otherwise bypass it for these URL suffixes.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 4108b24: only bare names without / ? # : are searched (test asserts build.ts/admin).
NilayYadav
left a comment
There was a problem hiding this comment.
Review + reproduction evidence
Pinned review: 4108b242c14536b571b73f659b0755affcb02336. 2 findings, fixed in 8eba6316 and 4108b242.
I reproduced typing a bare file name into the browser panel address bar on fresh upstream main (Linux Studio; Chromium, Chrome, Firefox and WebKit, 1440x900):
- main
cc7e8aa/ fix reverted (Linux, Windows, macOS):llama.cpp,package.jsonandmodel.safetensorsopenhttps://llama.cppetc. and show "This page couldn't be loaded ... Failed to resolve host: [Errno -2] Name or service not known". The new test fails (not ok 3 - a dotted file or project name is a search, not a host, 6 pass / 1 fail) and every engine resolves 13/22 inputs as expected, the 9 misses being exactly the bare file names ('llama.cpp' -> 'https://llama.cpp'). - PR head (Linux, Windows, macOS): the same names open a search on the chosen engine (
https://www.bing.com/search?q=llama.cppwith Bing selected, first result github.com/ggml-org/llama.cpp). Test file 7/7, and 22/22 inputs as expected in Chromium, Chrome, Firefox, WebKit and Edge.
- Unchanged on both sides:
unsloth.ai,docs.rs/serde,docs.python.org/3,github.com/ggml-org/llama.cpp,huggingface.co/unsloth/x.gguf,README.mdandmain.py(real TLDs),localhost:8888,192.168.1.10:8080,пример.рф, and multi-word searches. None of the listed endings is a delegated TLD in the current IANA list. - Fixes on top of the original commit:
build.ts:8443andbuild.ts/adminwere sent to search on the first version; they now open as hosts exactly as on main, so only the barename.extform changes. Tests cover both. - Frontend typecheck and build pass; the full frontend suite shows no failures this change causes (the same 3 attachment/charset failures are on main). Not on a hot path (one anchored regex per Enter).
Conclusion: real bug, fixed, no regression found on the adjacent inputs across Linux, Windows and macOS and all major browser engines.
|
@codex review |
1 similar comment
|
@codex review |
|
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". |
|
I checked the address resolver directly on Windows with Node 24.15.0: all 3 companion tests passed (76 routing checks). The test-only commit adds query/fragment suffixes, mixed-case filenames and checks across DuckDuckGo, Google, Bing and Brave. No app code changed. You can run it from node --experimental-strip-types --test --test-concurrency=1 tests/browser-address-boundaries.test.tsI'd keep the query/fragment cases next to the port/path controls so a future filename tweak doesn't send URL-shaped input to search. I didn't run browser tests, type checking or full frontend CI. |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Swish! 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". |

Typing a single dotted file or project name such as llama.cpp, node.js, package.json or model.safetensors in the browser panel's address bar opened it as a website, so the tab tried https://llama.cpp and showed the "This page couldn't be loaded" error instead of search results. Adding a second word was the only way to search for it.
A bare name now goes to the chosen search engine when its ending is a common file extension that is not a real top-level domain (cpp, js, ts, json, html, txt, yaml, gguf, safetensors, pdf and a few more). Real addresses keep opening as before, including unsloth.ai, docs.rs, docs.python.org/3 and github.com/ggml-org/llama.cpp, and endings that are real domains such as .py, .md and .ai are left alone.
Before / after
Typing
llama.cppin the Studio browser address bar and pressing Enter. Before: the bar resolves tohttps://llama.cppand the tab shows "This page couldn't be loaded". After: it runs a search on the chosen engine (https://html.duckduckgo.com/html/?q=llama.cpp). Base c174a7d vs head bc9f470, two isolated Studio installs, headless Chromium.