Skip to content

fix(test): wait for create agent to enable after its status line - #3101

Merged
freeqaz merged 3 commits into
mainfrom
fix/test-console-create-agent-enabled-wait
Oct 21, 2026
Merged

freeqaz merged 3 commits into
mainfrom
fix/test-console-create-agent-enabled-wait

Conversation

@freeqaz

@freeqaz freeqaz commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator

Problem

tests/browser/console-namespace-not-ready.test.mjs:142 "Create Agent names a provisioning Namespace's status before any start" failed true !== false (found in side-by-side lane runs). After switching the harness to OpenClaw, the test waits for the status line "Embedded Agents are saved as drafts..." and then reads create.isDisabled() once.

updateControls() writes that status line from the harness and Namespace alone, but Create Agent also stays disabled while the form's repository discovery (GET .../agents/repository-options) is loading (!repositories.isSettled()). When that read is slow, the line shows while the button is still disabled.

The two "Create Agent waiting on a provisioning Namespace" subtests read isDisabled() the same way after "Dedicated Agents are provisioned and deployed when created." appears.

Change

Wait for Create Agent to become enabled (create.and(page.locator(":enabled")).waitFor()) instead of reading its state once, in those three places. Test-only: disabling Create Agent until the repository choices are known is intended.

Verification

  • Deterministic repro on a remote test VM: holding repository-options until after the harness switch leaves Create Agent disabled while the Embedded status line shows (every run); after release it enables.
  • Pins on a remote test VM. Whole file, 20 runs at 8 CPUs (the lane's CI CPU count), 5 at a time: 20/20 before and after. The failing test alone, 40 runs at 1 CPU each, 20 at a time: 40/40 before and after; the natural rate is too low to show there, so the held-read repro above is the evidence for the cause.
  • Prettier and ESLint clean on the touched file.

Risks

Low. A regression that keeps the button disabled still fails, as a timeout instead of an assertion.

The capability status line follows the harness and Namespace at once,
but Create Agent also stays disabled while the form's repository
discovery is loading. Reading isDisabled() once right after the line
appears failed when that read was slow. Wait for the button to enable.
@freeqaz
freeqaz requested a review from a team as a code owner October 21, 2026 03:27
@clawsweeper

clawsweeper Bot commented Oct 21, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@clawsweeper clawsweeper Bot added clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed clawsweeper:intake:bug Preliminary submission classification; full source review pending. clawsweeper:intake:needs-environment Preliminary submission classification; full source review pending. clawsweeper:intake:needs-repro Preliminary submission classification; full source review pending. labels Oct 21, 2026
@clawsweeper

clawsweeper Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces three immediate Create Agent state assertions with bounded waits for the button to become enabled.

Example: Switch to Embedded OpenClaw while repository-options discovery is still loading.

  • Before: The status line appears, but the immediate disabled-state assertion can fail.
  • After: The test waits for discovery to finish and Create Agent to enable.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The patch is focused and source-supported; validation consists of reported browser-harness runs and successful CI rather than independently inspected deterministic execution evidence.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only repair is outside the ordinary production-behavior proof gate; reported browser runs and exact-head CI support it without independently proving the deterministic reproduction.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
User problem: Valid asynchronous form loading can produce a false browser-test failure.
Reason: The maintainer-authored change preserves designed behavior and repairs three instances of the same premature observation.

Merge readiness

✅ Ready for maintainer review

Keep open: this PR makes a focused, source-supported repair to flaky browser assertions without changing production behavior; no actionable defect was found.

Priority: P3
Reviewed head: 116ce8d978f28e2e470b2cd4cf3d7547c4eb0e31

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The held-request reproduction is described, but a captured deterministic base-failure/head-pass comparison is not supplied.
Agent review details

How this fits together

The console form combines Namespace readiness, harness capabilities, and repository discovery to control Agent creation; browser tests observe its status messages and button state.

flowchart LR
  A[Browser test] --> B[Create Agent form]
  C[Namespace readiness] --> B
  D[Harness capabilities] --> B
  E[Repository discovery] --> B
  B --> F[Status and button state]
  F --> G[Bounded enabled wait]
Loading

Technical review

Best possible solution:

Use the existing locator to await enablement while retaining all Namespace, accessibility, and draft-preservation assertions.

Do we have a high-confidence way to reproduce the issue?

Source establishes the timing window, and the author reports reproducing it by holding repository discovery; this review performed no runtime reproduction.

Is this the best way to solve the issue?

The three bounded locator waits directly express eventual enablement without weakening the intended readiness gates or introducing production machinery.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 49019252a2f3.

Provenance checked

  • Embedded draft enablement assertion keeps the original intent (f3a7429: Verify that switching away from a Dedicated plan permits saving an Embedded draft in a provisioning Namespace.)
  • Namespace readiness recovery assertions keeps the original intent (fix(console): Create Agent re-enables when the Namespace becomes ready #2937: Verify that refocus or polling enables creation after Namespace readiness changes while preserving the draft; later consolidation retained these assertions.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

Likely related people:

  • Free Wortley: Raw commit f3a7429 adds tests/browser/console-namespace-not-ready.test.mjs:136 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: f3a74292ab69; files: tests/browser/console-namespace-not-ready.test.mjs)

Labels

Label changes:

  • add P3: This is a narrowly scoped browser-test reliability repair with no production behavior change.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P3: This is a narrowly scoped browser-test reliability repair with no production behavior change.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Rating scale

6/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.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

Reviewed October 20, 2026, 11:41 PM ET / October 21, 2026, 03:41 UTC.

@freeqaz
freeqaz merged commit d02688c into main Oct 21, 2026
21 checks passed
@freeqaz
freeqaz deleted the fix/test-console-create-agent-enabled-wait branch October 21, 2026 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low-risk cleanup, docs, polish, ergonomics, or speculative feature. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant