Repository navigation
Fix three frontend contract tests that main is red on - #8703
Conversation
All three assert against source text, so a refactor that keeps the behaviour can still turn them red. That is what happened here, and the result is that every PR branching off main inherits a red Repo tests (CPU) job it did not cause. The clipboard contract reads clipboard-files.ts, but #8472 moved the DataTransfer half into clipboard-payload.ts when long pastes became attachments. The strings it looks for are all still there, just in the sibling file, so it now reads both as the one contract they always were. The title contract pins the exact line that reads the first user message. #8472 replaced extractTextParts with titleTextOf, which wraps it and appends an attachment sample for a user turn. The first user message still titles the thread, so the assertion follows the rename, plus one on titleTextOf itself so the indirection cannot quietly drop the text. The font-scale contract is the one real finding: attachment.tsx used a raw text-[11px], which ignores the UI font size preference, so that label stayed fixed while the rest of the UI scaled. Swapped for the text-ui-11 token, which is the same 11px at scale 1.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3b18450737
ℹ️ 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".
| helper = CLIPBOARD_FILES.read_text(encoding = "utf-8") + CLIPBOARD_PAYLOAD.read_text( | ||
| encoding = "utf-8" | ||
| ) |
There was a problem hiding this comment.
Keep clipboard parsing assertions tied to the paste helper
Concatenating these sources lets the contract remain green if clipboard-files.ts stops importing and calling browserClipboardFiles, clipboardAdvertisesFiles, and clipboardHasPlainText: the asserted DataTransfer logic would still exist in clipboard-payload.ts for the independently wired pasted-text path, while the composer assertions only prove they call pasteClipboardFiles. Browser file pasting could therefore fall through without this test detecting it; assert the delegation from CLIPBOARD_FILES explicitly or test each helper separately.
Useful? React with 👍 / 👎.
| in generate_block | ||
| ) | ||
| title_block = " ".join(_balanced_block(source, "function titleTextOf").split()) | ||
| assert "const text = extractTextParts(m);" in title_block |
There was a problem hiding this comment.
Verify extracted text flows out of titleTextOf
This assertion only proves that titleTextOf calls extractTextParts; it does not verify that the extracted text participates in the return value. If the attachment-title logic later returns only attachmentsSample(...) or otherwise discards text, a text-only first user followed by a tool-call-only assistant will fall back to New Chat, while every assertion in this test remains green. Assert the relevant return paths or cover this scenario behaviorally.
Useful? React with 👍 / 👎.
#8586 went in as a single squashed commit, so main's copy of that work shares no history with the copies this branch merged, and git saw every line the two have in common as a conflict. Resolved file by file: * install.sh, studio/setup.sh and tests/sh/test_uv_pinned_release.sh are #8586's alone and this branch never touched them, so they take main's version whole. That is also the newer one: #8586 gained commits after the last merge here. * install.ps1, six hunks. The Studio launcher command, the launch-studio.ps1 byte comparison and its Unblock-File rationale stay this branch's, since they are #8586's substance plus this branch's changes on top. The UNC launcher check, the uv source-precedence comment and the staged-probe comment take main's: all three are newer there, and the UNC one now covers mapped drives through DriveInfo, which the version here did not. * studio/setup.ps1 takes main's on both hunks. It reads the pinned-install verdict off a script-scope flag rather than the pipeline, because Invoke-SetupCommand returns [int]$LASTEXITCODE and not the block's value, so the Select-Object form here could not have driven the winget fallback at all. * studio/src-tauri/src/process.rs, one region where both sides added disjoint functions: this branch's managed CLI invocation builders and main's working-directory and environment context helpers. Both kept. The conflict cut through build_managed_cli_command_tokio, whose closing brace was on the far side, so that had to be put back by hand. * preflight/managed.rs merged clean but not correct: main widened run_cli_probe and probe_cli_capability to Result so a context failure can be told apart from a bad install, and the two early returns this branch added still handed back bare values. They return Ok(false) and Ok(None): a venv with no interpreter beside the launcher is a verdict, not a failure to ask. Verified on the merged tree: 4657 Python tests, 359 Rust tests, every PowerShell suite, and #8586's test_uv_pinned_release.sh. The three frontend contract tests and test_amd_venv_repair_loop.ps1 that were red on this branch an hour ago are green, fixed by #8703 on main.
#8586 went in as a single squashed commit, so main's copy of that work shares no history with the copies this branch merged, and git saw every line the two have in common as a conflict. Resolved file by file: * install.sh, studio/setup.sh and tests/sh/test_uv_pinned_release.sh are #8586's alone and this branch never touched them, so they take main's version whole. That is also the newer one: #8586 gained commits after the last merge here. * install.ps1, six hunks. The Studio launcher command, the launch-studio.ps1 byte comparison and its Unblock-File rationale stay this branch's, since they are #8586's substance plus this branch's changes on top. The UNC launcher check, the uv source-precedence comment and the staged-probe comment take main's: all three are newer there, and the UNC one now covers mapped drives through DriveInfo, which the version here did not. * studio/setup.ps1 takes main's on both hunks. It reads the pinned-install verdict off a script-scope flag rather than the pipeline, because Invoke-SetupCommand returns [int]$LASTEXITCODE and not the block's value, so the Select-Object form here could not have driven the winget fallback at all. * studio/src-tauri/src/process.rs, one region where both sides added disjoint functions: this branch's managed CLI invocation builders and main's working-directory and environment context helpers. Both kept. The conflict cut through build_managed_cli_command_tokio, whose closing brace was on the far side, so that had to be put back by hand. * preflight/managed.rs merged clean but not correct: main widened run_cli_probe and probe_cli_capability to Result so a context failure can be told apart from a bad install, and the two early returns this branch added still handed back bare values. They return Ok(false) and Ok(None): a venv with no interpreter beside the launcher is a verdict, not a failure to ask. Verified on the merged tree: 4657 Python tests, 359 Rust tests, every PowerShell suite, and #8586's test_uv_pinned_release.sh. The three frontend contract tests and test_amd_venv_repair_loop.ps1 that were red on this branch an hour ago are green, fixed by #8703 on main.
What changed
Repo tests (CPU)is currently failing onmain, so every branch cut from it inherits a red job it did not cause. Three tests, all of which assert against source text rather than behaviour, which is why a refactor that kept the behaviour still turned them red.Clipboard paste. The contract reads
clipboard-files.tsand looks forclipboardData.files,item.getAsFile()and friends. #8472 moved the DataTransfer reading half intoclipboard-payload.tswhen long pastes became attachments. Every string it wants is still present, just in the sibling file, so it reads both as the one contract they always were. No behaviour change.Title generation. The contract pins the exact line that reads the first user message. #8472 replaced
extractTextPartswithtitleTextOf, which wraps it and appends an attachment sample for a user turn. The first user message still titles the thread, so the assertion follows the rename. I added one more ontitleTextOfitself, so the new indirection cannot quietly stop reading the text and leave the test passing on a name alone.Font scale. This one is a real finding rather than a stale assertion.
attachment.tsxused a rawtext-[11px], which ignores the UI font size preference, so that attachment size label stayed fixed while everything around it scaled. Swapped for thetext-ui-11token, which is the same 11px at scale 1 and scales from there.Testing