Repository navigation
Trim comments in studio/frontend chat, model picker and media features - #10114
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. |
|
Moving this to draft. A check that was not run before opening it has now been run, and it fails. Every verification behind this PR looked at what survived: the AST gate proves no code changed, the length rule proves no comment line is over 120 columns, and reading the diff shows sensible comments. None of those can see a fact that was dropped while a comment was being shortened, because the result still reads as a complete, well formed comment. Measuring the other direction, comparing distinctive facts in the base commit's comments (identifiers, filenames, constants, issue references, measured values) against the text that survives, this PR has lost a material fraction of them. Sampling the losses with their original context shows they are not restatements that were correctly removed. Examples of the class:
These are the invariants and measured values the code cannot state, and they are exactly what the pass was supposed to protect. I am running a restoration pass over the affected files and will push an update and mark this ready for review once the fact retention is measured and above threshold. Nothing here should be merged in its current state. The underlying lesson, which is worth more than this PR: a comment-reduction pass cannot be validated by inspecting its output. It has to be validated by sampling what it discarded and what it rewrote, against the original. |
778f42c to
dd054c4
Compare
Comment-only pass over 247 files under studio/frontend/src/features: chat, model-picker, images, video and audio. 16,643 -> 11,674 comment lines (-29.9%) 1,131,625 -> 920,568 comment characters (-18.7%) Every non-pragma comment line is at or under 120 columns. Three lines remain longer, all of them functional and untouchable: two biome-ignore directives in research-api.ts and one eslint-disable-next-line in chat-page.tsx. Nothing outside comments changes: no code, string literals, licence headers or pragmas. JSX comment expressions have their text shortened in place, never removed, since deleting the braces removes an AST node. Verified with an AST code-only signature of every file against the base commit. The reduction here is smaller than in the backend PRs for a structural reason. About 3,400 of the surviving comment lines are JSDoc, which is visible in editor tooltips and IntelliSense, so the blocks are shortened but never deleted. Removing them would be an API surface change rather than a comment cleanup. One pre-existing defect is fixed in passing: chat-runtime-store.ts had an unterminated JSDoc block in the base commit that swallowed text up to the next block terminator. It is replaced with a well formed two line block.
dd054c4 to
83bd0c3
Compare
|
@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: b42a3bbdd3
ℹ️ 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".
| // Gemini ships grounded search on chat-capable models. Most image-tier ids reject text-tool | ||
| // wiring, but Google documents it on the Gemini 3 image family, so allow only there. | ||
| // Custom Gemini OpenAI-compat proxies skip the native translator, so hide the pill. | ||
| // Output comes back inline as executableCode / codeExecutionResult parts. |
There was a problem hiding this comment.
Describe web-search output instead of code-execution parts
Remove or relocate this sentence because executableCode and codeExecutionResult are Gemini code-execution parts, not the output of the googleSearch capability documented by this branch. The backend tracks googleSearch through grounding metadata in external_provider.py, while those two parts are translated only by the code-execution path, so this comment gives maintainers the wrong protocol contract when changing web-search gating.
Useful? React with 👍 / 👎.
| let mcpImages: McpImageToolResult | null = null; | ||
| if (mcpImgIdx !== -1) { | ||
| // The backend uses the same dir when there is no session_id; see tools.py _get_workdir. |
There was a problem hiding this comment.
Keep the sandbox-directory note beside the fallback ID
Move this note back to the later sandboxSessionId || "_default" fallback. This branch only parses an MCP image envelope and neither reads a session ID nor selects a working directory, so the newly inserted comment falsely suggests that _get_workdir is an invariant of MCP image parsing and obscures why this conditional exists.
Useful? React with 👍 / 👎.
| // the already-trusted LTX-2 base for the VAE / Gemma3 encoder) plus the GGUF quants, which | ||
| // keep the ~50 GB encoder in bf16 so consumer GPUs route to GGUF. Keyed on the artifact that |
There was a problem hiding this comment.
Attribute the BF16 encoder burden to single-file artifacts
Rewrite this sentence so the relative clause refers to the BF16/FP8 single-file checkpoints rather than the GGUF quants. Those single-file artifacts retain the roughly 50 GB encoder in BF16, which is the reason consumer devices route to the separate GGUF artifact; the new wording instead says the GGUF variants carry that burden and then concludes that users should route to them, reversing and internally contradicting the catalog's routing rationale.
Useful? React with 👍 / 👎.
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. 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". |
|
You have reached your Codex usage limits for security reviews. Please try again later. |
Some tests locate a region of the frontend by indexing on a comment's exact text, so to them a comment is an identifier and deleting one is deleting a symbol. #10114 trimmed ten of them, and 71 tests in tests/studio have been failing on main since it merged. Restored verbatim from 7580935^, comments only. Reflowing counts as deleting here. Most of these were not removed, they were rewrapped onto one line or had a second line dropped, which reads as harmless and breaks the lookup exactly the same way. One was failing silently, which is worse. The deep research contract splits the adapter on "// Project sources auto-scope" rather than indexing it, and split does not raise when the marker is gone, it returns the whole remainder. Four assertions were being checked against about two thousand lines of unrelated source and passing. The suite was green and proving nothing. tests/studio: 7475 passed, 0 failed, from 7404 passed and 71 failed.
…lothai#10297) `Repo tests (CPU)` was red on `main`, and so on every PR branched from it, with 93 failures out of 15,899. Almost all were one line in the harness, `slice_between` raising `ValueError: substring not found`. `studio/frontend` carries no JS test runner, so these tests slice the real source verbatim into a node harness and run it. Many of the markers delimiting those slices were comments. unslothai#10114 trimmed comments across 245 frontend files, moving no behaviour at all, and 93 tests went red. A comment is prose about the code, not the code, and a comment-only PR is the clearest case of a change these tests should not be able to see. This anchors the slices on the declaration or statement each comment sat above, 30 anchors across 14 files, including ones that still matched today and would have broken on the next trim. Every replacement was checked against the source as it stood immediately before unslothai#10114, where the old markers still resolve, and required to sit on the same side of the same code with nothing but comments and whitespace in between, so each slice covers the statements it covered before. Each new anchor occurs exactly once in the file it is read from. `slice_between` now refuses a comment anchor outright, including the JSX `{/* ... */}` form, rather than failing later with `substring not found` several frames away. One replacement was worth the care: the obvious end anchor for the images header, `{pageMode === "train" ? (`, first matches 3.4k characters BEFORE the comment it replaces, so it would have quietly shortened the slice and weakened the test rather than failing. Pinning it to the following `<DiffusionTrainPanel` line is unique and lands where the comment did. Verified by breaking it. Seventeen edits to `studio/frontend`, each run against the test file that reads it: seven comment-only edits (trimming an anchor's own comment again, deleting one entirely, dropping a docblock, adding a new comment, rewording the two JSX comments, rewording the usage-examples comment) all pass, and ten real regressions all still fail. Three began as bad mutations of mine that passed when they should have failed, and were rewritten. Next to what a plain re-sync of the literals would give, on the anchor that took 56 of the 93 down: | | re-synced literal | this change | | --- | --- | --- | | baseline | 58 passed | 58 passed | | that comment trimmed again | 56 failed, 2 passed | 58 passed | A re-sync gets `main` green today and goes red again on the next comment edit, which is the same edit unslothai#10114 made. `tests/studio`: 7483 passed, 195 skipped. No source changes. Staging CI green.
#10297 fixed this properly: the studio slice tests now anchor on the declaration each comment sat above, and slice_between refuses a comment anchor outright rather than failing several frames later. Restoring the comment text only re-synced the literals, which goes red again on the next trim, as that PR sets out. This returns the branch to its one job, the facts #10114 dropped.
* Restore the facts the frontend comment trim reworded away * Correct three restored facts that no longer matched the code * Put back the comments the tests read as landmarks Some tests locate a region of the frontend by indexing on a comment's exact text, so to them a comment is an identifier and deleting one is deleting a symbol. #10114 trimmed ten of them, and 71 tests in tests/studio have been failing on main since it merged. Restored verbatim from 7580935^, comments only. Reflowing counts as deleting here. Most of these were not removed, they were rewrapped onto one line or had a second line dropped, which reads as harmless and breaks the lookup exactly the same way. One was failing silently, which is worse. The deep research contract splits the adapter on "// Project sources auto-scope" rather than indexing it, and split does not raise when the marker is gone, it returns the whole remainder. Four assertions were being checked against about two thousand lines of unrelated source and passing. The suite was green and proving nothing. tests/studio: 7475 passed, 0 failed, from 7404 passed and 71 failed. * Revert the anchor restorations, superseded by #10297 #10297 fixed this properly: the studio slice tests now anchor on the declaration each comment sat above, and slice_between refuses a comment anchor outright rather than failing several frames later. Restoring the comment text only re-synced the literals, which goes red again on the next trim, as that PR sets out. This returns the branch to its one job, the facts #10114 dropped.
Comment-only pass over 247 files under
studio/frontend/src/features:chat,model-picker,images,videoandaudio.What changed
Removed: restatements, section banners, spacer lines, per-consumer enumerations and measured tables whose conclusion is already stated. Long rationale paragraphs are rewritten to the claim plus at most one number or citation.
Every non-pragma comment line is at or under 120 columns. Three lines remain longer and are all functional: two
biome-ignoredirectives inresearch-api.tsand oneeslint-disable-next-lineinchat-page.tsx.Safety
Nothing outside comments changes. No code, string literals, licence headers or pragmas are touched.
JSX comment expressions have their text shortened in place and are never removed, since deleting the braces removes an AST node. Verified with an AST code-only signature of every file against the base commit; all 247 report
code unchanged (comments only).Why this cut is smaller than the backend ones
About 3,400 of the surviving comment lines are JSDoc. JSDoc is visible in editor tooltips and IntelliSense, so these blocks are shortened but never deleted; removing them would be an API surface change rather than a comment cleanup. That places a floor on this directory that the backend PRs do not have.
One pre-existing defect fixed in passing
chat-runtime-store.tshad an unterminated JSDoc block in the base commit, which swallowed text up to the next block terminator. It is replaced with a well formed two line block.