Repository navigation
test(console): pin the workspace, service-account and diagnostics paths - #2927
Conversation
Bughunt-127 found four console paths whose mutants survived every test (findings 1996, 1997, 2008, 2009). Each new test fails under the named mutant and passes on main: - console-form-fields-2: a workspace Reload that answers 404 drops the oversized file's field error; a service-account source saved with no account shows its error under the select, with focus. - console-status-block (appended): Run diagnostics follows Agent operate only (operate-not-update member enabled, update-not-operate member disabled with its reason) and stays enabled when the permission answer is withheld; a Configuration save conflict or unknown outcome scrolls its message into view; a successful diagnostics run does not scroll.
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR adds eight browser tests for workspace error cleanup, service-account validation, diagnostics permissions, and scrolling. Example: Enter 16,385 ASCII characters in AGENTS.md, attempt Save, then Reload after the file disappears.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep open for maintainer triage: this PR adds useful, distinct regression coverage for existing console behavior, with no actionable defects found. Priority: P3 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherThe browser console consumes OCC API responses and permission summaries to render Agent controls, validation feedback, focus, and scroll position; these tests exercise that console with real application fixtures and selected intercepted responses. flowchart LR
A[Browser test actions] --> B[Console Agent page]
B --> C[OCC application fixture]
C --> D[Native IAM evaluator]
E[Selected response fakes] --> B
B --> F[Visible state and request assertions]
Technical reviewBest possible solution: Retain the focused browser coverage alongside the existing console behavior and CI suite ownership. Do we have a high-confidence way to reproduce the issue? This test-only PR reports coverage gaps rather than a current product bug; its mutation table identifies concrete regressions, but those experiments were not rerun during this read-only review. Is this the best way to solve the issue? The tests exercise real console outcomes through existing browser fixtures, isolate distinct failure paths, and avoid changing production interfaces. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against b10157ca98de. TestingProof path: in-process harness. SecurityNone. EvidenceWhat I checked:
Likely related people:
Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (1 earlier review cycle)
Reviewed October 19, 2026, 7:33 AM ET / 11:33 UTC (Revision 2). |
…n the wait Internal review nits: the 503 permission answer comes from withholdPermissionSummary instead of a copy, and the comment says why the permission-answer wait is settled by the time it resolves.
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
Problem
bughunt-127 found four console paths that no test pins: a mutant of each survived the browser suites that cover it.
workspace.mjssetFieldError(editor, '')in the 404 branch). Dropping that call left the emptied editor witharia-invalid=trueand the 16 KiB error.harness-auth.mjsaccount.required = method.value === 'service_account'). Withaccount.required = false, the message appeared only in the grey status line.detail.mjspermissions?.operatepassed to the diagnostics panel), or that an unknown permission answer keeps it enabled (permitted === false).feedback.scrollIntoViewafter a conflict or unknown outcome, or that a successful Run diagnostics result does not scroll (if (error)beforeoutcome?.scrollIntoView).Change
This PR changes tests only. It adds no product code.
tests/browser/console-form-fields-2.test.mjsgets two tests after the existing workspace field-error test:the workspace file editor drops an oversized file's error when Reload finds no file: Save shows the oversized-file error. The file GET then answers 404NOT_FOUND, and Reload empties the editor, says the file is missing, removes the error and clearsaria-invalid.the authentication source form shows a missing service account under its field: the Agent is a Codex dedicated Agent with no harness auth. The test chooses the service account source and saves with no account selected. The error appears under the select, linked witharia-invalid, and the select has focus. No browser bubble shows and nothing is written.tests/browser/console-status-block.test.mjsgets six tests, appended after its last test. No existing test changes.Run diagnostics is enabled for a member with operate but not update: the button is enabled and one POST is sent.Run diagnostics is disabled for a member with update but not operate: the button is disabled with its reason, and no POST is sent.Run diagnostics is enabled for an administrator whose permission answer is withheld: the permissions read answers 503. The button is enabled and one POST is sent.a Configuration save conflict brings its message on screenanda Configuration save unknown outcome brings its message on screen: the PATCH is held until released. While it is held, the page is scrolled so that Save sits at the bottom of the screen, and the test asserts that the message line starts below the fold. After release, Reload draft has focus and the message is fully on screen.a successful Run diagnostics leaves the page where it was: the page clock is paused so the waiting line never shows. With the button at the bottom of the screen, the result lands below the fold,scrollYdoes not change and the button keeps focus.The enabled-button cases wait for a deterministic signal: an init script marks when the page has read the permission answer's body, and the console settles the button in that same microtask checkpoint. The tests use hold-until-released fakes and no wall-clock windows.
Verification
Every mutant below was applied as a temporary edit, run against the new tests, then reverted. Each new test passes on main.
workspace.mjs:180dropsetFieldError(editor, "")harness-auth.mjs:224account.required = falsedetail.mjs:2657?.operate→?.updatedetail.mjs:2657?.operate→?.deletedetail.mjs:1153permitted === false→!permitteddetail.mjs:4433dropfeedback.scrollIntoView(...)detail.mjs:998if (error)→if (true)taskset -c 6,7).console-form-fields-210/10 andconsole-status-block19/19.prettier --checkandeslint --max-warnings 0pass on both touched files.scripts/ci/test-suites/checks-browser-2.json. No new test file was added.Open PRs that touch these files, checked with
git merge-tree --write-tree:console-form-fields-2.test.mjsNo other open PR touches
console-status-block.test.mjs. The new tests there are appended at the end of the file and leave the middle of the file untouched.Risks
The risk is low because the PR adds tests only. The withheld-answer test depends on the console reading the permissions response with
Response.prototype.json. If that changes, the signal never fires, and the test fails loudly instead of passing.