Repository navigation
Studio: stop dropping the page text after a menu with no closing tag - #13489
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. |
NilayYadav
left a comment
There was a problem hiding this comment.
Review + reproduction evidence
Pinned review: 574aa89c518f6fdd52a0f86955eca979fed9c3da. 4 findings, fixed in 52c9826 and 574aa89; 2 minor items open (below).
I reproduced the bug in Studio chat on fresh upstream main (Linux, NVIDIA L4, Chrome 1440x900, Qwen3-4B-Instruct-2507 GGUF UD-Q4_K_XL, Search on): ask the model to read https://go.dev/doc/install with the web tool.
- main
5f38afb: the tool card shows(page returned no readable text)(32 chars) and the model answers "The tool returned no readable text." Same forhttps://go.dev/doc/effective_go. Converting the saved pages directly: effective_go, ref/spec, doc/install, the getting-started tutorial and dl/ all come out as 0 chars. - PR head
574aa89: the tool returns the page (2757 chars, starting# Download and install), and the model quotes "Download and install Go quickly with the steps described here." Effective Go returns 16162 chars, cut to the fetch budget. The direct conversions come out at 102964 / 254099 / 2757 / 6071 / 1548626 chars.
- Unchanged pages: docs.python.org and kubernetes.io return byte-identical tool output on main and head (15741 and 10684 chars). Across 68 saved real pages (Wikipedia, MDN, GitHub, Rust, Node, Hugging Face, news sites, readthedocs and others), each converted with and without main-content scoping, head matches main on every page except the go.dev ones.
- Tests:
test_web_fetch_extraction.pyruns 1273 tests. The 8 new cases fail on main and pass on head; the rest pass on both. - Fixes pushed:
- The first version made end-tag lookup inside a skipped subtree quadratic. With 10k
<li>and stray</a>inside a<nav>, a conversion took 6.6 s on head against 0.09 s on main. The skip stack and the open-tag stack are now indexed, so the same input takes 0.09 s. Large real pages stay within 5% of main. - End tags from outside a
<template>no longer reveal its inert content. - Regression tests cover both fixes.
- The first version made end-tag lookup inside a skipped subtree quadratic. With 10k
Still open (minor, only on misnested markup, and no real page in the set above hits them): an end tag of an open ancestor ends the skip even when browsers keep the text inside the skipped element. This covers </form>, inline end tags such as </span>, </a> and </b>, a </div> crossing a <select>, and a table cell boundary. I checked each against the DOM in Chrome and WebKit. When that happens the leftover menu or option text shows up in the output; no page text is lost. The tight fix is to end the skip only on block and list end tags (div, li, ul, section, headings, table parts and similar) whose ancestor is in scope.
Conclusion: the bug is real and the fix works. Every go.dev doc page was unreadable to the model, and now it reads them; pages whose menus close normally convert exactly as before. Ready once CI is green on 574aa89. The misnested-markup item above can be a small follow-up.
Review/fix evidenceI reviewed this at merge base Findings repaired
The first scope tests were run against the original PR head Verification
Studio before/afterThe Studio UI was installed independently from the recorded merge base and pushed repaired head (explicit refs above). The same local model invoked the real The recovery rules were checked against the HTML parsing standard. |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c3893f10c9
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 0de35080b6
ℹ️ 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".
|
@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: bbe1e5c3f1
ℹ️ 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".
| self._skip_tags | ||
| and tag in _TABLE_ONLY_START_TAGS | ||
| and self._last_skip_position("table", "html") < 0 | ||
| ): | ||
| self._prepare_table_start(tag) |
There was a problem hiding this comment.
Avoid reconciling foreign table tags as HTML cells
For <table><tr><td>Outer<svg><g><td>SVG SECRET</td></g></svg>Visible</td></tr></table>, the inner td remains in the SVG namespace because it is not a foreign-content breakout tag, so it should stay suppressed with the SVG. Here _in_table is true and there is no HTML table in _skip_tags, so this branch calls _prepare_table_start, which clears the SVG skip and closes the outer cell; SVG SECRET is emitted and the table layout is corrupted. Require the pending tag's skipped namespace to be html before performing table recovery.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Below the bar: an HTML start tag nested inside an inline within a table cell is not markup real pages ship; SVG has no td element.
|
Codex Review: Didn't find any major issues. Delightful! 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 the model fetched a page whose menu or footer is closed by the end tag of the element around it, instead of its own end tag, Studio dropped everything after that menu. Every go.dev page (Effective Go, the language spec, the install guide, the tutorials, the downloads page) came back as "(page returned no readable text)", so the model could not read Go's official docs at all. Browsers close the menu at that point and show the rest of the page.
Skipped page parts such as navigation, footers, icons and buttons now also end when the element that contains them ends, the same way browsers read the page. The skipped parts stay out of what the model reads, and pages whose menus close normally convert exactly as before.