Skip to content

fix: restore isolated plugin runtime contract tests - #147000

Merged
steipete merged 1 commit into
mainfrom
codex/plugin-fixture-contracts
Sep 13, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/plugin-fixture-contracts

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes plugin tests that fail because their mocks and expectations have drifted from the current runtime contracts, or because a built checkout exposes host bundled plugins to synthetic registry fixtures.

User Impact

No user-visible runtime change. Plugin tests remain isolated from installed bundles while continuing to exercise the real manifest selector, explicit bundled-fixture opt-ins, subscription routing, and retired-runtime rejection.

Why This Change Was Made

Preserve the real selector in the existing partial mock, disable host bundles in the hermetic fixture unless a bundled root is supplied, and assert the current route metadata and unavailable-runtime error. The no-cold-discovery assertion remains intact.

Evidence

The original capability suite reproduced 67 missing-export failures. A built checkout reproduced two registry failures, and two other tests had stale expectations. After this change, all 226 cases in seven full plugin suites pass in a built checkout under umask 0002. The checkout's runtime build, changed checks, and independent review through P2 pass.

The broader Crabbox campaign had two unexplained worker exits; these scoped results do not certify the cases missing from that run.

@clawsweeper

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

@openclaw-barnacle openclaw-barnacle Bot added size: XS maintainer Maintainer-authored PR labels Sep 13, 2026
@steipete
steipete marked this pull request as ready for review September 13, 2026 11:59
@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 13, 2026
@clawsweeper

clawsweeper Bot commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed September 13, 2026, 8:06 AM ET / 12:06 UTC.

ClawSweeper review

What this changes

Updates plugin test mocks, isolates synthetic registries from host bundles, and aligns provider metadata and retired-runtime expectations with existing behavior.

Merge readiness

✅ Ready for maintainer review

Keep open: these focused test repairs remain absent from current main, preserve meaningful contract coverage, and introduce no blocking defect. The maintainer-labeled PR is not a cleanup-close candidate.

Priority: P3
Reviewed head: 9750fbfdcbc90056333409b71ffdcb1af52caebb

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) A focused test repair with source-supported expectations, reported scoped validation, and no actionable correctness finding.
Proof confidence 🌊 off-meta tidepool Not applicable: The maintainer test-maintenance PR changes no production behavior or authority boundary; its reported built-checkout suite run supports the fixture repairs without requiring a live application demonstration.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Not applicable Not applicable: The maintainer test-maintenance PR changes no production behavior or authority boundary; its reported built-checkout suite run supports the fixture repairs without requiring a live application demonstration.
Evidence reviewed 7 items Verified scope and continuing necessity: The current-main comparison contains exactly the four supplied test repairs. The host-verified test merge likewise changes only those tests, so unrelated base-branch changes are not attributed to this PR.
Partial mock preserves the real selector: The metadata snapshot calls selectInstalledPluginManifestRecords, which the original whole-module mock omitted. Importing the original exports preserves this real selection behavior while retaining the two existing mocked operations.
Bundle isolation retains explicit fixture coverage: The helper disables automatic host bundle discovery only when no nonempty bundled directory override is supplied. Existing cases explicitly supply synthetic bundled roots, including the built/source registry migration case; explicit overrides still take precedence.
Findings None None.
Security None None.

How this fits together

OpenClaw’s plugin system turns installed manifests and configuration into provider and channel runtime selections. These tests check that selection, bundle isolation, and runtime retirement follow the existing contracts.

flowchart LR
  A[Installed plugin manifests] --> B[Registry and metadata selection]
  C[Isolated test fixtures] --> B
  B --> D[Provider routing metadata]
  B --> E[Web runtime selection]
  E --> F[Reject retired runtime]
  D --> G[Contract assertions]
  F --> G
Loading

Before merge

None.

Agent review details

Security

None.

PR surface

Tests +7. Total +7 across 4 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 4 9 2 +7
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 9 2 +7

Review metrics

None.

Technical review

Best possible solution:

Keep the existing production owners and restore their focused tests using real selectors, explicit fixture isolation, and accurate contract assertions.

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

Not applicable to a user-facing runtime defect; source confirms the mock and expectation mismatches, while the PR reports the failing and passing suite results. Tests were not rerun during this read-only review.

Is this the best way to solve the issue?

Yes. The patch repairs existing test setup and expectations without adding a competing runtime implementation or weakening the retired-runtime rejection check.

AGENTS.md: found and applied where relevant.

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

Labels

Label changes:

  • add P3: This is bounded internal test maintenance 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: The maintainer test-maintenance PR changes no production behavior or authority boundary; its reported built-checkout suite run supports the fixture repairs without requiring a live application demonstration.

Label justifications:

  • P3: This is bounded internal test maintenance 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: The maintainer test-maintenance PR changes no production behavior or authority boundary; its reported built-checkout suite run supports the fixture repairs without requiring a live application demonstration.

Evidence

What I checked:

  • Verified scope and continuing necessity: The current-main comparison contains exactly the four supplied test repairs. The host-verified test merge likewise changes only those tests, so unrelated base-branch changes are not attributed to this PR. (9750fbfdcbc9)
  • Partial mock preserves the real selector: The metadata snapshot calls selectInstalledPluginManifestRecords, which the original whole-module mock omitted. Importing the original exports preserves this real selection behavior while retaining the two existing mocked operations. (src/plugins/plugin-metadata-snapshot.ts:252, 9750fbfdcbc9)
  • Bundle isolation retains explicit fixture coverage: The helper disables automatic host bundle discovery only when no nonempty bundled directory override is supplied. Existing cases explicitly supply synthetic bundled roots, including the built/source registry migration case; explicit overrides still take precedence. (src/plugins/plugin-registry.test.ts:68, 9750fbfdcbc9)
  • Provider expectation matches its existing owner: resolveModelRoutes already returns preferredAuthRequirement as subscription when this call supplies no route intent. This assertion exercises OpenClaw-owned policy metadata, without invoking or testing the Codex dependency’s runtime or protocol; the dependency-specific inspection gate does not apply. (extensions/openai/provider-policy-api.ts:676, 9750fbfdcbc9)
  • Retired-runtime rejection remains covered: The changed test continues to invoke the retained monitor under the disposed registry and require rejection, followed by the unchanged assertion that metadata discovery was never called. The new expected message matches the existing runtime selection error. (src/plugins/runtime/runtime-web-channel-plugin.test.ts:209, 9750fbfdcbc9)
  • Validation scope: The supplied complete PR body reports 226 passing cases across seven plugin suites in a built checkout under umask 0002, and explicitly excludes cases lost to two broader campaign worker exits. This review did not execute tests; the read-only diff whitespace check passed. (9750fbfdcbc9)

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
steipete merged commit 4aff70f into main Sep 13, 2026
168 checks passed
@steipete
steipete deleted the codex/plugin-fixture-contracts branch September 13, 2026 12:29
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (1537 commits)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  perf(sessions): keep cleanup responsive and reuse workers (#140897)
  fix(sessions): prevent stranded writers after abort and restart (#146792)
  refactor: reuse deferred owners in Gateway and infra fixtures (#146809)
  fix: prevent queued conversation replies from switching storage (#146984)
  test(ui): preserve nested failure summaries in CI logs (#146864)
  fix(test): respect process memory limits in local scheduling (#146298)
  fix: validate large media data URLs without regexp stack exhaustion (#146972)
  fix(ui): label model usage contributions as messages (#146735)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-145950: (101 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '060e856e5f9df245d63c98990fcb47e18108c6b9': (97 commits)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* temp/pr-137049: (110 commits)
  improve: reduce GitHub OAuth maintenance work for large agent rosters (#147021)
  fix(test): avoid settings lock writer startup timeouts (#147029)
  fix(update): correct backup guidance and cover incident regressions (#147023)
  refactor(gateway): share connection lifecycle across transports (#145950)
  refactor(telegram): share HTML text escaping (#146936)
  perf(build): reduce disk use in UI performance checks (#146687)
  refactor(memory-wiki): share freshness result construction (#146935)
  improve(gateway): use metadata projection for presence (#146817)
  test(agents): reuse complete Responses model fixtures (#147015)
  fix(sessions): align the reclamation-memory test with the archive session owner (#147028)
  refactor(terminal): simplify copy-sensitive token checks (#146934)
  refactor(media): remove duplicate spaced path fallback (#146933)
  refactor(cli): reuse command-group names (#146893)
  improve(plugins): reduce JavaScript generation capture work (#146993)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  ...
vincentkoc added a commit that referenced this pull request Sep 13, 2026
* commit '4aff70f27016f9acf62d0acc19c8bd3592993e4c': (30 commits)
  test: align plugin fixtures with current runtime contracts (#147000)
  refactor(browser): separate session tab tracking from cleanup (#146973)
  fix(tests): make systemd clock fixtures private (#146990)
  fix(linux): retire sleep guards when logind disconnects (#146046)
  refactor(matrix): share draft fallback delivery (#144840)
  fix(sessions): preserve cross-agent replies after reload (#146799)
  test(models): cover quota recovery during catalog discovery (#146708)
  fix(macos): recover browser sign-in when no browser opens (#146787)
  fix(process): prevent one-shot agents exiting while polling (#144268)
  fix(status): label the session inventory as stored (#146979)
  fix: avoid repeated background reads while loading chat (#146953)
  refactor(ui): narrow Skill Workshop proposal context (#146977)
  perf(sessions): keep cleanup responsive and reuse workers (#140897)
  fix(sessions): prevent stranded writers after abort and restart (#146792)
  refactor: reuse deferred owners in Gateway and infra fixtures (#146809)
  fix: prevent queued conversation replies from switching storage (#146984)
  test(ui): preserve nested failure summaries in CI logs (#146864)
  fix(test): respect process memory limits in local scheduling (#146298)
  fix: validate large media data URLs without regexp stack exhaustion (#146972)
  fix(ui): label model usage contributions as messages (#146735)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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