Skip to content

chore: speed up publication custody tests - #154768

Merged
steipete merged 1 commit into
mainfrom
codex/fix-publication-test-waits353
Sep 21, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/fix-publication-test-waits353

Conversation

@steipete

@steipete steipete commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

The publication custody tests waited for a 50 ms polling tick after mocked publication requests had already completed. Their 32-entry capacity scenario repeatedly paid that delay while checking retained retries and explicit acknowledgement.

User Impact

Internal test performance only; no user-visible behavior or production code changes. All 28 cases, publication operations, assertions, and the existing one-second settlement deadline remain unchanged.

Why This Change Was Made

Wake the existing settlement helper through the publication binding’s state-change callback. Recheck activity after each notification so completion followed by a queued refresh still waits for the current operation. This exercises the same notification used by the chat pane without adding a production test seam or shortening polling intervals.

Evidence

  • The unchanged file and candidate both passed all 28 cases with node scripts/run-vitest.mjs ui/src/lib/sessions/pull-request-state.test.ts --maxWorkers=1 --reporter=verbose on frozen main 6e70aff092768801e539fb8f5af34055ec51e6ba.
  • The capacity case fell from 3,542 ms to 7 ms. Process wall time was 9.275 s before and 1.894 s after; Vitest reported 8.13 s and 0.916 s respectively. Cache warmth affects the whole-run comparison; no whole-CI speedup is claimed.
  • Hosted baseline evidence reported 3.588 s for the capacity case and 6.304 s of execution for the file. The candidate hosted run passed all 28 cases: the capacity case took 30 ms and the file reported 193.908 ms. These are separate-run case/file measurements, not a whole-CI speedup estimate.
  • Selected changed checks passed, including UI test typechecking, lint, formatting, i18n verification, repository guards, and unused-export checks. git diff --check passed.
  • Fresh independent managed Codex review completed with no actionable P0–P2 findings. Test case bodies remain byte-identical; only the local fixture and settlement helper changed.

@clawsweeper

clawsweeper Bot commented Sep 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.

@steipete
steipete marked this pull request as ready for review September 21, 2026 11:19
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui size: XS maintainer Maintainer-authored PR labels Sep 21, 2026
@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. labels Sep 21, 2026
@clawsweeper

clawsweeper Bot commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 21, 2026, 7:27 AM ET / 11:27 UTC.

ClawSweeper review

What this changes

The publication-state tests now await existing state-change notifications instead of waiting for polling ticks, while preserving their assertions.

Merge readiness

✅ Ready for maintainer review

Keep open: this remains a useful, focused test-performance improvement, with no actionable correctness findings. Current main still uses the slower settlement helper.

Priority: P3
Reviewed head: 3a67c6146cea38754d6a438a787d80976a156ffa

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused improvement that preserves coverage and uses an existing notification contract, with relevant reported timing evidence.
Proof confidence 🌊 off-meta tidepool Not applicable: This maintainer-context PR changes only test synchronization; no production behavior requires demonstration. Reported focused before/after test timings directly address its performance claim.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: This maintainer-context PR changes only test synchronization; no production behavior requires demonstration. Reported focused before/after test timings directly address its performance claim.
Evidence reviewed 7 items Introduced scope: The pinned merge-base-to-head diff changes only the fixture notification callback and settlement helper; test cases and production code remain unchanged.
Notification lifecycle: The controller notifies after settling an operation and then synchronously starts any queued refresh. The new helper rechecks activity after awakening and retrieves the next notification promise, covering that ordering. The chat pane already consumes this callback through requestUpdate.
Async wait and timeout contract: The changed helper depends on Vitest's async waitFor contract. Inspected v5.0.0 source accepts a Promise-returning callback, resolves immediately when it completes, and retains an independent 1,000 ms timeout while the callback is pending; this matches the repository's declared Vitest version.
Findings None None.
Security None None.

How this fits together

The Control UI retains GitHub publication operations across session-pane changes. These tests exercise that ownership and recovery behavior through mocked Gateway requests and the production publication controller.

flowchart LR
  A[Test publication actions] --> B[Session publication owner]
  B --> C[Publication controller]
  C --> D[Mock Gateway responses]
  D --> C
  C --> E[State-change notification]
  E --> F[Wait until activity clears]
  F --> G[Existing assertions]
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +14. Total +14 across 1 file.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 1 16 2 +14
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 1 16 2 +14

Review metrics

Metric Value Why it matters
Capacity-case runtime 3,542 ms → 7 ms reported The measured improvement targets repeated settlement waits without removing the capacity scenario or its assertions.

Technical review

Best possible solution:

Use the existing publication notifications to settle tests promptly while retaining the timeout, activity checks, and custody assertions.

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

Not applicable to a product defect: the PR targets test overhead, supported by the polling source and reported before/after timings; this review did not rerun tests.

Is this the best way to solve the issue?

Yes. Reusing the production notification callback avoids fixed polling latency without adding a production seam, weakening assertions, or shortening the timeout.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 2cc189c8735f.

Labels

Label changes:

  • add P3: This is internal test-performance cleanup with no production behavior change.
  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-context PR changes only test synchronization; no production behavior requires demonstration. Reported focused before/after test timings directly address its performance claim.

Label justifications:

  • P3: This is internal test-performance cleanup with no production behavior change.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🌊 off-meta tidepool and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Not applicable: This maintainer-context PR changes only test synchronization; no production behavior requires demonstration. Reported focused before/after test timings directly address its performance claim.

Evidence

What I checked:

  • Introduced scope: The pinned merge-base-to-head diff changes only the fixture notification callback and settlement helper; test cases and production code remain unchanged. (ui/src/lib/sessions/pull-request-state.test.ts:154, 3a67c6146cea)
  • Notification lifecycle: The controller notifies after settling an operation and then synchronously starts any queued refresh. The new helper rechecks activity after awakening and retrieves the next notification promise, covering that ordering. The chat pane already consumes this callback through requestUpdate. (ui/src/lib/sessions/github-publication-controller.ts:245, 3a67c6146cea)
  • Async wait and timeout contract: The changed helper depends on Vitest's async waitFor contract. Inspected v5.0.0 source accepts a Promise-returning callback, resolves immediately when it completes, and retains an independent 1,000 ms timeout while the callback is pending; this matches the repository's declared Vitest version. (packages/vitest/src/integrations/wait.ts:28, f441c6fab25e)
  • Still necessary on main: Fetched main still uses the synchronous assertion inside vi.waitFor and does not contain the notification helper. (ui/src/lib/sessions/pull-request-state.test.ts:196, 2cc189c8735f)
  • Latest release comparison: The supplied latest release revision also retains the polling-based helper; the optimization is not already present there. (ui/src/lib/sessions/pull-request-state.test.ts:196, ec9c1a13db89)
  • Reported performance validation: The captured PR body reports all 28 cases passing before and after, with the capacity case decreasing from 3,542 ms to 7 ms and process wall time from 9.275 s to 1.894 s. It explicitly qualifies cache warmth and does not claim a whole-CI speedup. Tests were not executed during this read-only review. (3a67c6146cea)

Likely related people:

  • steipete: Suggested for follow-up; no historical authorship or introduction is verified. (role: unverified routing candidate; confidence: low)

Rating scale

Score Internal tier Crab rank Meaning
6/6 S 🦀 challenger crab Exceptional readiness
5/6 A 🦞 diamond lobster Very strong readiness
4/6 B 🐚 platinum hermit Good normal PR; ordinary maintainer review
3/6 C 🦐 gold shrimp Useful, but confidence is limited
2/6 D 🦪 silver shellfish Proof or implementation needs work
1/6 F 🧂 unranked krab Not merge-ready
N/A NA 🌊 off-meta tidepool Rating does not apply

Overall follows the weaker of proof and patch quality.
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics.

Workflow

  • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
  • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
  • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
  • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
  • Maintainers can also comment @clawsweeper review to request a fresh review only.
  • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
  • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
  • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.

@steipete

Copy link
Copy Markdown
Contributor Author

Hosted timing evidence is now available for exact head 3a67c6146cea38754d6a438a787d80976a156ffa.

All 28 cases passed in UI shard 2/3. The capacity case took 30 ms, and the file’s reported test duration was 193.908 ms. The retained earlier hosted baseline recorded 3588 ms for that case and 6304.173 ms for the same 28-case file.

These are case/file timings from separate hosted runs, not a whole-CI speedup measurement. The candidate shard’s complete Test Control UI step took 254 seconds and its job envelope took 361 seconds; those envelopes include other tests and setup.

The change preserves all existing cases, operations, assertions, and the settlement deadline. ClawSweeper’s completed exact-head review reported no actionable correctness or security findings.

@steipete
steipete enabled auto-merge (squash) September 21, 2026 11:31
@steipete
steipete merged commit 0ce174f into main Sep 21, 2026
127 of 129 checks passed
@steipete
steipete deleted the codex/fix-publication-test-waits353 branch September 21, 2026 11:34
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash auto-merge.

vincentkoc added a commit that referenced this pull request Sep 21, 2026
* commit '0883394977d1fb3af657635967f6e447bd7fff9a': (72 commits)
  fix(ui): await scheduled rail layout in focus test
  fix(cron): keep healthy active runs from delaying job lists (#154421)
  fix(plugins): prevent config conflicts during legacy plugin installation (#154539)
  perf(gateway): reduce repeated session-list work (#154551)
  fix(tasks): retain admitted work across list retries (#154338)
  perf(gateway): speed up transcript artifact downloads (#154726)
  chore(ui): refresh control ui locales (#154580)
  fix(release): keep two extended-stable months eligible (#154777)
  fix(tests): avoid avatar descriptor reuse race (#154747)
  perf(plugins): reduce callback scope overhead (#154625)
  fix(ui): include final request time in completed work summaries (#149240)
  fix(ai): avoid retrying conflicting Responses terminal statuses (#149242)
  fix: identify malformed Code Mode JavaScript as input errors (#149222)
  fix(doctor): settle imported JSONL transcript leftovers (#154413)
  fix(cloud): restore node bootstrap with bundled browser runtime (#154654)
  test(ui): await publication state notifications (#154768)
  fix(plugins): keep unchanged plugins running across metadata refreshes (#151281)
  fix: keep chat panel accessibility targets within each pane (#153478)
  fix: forced Gateway restarts cancel healthy subagent work (#154300)
  improve: reduce session delivery reader imports (#154740)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui maintainer Maintainer-authored PR P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. size: XS 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