Skip to content

refactor: deslop UI, MCP and config fixtures - #184815

Merged
steipete merged 1 commit into
mainfrom
deslop/t04-73-ui-mcp-and-config-fixtures-20261015
Oct 26, 2026
Merged

steipete merged 1 commit into
mainfrom
deslop/t04-73-ui-mcp-and-config-fixtures-20261015

Conversation

@steipete

@steipete steipete commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Repeated fixture literals, provider/registry construction and hand-held promises obscure independent scenarios. These thirteen self-contained cuts consolidate setup on fitting owners, with no deleted or merged assertion, case, registration or table.

126 net test/support lines removed across 32 paths; production net 0. Authorized 100+ residue under the campaign floor waiver, NOT LARGE. No config, schema, protocol, dependency or public API change. Broader finite inventory reconciliation remains open.

UI text, collaborator proxy and cold account inputs

Reuse existing text-content and cold-plugin config owners; collaborator proxy creation delegates to the existing Vite proxy owner with explicit per-person forwardedFor.

Best-effort tradeoffs accepted: One helper frame replaces each literal or constructor. Fresh content/config objects, real proxy headers and create → array-registration → listen order stay unchanged. The proxy default remains identical for existing callers. Three recent campaign-owned UI paths are wholly excluded.

Net 29 test/support lines. Broad expect calls 586 → 586; custom assertions 36 → 36; callback registrations 23 → 23; tables 3 → 3; hoists 0 → 0.

MCP registries and OAuth render gate

Reuse the existing registry factory and native deferred owner.

Best-effort tradeoffs accepted: Registry calls still create a fresh runtime placeholder/logger and disable global effects. OAuth rendering still resolves its original gate before manual input. No guard or scenario removed; only private constructor/stack frames change.

Net 7 test/support lines. Broad expect calls 57 → 57; custom assertions 0 → 0; callback registrations 11 → 11; tables 0 → 0; hoists 1 → 1.

Empty setup registries

Reuse the existing empty setup-registry factory in selection and status tests.

Best-effort tradeoffs accepted: All five arrays are fresh on each resolver call. Existing auth-route changes from main are retained. No production registry or selection policy changes.

Net 10 test/support lines. Broad expect calls 418 → 418; custom assertions 5 → 5; callback registrations 71 → 71; tables 11 → 11; hoists 7 → 7.

Plugin approval input

Reuse the same-file plugin replay request builder.

Best-effort tradeoffs accepted: Exact ID, request text and timestamps remain. A fresh request is constructed at its original call site; the independent delivery/resolution scenario and assertions remain.

Net 8 test/support lines. Broad expect calls 118 → 118; custom assertions 7 → 7; callback registrations 20 → 20; tables 1 → 1; hoists 6 → 6.

Visitor-access config

Share the identical plugin-only config block across three suites on one narrow type-only support leaf.

Best-effort tradeoffs accepted: Every invocation creates fresh arrays and nested objects with the original explicit synthetic account/app/token arguments. Existing memory:none is only disabled fixture input, not a session-memory implementation change. A new 13-line helper replaces three literal copies; no persisted shape or authority logic changes.

Net 15 test/support lines. Broad expect calls 146 → 146; custom assertions 8 → 8; callback registrations 12 → 12; tables 0 → 0; hoists 0 → 0.

Speech directive policies

The existing speech-policy fixture takes an explicit allowed boolean; all three prior enabled callers pass true and the summary caller passes false.

Best-effort tradeoffs accepted: Every policy flag retains its original value and each call returns a fresh object. The old private helper name is removed with a complete caller migration; no compatibility alias or production API is added.

Net 8 test/support lines. Broad expect calls 70 → 70; custom assertions 0 → 0; callback registrations 24 → 24; tables 7 → 7; hoists 1 → 1.

Gateway empty metadata owners

Reuse the existing empty owner-map factory through one async vi.hoisted import before the existing synchronous metadata snapshot hoist.

Best-effort tradeoffs accepted: Fresh maps/arrays and the snapshot callback timing remain; fixture module evaluation adds one awaited hoisted import. Its only runtime dependency is a pure index-fixture declaration. No registry, plugin reload or Gateway contract changes.

Net 8 test/support lines. Broad expect calls 160 → 160; custom assertions 0 → 0; callback registrations 22 → 22; tables 3 → 3; hoists 15 → 16.

Secret-reference input

Reuse the same-file envTokenRef literal builder.

Best-effort tradeoffs accepted: The existing synthetic variable name and source/provider/id values stay exact; no credential reads or secret-resolution policy changes.

Net 4 test/support lines. Broad expect calls 99 → 99; custom assertions 0 → 0; callback registrations 17 → 17; tables 4 → 4; hoists 0 → 0.

Scheduled-task spawn results

Reuse the existing local spawnSyncResult inside the mock implementation.

Best-effort tradeoffs accepted: Invocation stays lazy, not during vi.hoisted construction. Each call retains fresh output/result values and the original status, stdout, stderr, PID and signal; a transient default output allocation is accepted.

Net 7 test/support lines. Broad expect calls 6 → 6; custom assertions 0 → 0; callback registrations 0 → 0; tables 0 → 0; hoists 7 → 7.

Parent identity and passive provider models

Use an existing custody support owner for the repeated parent identity and an existing model fixture owner for two passive provider configs.

Best-effort tradeoffs accepted: Run/session identity arguments, custody scopes, awaits and parent refs remain exact; model URLs remain explicit and every provider/model array is fresh. No API key or fallback is added. The unrelated 2-net new-backend-export proposal was rejected for API cost.

Net 13 test/support lines. Broad expect calls 278 → 278; custom assertions 21 → 21; callback registrations 24 → 24; tables 7 → 7; hoists 2 → 2.

Pinned image-provider input

Reuse the existing provider config fixture only in the original pinned branch.

Best-effort tradeoffs accepted: The same OpenAI base URL, credential reference and empty model list are constructed freshly; unpinned inputs remain empty. Upstream pruning is retained. No provider/auth behavior changes.

Net 11 test/support lines. Broad expect calls 8 → 8; custom assertions 0 → 0; callback registrations 3 → 3; tables 1 → 1; hoists 0 → 0.

MCP fixture start gate

Delegate the existing waitForStart race to awaitGateBeforeSettlement.

Best-effort tradeoffs accepted: Gate-first race, early rejection, exact early-success error and original async await remain. Actual callers use native promises, so the canonical Promise.resolve adds no foreign-thenable timing contract. No timeout/cancellation/lifecycle guard changes.

Net 4 test/support lines. Broad expect calls 0 → 0; custom assertions 0 → 0; callback registrations 0 → 0; tables 0 → 0; hoists 0 → 0.

Dashboard held document

Reuse the existing native deferred helper for the document route gate.

Best-effort tradeoffs accepted: Fresh promise/resolver, await placement and finally release remain identical. The default void type argument is inferred after a lint-only correction; no browser behavior changes.

Net 2 test/support lines. Broad expect calls 120 → 120; custom assertions 2 → 2; callback registrations 9 → 9; tables 0 → 0; hoists 0 → 0.

Best-effort tradeoffs accepted

Per-cut loading/construction/stack-frame tradeoffs are named above. No production guard, security/authorization boundary, common-path durability, realistic concurrency or feature is removed. The PhaseE standalone session-memory backend/factory/registry/expiry/federation and actual tests remain untouched. No performance win is claimed.

Evidence

Changed-source before → after: direct expect880→880, broad expect2066→2066, custom assertion calls79→79, callback registrations236→236, tables37→37, hooks24→24, mocks53→53, hoists39→40. Counts overlap and are declarations, not expanded runtime cases. The extra hoist imports the existing pure metadata fixture. Native per-file census and exact assertion-call text digests match. Every distinct scenario/registration/input position and per-call freshness remains; no timeout/retry/skip/suppression/baseline weakened.

Focused canonical Vitest, serial nice10/maxWorkers1 and isolated HOME/OpenClaw/XDG:

Group Passing/failing/existing skips Wrapper seconds
agents-root-tests 175/0/0 97.592
agents-other-tests 265/0/0 307.338
agents-tools-tests 117/0/0 105.497
agents-sessions-tests 83/0/0 288.06
messaging-tests 49/0/0 74.015
commands-tests 25/0/0 45.056
services-tests 77/0/0 63.811
other-tests 111/0/0 106.664
infra-tests 22/0/0 4.151
state-logging-tests 18/0/0 104.974

942 passing, 0 failing, 0 unchanged skips. Sixteen narrow compiler groups plus format, typed lint, mock-export completeness, timeout ratchet, changed-lane classification, lint-suppressions, runtime cycles and Madge pass. Runtime wrappers include transforms/import/lifecycle work; retained real transport/storage/authority contracts are not replaced by cheaper mocks. Per-file timing remains in native wrapper logs. Exact-head hosted CI owns broad and platform proof; CI job-wall accounting follows completion.

Hosted-only: all UI browser/E2E consumers and build-dependent Gateway methods/server runtime consumers under the campaign compute limit; ci:full is attached before the landing run. No visual or renderer behavior change, so no parity screenshot claim. The first focused Gateway methods wrapper unexpectedly entered full dist preparation. Its owned descendants were intentionally stopped after 167.254 seconds; no test failure is attributed to that setup, and no successful Gateway runtime or build proof is claimed. The completed narrow prefix was retained, Gateway runtime groups moved to exact-head hosted ci:full, and remaining narrow checks resumed serially. No standalone broad build/E2E/whole-graph typecheck, paid provider, live authentication, operator-state or performance proof was requested or claimed. A skipped collection is not live proof.

Fresh isolated complete-candidate P0-P2 review scoped-clean/no findings. Its sole later mechanical change removes the redundant default void type argument caught by lint; emitted behavior and inferred type are identical, and all other reviewed hashes stay exact. Final lint/type/runtime proof uses the corrected candidate.

Fresh 72-hour collision census: 74 recent open PRs, 105 bounded reads, at most two in flight; no surviving overlap. Entire progress-placement/PR-reader/device-platform paths were excluded for recent open fixture campaigns #184569/#184346 before adoption. Upstream main migrations are preserved. No rebase, re-push or CI rerun for green.

Exact-head hosted proof and landing

CI 40362774116 passed; 84jobs accounted,21462summed overlapping job-wall seconds (not elapsed). Actual Security Review 40362762622 executed Prepare and Enforce successfully for this PR/head. Current protected-main publisher40371495858 projected successful dependency, security-sensitive and CI-gate statuses. Complete exact-head accounting:220checks,0failures,0pending;8cancelled duplicate/advisory checks each have an executed successful same-head replacement. Hosted CI owns Gateway/server/UI runtime coverage; no paid/live-provider proof inferred.

Two native landing attempts refused before dispatch because their watcher selected cancelled duplicate review40362774216 instead of the executed successful review. Both confirmed no request and released the operation lock. The standing rule10 exact-SHA squash recovery landed reviewed head 450c7bce9c14512a953f973f313e040f51467665 as 0969d13b34cb8dc3279eac337b0c4fc589abe204; evidence and complete attribution. No CI rerun, repush for green, rebase, failed-test or security waiver. Squash ancestry verified against fresh main.

@steipete steipete added the ci:full Keep ordinary native-locale CI selection on the next PR run. label Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 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 October 26, 2026 16:49
@openclaw-barnacle openclaw-barnacle Bot added app: web-ui App: web-ui gateway Gateway runtime agents Agent runtime and tooling labels Oct 26, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T16:51:18.874138Z 450c7bc Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@clawsweeper clawsweeper Bot added P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. 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. labels Oct 26, 2026
@clawsweeper

clawsweeper Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces repeated test inputs and promise scaffolding with shared fixture helpers while preserving existing scenarios and assertions.

Example: A collaborator browser connects through a test proxy as 192.0.2.11.

  • Before: The test constructs the Vite proxy and forwarded identity headers inline.
  • After: Shared proxy helpers construct the same proxy with the explicit 192.0.2.11 address.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) The inspected transformations preserve behavior and have reported focused validation; broader exact-head validation is unfinished.
Proof confidence 🦐 gold shrimp (3/6) This maintainer-authored, test-only consolidation changes no shipped behavior; the body reports focused passing tests, while broader browser and Gateway validation remains in exact-head CI.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Test only · Worth it: Yes · Fix scope: Complete
Reason: Maintainer-approved fixture cleanup removes repeated setup while preserving the tested contracts and avoiding production changes.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR provides useful fixture consolidation without an identified regression; exact-head CI is still running.

Priority: P3
Reviewed head: 450c7bce9c14512a953f973f313e040f51467665

Before merge

None.

Findings

None.

Agent review details

How this fits together

Test suites construct synthetic configuration, registries, identities, proxy routes, and asynchronous gates, then exercise existing production owners and assert their results.

flowchart LR
  A[Test scenarios] --> B[Shared fixture helpers]
  B --> C[Fresh configuration and identities]
  B --> D[Proxy routes and promise gates]
  C --> E[Existing production owners]
  D --> E
  E --> F[Unchanged assertions]
Loading

Technical review

Best possible solution:

Retain the focused fixture consolidation and complete the existing exact-head CI gates before landing.

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

There is no reported runtime bug to reproduce; source inspection confirms repeated fixture inputs are replaced with equivalent constructors.

Is this the best way to solve the issue?

The change uses existing fixture owners wherever they fit, adds one small shared visitor-access fixture, and preserves independent expectations and lifecycle boundaries.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • UI proxy and content fixtures keeps the original intent (5ff2fe1: Earlier consolidation established the shared Vite proxy owner; the collaborator regression in fix(ui): prevent chat jumps when collaborators send messages #153061 requires separate forwarded identities and stable lifecycle ordering.)
  • MCP registries and asynchronous gates keeps the original intent (b6effdc: MCP proof fixtures exercise real registry composition without resolver overrides; the replacements retain disabled global side effects and gate-before-settlement behavior.)
  • Speech directive policy fixtures keeps the original intent (329f312: The existing helper consolidated complete enabled speech policies; the explicit boolean now also represents the existing all-disabled summary policy without changing either input.)
  • Visitor-access and queued publication fixtures keeps the original intent (65e49fa: Queued-publication tests retain original requester authority across deferral and recovery; the shared constructor preserves plugin configuration and all synthetic account values.)
  • Gateway metadata snapshot keeps the original intent (9de2bc6: Startup tests model reuse of the prepared metadata snapshot; the shared empty-owner factory preserves every map and array while retaining snapshot construction timing.)
  • Setup inference and OAuth fixtures keeps the original intent (496433f: History across the earlier setup-test and OAuth filenames establishes credential-retention and render-before-prompt contracts; only provider literals and native deferred construction change.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduction: The introduced diff contains only test and support changes; replacement helpers preserve literal values, and no assertion or scenario is removed. (450c7bce9c14)
  • Proxy equivalence: The existing proxy factory matches the removed Vite configuration, and the new optional forwarded address preserves both existing callers' default and each collaborator's explicit identity. (ui/src/e2e/gateway-proxy.test-support.ts:14, 450c7bce9c14)
  • Gate equivalence: The shared gate helper retains gate-first racing, propagation of early rejection, and the exact early-success error; the changed callers use native promises. (src/mcp/tools-mcp.test-support.ts:24, 450c7bce9c14)
  • Fresh fixture values: Registry, provider, speech-policy, and visitor-access constructors return fresh nested values matching the replaced inputs; the visitor-access plugin ID remains visitor-access in all three consumers. (src/test-utils/visitor-access-config.test-support.ts:3, 450c7bce9c14)
  • Current GitHub state: GitHub reports the reviewed head open, ready for review, and mergeable; validation jobs remain queued or running, with no observed failed check attributable to this diff. (450c7bce9c14)
  • Related work remains distinct: The changed-file list of test(ui): remove repeated browser and Gateway fixture work #184569 does not overlap this PR; its broader browser-fixture work does not supersede these changes.

Likely related people:

  • Peter Steinberger: Raw commit 5ff2fe1 adds ui/src/e2e/gateway-proxy.test-support.ts:3 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5ff2fe1ff646; files: ui/src/e2e/gateway-proxy.test-support.ts)
  • Shakker: Raw commit 9de2bc6 adds src/gateway/server-startup-plugins.test.ts:39 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: medium; commits: 9de2bc6ffcc4; files: src/gateway/server-startup-plugins.test.ts)

PR surface

Tests -126. Total -126 across 32 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 32 101 227 -126
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 32 101 227 -126

Review metrics

Metric Value Why it matters
Production versus test changes Production +0/-0; tests/support +101/-227. The reduction consolidates setup without adding production machinery or removing assertions.

Labels

Label changes:

  • add P3: This is test-maintenance cleanup with no intended user-facing 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 test-maintenance cleanup with no intended user-facing 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 26, 2026, 1:06 PM ET / 17:06 UTC.

@steipete

Copy link
Copy Markdown
Contributor Author

Exact-head landing-tool recovery

Reviewed head: 450c7bce9c14512a953f973f313e040f51467665. Two native scripts/pr merge-run --auto-merge attempts stopped before dispatch and released their operation locks. Both incorrectly selected the cancelled duplicate Security Review job instead of the completed review for this same PR/head. No merge request was sent by either attempt. No CI was rerun and no branch update or rebase was made.

Fresh complete check-run accounting: 220 checks, zero failures, zero pending. All 8 cancelled duplicate/advisory checks have an executed successful check with the same name on this exact head. CI 40362774116 completed successfully; all 84 jobs are accounted, with no successful zero-step job accepted as proof.

Apparent failure Attribution and proof
Native watcher: review (184815, 450c7bce9c14512a953f973f313e040f51467665) Duplicate run40362774216 was cancelled. Actual Security Review 40362762622 passed, including executed Prepare and Enforce steps on this exact head.
Other cancelled duplicate/advisory checks auto-response, dispatch, PR context and evidence each has a successful same-head replacement; no runtime suite lacks proof.

Current dependency review, security-sensitive review and CI-gate commit statuses are all successful. No change-requested review is present. Native review and preparation are complete; independent isolated P0–P2 review was scoped-clean. Local proof remains942passing/0failing/0skips plus16narrow compiler groups; hosted CI supplies Gateway/UI proof.

Using the standing maintainer-authorized rule10 exact-SHA squash route after two confirmed landing-tool failures. This bypasses the broken watcher, not an unsuccessful security or test decision.

@steipete
steipete merged commit 0969d13 into main Oct 26, 2026
215 of 223 checks passed
@steipete
steipete deleted the deslop/t04-73-ui-mcp-and-config-fixtures-20261015 branch October 26, 2026 17:56
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agents Agent runtime and tooling app: web-ui App: web-ui ci:full Keep ordinary native-locale CI selection on the next PR run. gateway Gateway runtime P3 Low-priority cleanup, docs, polish, ergonomics, or speculative work. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. size: M 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