Skip to content

test(dashboard): let the credential panel count settle before asserting it - #4609

Merged
huangruiteng merged 3 commits into
mainfrom
codex/credential-panel-settle
Sep 16, 2026
Merged

huangruiteng merged 3 commits into
mainfrom
codex/credential-panel-settle

Conversation

@huangruiteng

Copy link
Copy Markdown
Collaborator

What this changes

One file: examples/personal-workspace-browser/typed-actions.mjs (+30/−4).

The model-provider category assertion waited for one credential panel to become visible and then took a one-shot count:

await page.locator(".personal-operator-credential").waitFor({ state: "visible" });
if (await page.locator(".personal-operator-credential").count() !== 1) {
  throw new Error("The model provider category did not host exactly one credential panel");
}

A category switch is a state transition, not a settled fact — operator-credential-settings.tsx renders exactly one such section and workspace-settings-page.tsx mounts it only when tab === "provider", so a count taken during the switch can observe the pane mid-mount. The message also cannot say whether the page hosted zero or two panels.

The assertion now waits for exactly one panel and, when the count never settles, fails with every matching node, its owning section and its visibility. The count settles before the visibility check rather than after it, because two matching panels also make a strict-mode locator wait throw before the count is ever reached. Strength is unchanged: exactly one visible credential panel inside the model-provider category, with the readback labels still asserted below.

Why

The required dashboard-acceptance job failed on that exact line for PR #4593 (job 104993039159) and PR #4604 (job 104993254031) after both branches were rebased onto the repaired main, while the same tree passed on main's own Python Tests run 35153053876. That is the same class as the steward-picker assertion repaired in #4607, which the required check then accepted.

Validation

$ node --check examples/personal-workspace-browser/typed-actions.mjs        # ok
$ LOOPX_PERSONAL_WORKSPACE_SCENARIO=typed-actions node examples/personal-workspace-browser-smoke.mjs
personal-workspace-browser-smoke (development): ok

CI on this head runs the full required set; this PR exists because the failure it repairs is intermittent on CI and does not reproduce locally.

Boundary

Smoke-only change to a public example. No runtime, permission, scoring, submission or benchmark behaviour, no private state, and no benchmark launch.

…ng it

The model-provider category assertion waited for one credential panel to
become visible and then took a one-shot count. A category switch is a state
transition, not a settled fact, so that count can still observe the pane
mid-mount: the required dashboard-acceptance job failed on that line for #4593
and #4604 while the same tree passed on main's own Python Tests run, and a
one-shot count cannot say whether the page hosted zero or two panels.

The assertion now waits for exactly one panel, and when the count never settles
it names every matching node with its owning section and visibility, so the next
CI failure is attributable without a machine that reproduces it. Because two
matching panels also make a strict-mode locator wait throw, the count settles
before the visibility check instead of after it.

Assertion strength is unchanged: exactly one visible credential panel is still
required inside the model-provider category, and the readback labels are still
asserted below.

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>
Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng 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.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: 1c8c8d1

动机

必需的 dashboard-acceptance 在 PR #4593(job 104993039159)与 #4604(job 104993254031)上红在 examples/personal-workspace-browser/typed-actions.mjs:1054('The model provider category did not host exactly one credential panel'),而同一棵代码树在 main 自己的 Python Tests run 35153053876 上是绿的。原断言先等面板可见、再一次性取 count,既可能在分区切换过程中读到未稳定的状态,也无法说明当时是 0 个还是 2 个匹配节点。

改动思路

把可见即可改成数量收敛后再断言,并在始终不收敛时打印所有匹配节点、其所属 section 与可见性,让下一次 CI 失败无需本机复现即可归因。因为匹配到两个节点时 strict-mode 的 locator wait 会先抛错,所以把数量收敛放在可见性检查之前。断言强度不变:模型 Provider 分区内仍然必须恰好有一个可见凭据面板,下面的 readback 标签断言保持原样。

具体改动

只改 examples/personal-workspace-browser/typed-actions.mjs:新增 waitForSelectorCount 有界等待与失败诊断,并用它替换原来的 waitFor + 一次性 count。

对主干的风险

测试专用、公开 smoke:不触碰 runtime、权限、评分、提交或 benchmark 启动路径,不含私有状态与本地路径。唯一行为变化是失败信息更具体与等待收敛,它不会掩盖面板错误地渲染两份,因为要求的数量没有放宽。

我的整体评价

Approve。本 head 只多加了一条把已更新 main 合入的、带 sign-off 的合并提交。证据:该修复所在的必需检查 dashboard-acceptance 已在 CI 上通过(run 35156959332,job completed success),而同一个 job 在未含此修复的 #4593/#4604 上仍然失败;本地 typed-actions 场景通过。

English verdict: APPROVE

Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com>

@huangruiteng huangruiteng 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.

Approval conclusion (author-owned PR; GitHub blocks formal self-approval)

Exact head: f5709d0

动机

必需的 dashboard-acceptance 曾在 PR #4593(job 104993039159)与 #4604(job 104993254031)上红在 examples/personal-workspace-browser/typed-actions.mjs:1054,而同一棵代码树在 main 自己的 Python Tests run 上是绿的。原断言先等面板可见、再一次性取 count,既可能在分区切换过程中读到未稳定的状态,也无法说明当时是 0 个还是 2 个匹配节点。

改动思路

把可见即可改成数量收敛后再断言,并在始终不收敛时打印所有匹配节点、其所属 section 与可见性;因为匹配到两个节点时 strict-mode 的 locator wait 会先抛错,所以数量收敛放在可见性检查之前。断言强度不变。

具体改动

只改 examples/personal-workspace-browser/typed-actions.mjs(+30/−4)。本 head 另外包含把已更新 main 合入的两条带 sign-off 的合并提交,被测内容不变。

对主干的风险

测试专用公开 smoke:不触碰 runtime、权限、评分、提交或 benchmark 启动路径,不含私有状态与本地路径。唯一行为变化是失败信息更具体与等待收敛,不会掩盖面板错误地渲染两份。

我的整体评价

Approve。证据:该修复所在的必需检查 dashboard-acceptance 已在 CI 上通过(run 35156959332),且整轮检查在重跑 attempt 2 后 23 项全绿(run 35160014878 completed success)——同一批 job 在未含此修复的 #4593/#4604 上仍然失败;本地 typed-actions 场景通过。

English verdict: APPROVE

@huangruiteng
huangruiteng merged commit 1ef4d71 into main Sep 16, 2026
23 checks passed
@huangruiteng
huangruiteng deleted the codex/credential-panel-settle branch September 16, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant