Skip to content

Studio: search for llama.cpp and other file names in the address bar - #13661

Merged
danielhanchen merged 4 commits into
unslothai:mainfrom
NilayYadav:address-bar-dotted-search
Oct 14, 2026
Merged

danielhanchen merged 4 commits into
unslothai:mainfrom
NilayYadav:address-bar-dotted-search

Conversation

@NilayYadav

@NilayYadav NilayYadav commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

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.cpp in the Studio browser address bar and pressing Enter. Before: the bar resolves to https://llama.cpp and 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.

Before and after: llama.cpp in the address bar

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T16:01:40.352130Z bc9f470 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 8eba631: host:port inputs stay hosts (test asserts build.ts:8443).

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

NilayYadav added a commit to NilayYadav/unsloth that referenced this pull request Oct 13, 2026
NilayYadav added a commit to NilayYadav/unsloth that referenced this pull request Oct 13, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in 4108b24: only bare names without / ? # : are searched (test asserts build.ts/admin).

@NilayYadav NilayYadav left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.json and model.safetensors open https://llama.cpp etc. 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.cpp with 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.

PR 13661 before/after

  • 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.md and main.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:8443 and build.ts/admin were sent to search on the first version; they now open as hosts exactly as on main, so only the bare name.ext form 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.

@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

1 similar comment
@NilayYadav

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 4108b242c1

ℹ️ 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".

@carlitogwapito

Copy link
Copy Markdown
Contributor

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 studio/frontend with:

node --experimental-strip-types --test --test-concurrency=1 tests/browser-address-boundaries.test.ts

I'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.

@danielhanchen

Copy link
Copy Markdown
Member

@codex review

1 similar comment
@danielhanchen

Copy link
Copy Markdown
Member

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: bc9f4709ed

ℹ️ 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".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants