Skip to content

test(plugins): align tool fixtures with owner policy - #118959

Merged
steipete merged 1 commit into
mainfrom
codex/qa-96-plugin-tools-baseline
Aug 3, 2026
Merged

steipete merged 1 commit into
mainfrom
codex/qa-96-plugin-tools-baseline

Conversation

@steipete

@steipete steipete commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Closes #118957

Summary

  • make the default plugin-tool test context unrestricted so owner-policy enforcement does not silently exclude arbitrary fixture owners
  • give external Feishu fixtures an explicit owner allowlist and share their registry setup
  • update the restrictive-allowlist expectation to exclude an active plugin outside the allowlist
  • rebind manifest eligibility imports after hoisted mocks in the non-isolated Plugins project

Root cause

Bundled owner-policy enforcement made plugins.allow authoritative for tool owners. The old default fixture carried a restrictive allowlist while dynamically creating many unrelated plugin ids, so 20 assertions correctly received no tools. Separately, manifest-contract-eligibility.test.ts could reuse a production module graph evaluated by an earlier file, bypassing its mocks and producing six order-dependent failures.

The repair stays at the test owner boundary: default fixtures no longer smuggle restrictive policy into unrelated cases, tests that need external Feishu ownership configure it explicitly, and the non-isolated suite rebinds its mocked module graph. Production policy is unchanged.

Evidence

Exact candidate: 3f0a5d43ffc4c8f1428afa349f27f6273e3bf178, rebased onto current main at c83dcc2bc089ca22db9ba19bb602694a66e19337.

  • node scripts/run-vitest.mjs src/plugins/tools.optional.test.ts src/plugins/manifest-contract-eligibility.test.ts — 2 files, 107 tests passed
  • OPENCLAW_VITEST_FS_MODULE_CACHE=0 node scripts/run-vitest.mjs --config test/vitest/vitest.plugins.config.ts — 222 files, 3,369 tests passed, one skipped on Blacksmith Testbox tbx_01kz4wwsrjezd0ar8wgztd6bmb: https://github.com/openclaw/openclaw/actions/runs/30859893741
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base origin/main --stream-engine-output — clean, no accepted/actionable findings, confidence 0.99
  • git diff --check origin/main...HEAD — passed
  • public model identifier gate — PASS; no model identifiers added or changed

An earlier full-suite prepare attempt failed only three unrelated Gateway image-capability assertions in src/gateway/server.agent.gateway-server-agent-a.test.ts; the Plugins project was green in that run. The exact-current-main Plugins run above closes the ClawSweeper shared-module-lifecycle concern without weakening the unrelated Gateway test.

Risk

Low. This is test-only, removes 32 net lines, and leaves production policy unchanged. Restrictive allowlist behavior remains covered explicitly instead of leaking through the default fixture.

@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels Aug 3, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. 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. P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 3, 2026
@clawsweeper

clawsweeper Bot commented Aug 3, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed August 3, 2026, 7:02 PM ET / 23:02 UTC.

ClawSweeper review

What this changes

The PR makes default plugin-tool fixtures unrestricted, scopes Feishu allowlists to Feishu cases, and reloads manifest eligibility modules after test mocks are installed.

Merge readiness

⚠️ Ready for maintainer review - 1 item remains

No actionable patch finding: the test-only repair correctly aligns fixture ownership with the authoritative plugin policy and rebinds mocked modules in the non-isolated Plugins worker. The protected maintainer label keeps this PR for human merge review.

Priority: P2
Reviewed head: 3f0a5d43ffc4c8f1428afa349f27f6273e3bf178

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Focused source repair plus exact-head Plugins-project evidence support a normal good review rating.
Proof confidence 🦞 diamond lobster (5/6) Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact head, including the focused tests and the complete Plugins project; redact any private details if reposting logs.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Verification

Check Result Evidence
Real behavior Verified Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact head, including the focused tests and the complete Plugins project; redact any private details if reposting logs.
Evidence reviewed 5 items Owner policy is authoritative: Current policy rejects a plugin outside a nonempty allowlist, so a default fixture with arbitrary dynamic plugin IDs must not carry a restrictive allowlist.
Fixture repair matches the owner boundary: The branch removes the shared allowlist from the default context, adds an explicit Feishu-only context, and installs registry metadata using the exact test config.
Shared-worker lifecycle repair follows established patterns: The branch resets and dynamically imports the eligibility graph after hoisted mocks; the Plugins project is serial by file and non-isolated, and its runner explicitly resets module state between files.
Findings None None.
Security None None.

How this fits together

Plugin tool tests create registries and config contexts, then exercise owner-policy filtering before a tool is exposed. Manifest-eligibility tests run in a shared non-isolated Vitest worker, where mocked dependencies must bind to the module graph used by assertions.

flowchart LR
  A[Test fixture] --> B[Plugin config and registry]
  B --> C[Owner-policy decision]
  C --> D[Tool and manifest eligibility]
  E[Shared Plugins test worker] --> F[Mocked module graph]
  F --> D
  D --> G[Test assertions]
Loading

Before merge

  • Complete next step (P2) - No mechanical repair remains; the protected maintainer label reserves the final merge decision for human review.
Agent review details

Security

None.

PR surface

Tests -32. Total -32 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 0 0 0 0
Tests 2 119 151 -32
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 119 151 -32

Review metrics

Metric Value Why it matters
Production versus test delta production 0, tests +119/-151 The branch is confined to regression fixtures and test lifecycle setup; it does not alter runtime plugin policy.

Stored data model

Persistent data-model change detected: vector/embedding metadata: src/plugins/manifest-contract-eligibility.test.ts. Confirm migration or upgrade compatibility proof before merge.

Root-cause cluster

Relationship: fixed_by_candidate
Canonical: #118957
Summary: The linked issue is the canonical report for the current Plugins-project failures; this PR is its focused candidate repair.

Members:

Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything.

Technical review

Best possible solution:

Keep owner-policy enforcement in production and land this narrowly scoped test-boundary repair after the required human review.

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

Yes, source-reproducible: a nonempty fixture allowlist excludes dynamically created owners under the current policy, and the non-isolated worker can retain a pre-mock module graph. Local execution was not performed because this is a read-only review.

Is this the best way to solve the issue?

Yes. Moving restrictive policy into the cases that require it and rebinding only the affected mock graph repairs the owning test boundaries without weakening production policy or altering runner-wide behavior.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning high; reviewed against a2ccd6ea61ec.

Labels

Label changes:

  • add P2: This repairs bounded Plugins-project test reliability without a demonstrated production user-flow regression.
  • remove P1: Current review triage priority is P2, so this older priority label is no longer current.

Label justifications:

  • P2: This repairs bounded Plugins-project test reliability without a demonstrated production user-flow regression.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🦞 diamond lobster and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR. Sufficient (terminal): The PR body provides after-fix terminal evidence for the exact head, including the focused tests and the complete Plugins project; redact any private details if reposting logs.
  • proof: sufficient: Contributor real behavior proof is sufficient. The PR body provides after-fix terminal evidence for the exact head, including the focused tests and the complete Plugins project; redact any private details if reposting logs.

Evidence

What I checked:

  • Owner policy is authoritative: Current policy rejects a plugin outside a nonempty allowlist, so a default fixture with arbitrary dynamic plugin IDs must not carry a restrictive allowlist. (src/plugins/manifest-owner-policy.ts:69, a2ccd6ea61ec)
  • Fixture repair matches the owner boundary: The branch removes the shared allowlist from the default context, adds an explicit Feishu-only context, and installs registry metadata using the exact test config. (src/plugins/tools.optional.test.ts:112, 3f0a5d43ffc4)
  • Shared-worker lifecycle repair follows established patterns: The branch resets and dynamically imports the eligibility graph after hoisted mocks; the Plugins project is serial by file and non-isolated, and its runner explicitly resets module state between files. (src/plugins/manifest-contract-eligibility.test.ts:24, 3f0a5d43ffc4)
  • Focused validation evidence: The PR body reports an exact-head 107-test focused run and a 3,369-test Plugins-project run on Testbox; this directly exercises the changed fixture and shared-worker behavior. (3f0a5d43ffc4)
  • Feature-history routing: Prior merged plugin-tool work includes cached-tool availability repair, establishing an ownership trail beyond the proposed branch. (src/plugins/tools.optional.test.ts, 29a92e98acce)

Likely related people:

  • steipete: Authored prior merged plugin-tool cache and registry repairs as well as this focused test repair. (role: recent plugin-tool contributor; confidence: high; commits: 29a92e98acce, 6c9b38862d2d; files: src/plugins/tools.optional.test.ts)
  • Vincent Koc: Git history and blame identify Vincent as the author of the current baseline fixture lines that this branch adjusts. (role: recent test-surface contributor; confidence: medium; commits: 99926b732346; files: src/plugins/tools.optional.test.ts)

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.

History

Review history (1 earlier review cycle)
  • reviewed 2026-08-03T21:02:21.364Z sha c10f85f :: needs maintainer review before merge. :: none

@steipete
steipete force-pushed the codex/qa-96-plugin-tools-baseline branch from c10f85f to 3f0a5d4 Compare August 3, 2026 22:52
@clawsweeper clawsweeper Bot added P2 Normal backlog priority with limited blast radius. and removed P1 High-priority user-facing bug, regression, or broken workflow. labels Aug 3, 2026
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Land-ready at 3f0a5d43ffc4c8f1428afa349f27f6273e3bf178.

Root cause: the default plugin-tool fixture accidentally carried a restrictive owner allowlist, while the non-isolated Plugins project could reuse a real module graph evaluated before this file's hoisted mocks. The canonical repair removes the hidden fixture restriction, opts Feishu-specific cases into their owner explicitly, and rebinds the mocked manifest module graph. Production policy is unchanged; production LOC delta is zero and test delta is -32 lines.

Proof on the exact rebased candidate:

The latest ClawSweeper review covers this exact SHA and reports no actionable patch finding or remaining rank-up move. The only remaining item is the protected maintainer merge decision.

@steipete
steipete merged commit a78f2c4 into main Aug 3, 2026
105 of 107 checks passed
@steipete
steipete deleted the codex/qa-96-plugin-tools-baseline branch August 3, 2026 23:09
@steipete

steipete commented Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Merged via squash.

vincentkoc added a commit to clawSean/openclaw that referenced this pull request Aug 3, 2026
* origin/main: (1301 commits)
  fix(sms): align MMS retries with network timeouts (openclaw#119002)
  test(qa): cover composed tool result consumption (openclaw#118991)
  test(cron): cover delivery outcomes (openclaw#118993)
  test(qa): cover guarded media fetch boundaries (openclaw#118857)
  test(qa): cover music generation controls (openclaw#118901)
  test(qa): cover core vision routing (openclaw#118861)
  test(qa): cover Gateway usage and memory APIs (openclaw#118995)
  fix(docker): use authenticated gateway health command (openclaw#118996)
  test(plugins): align tool fixtures with owner policy (openclaw#118959)
  test(qa): cover managed gateway service lifecycle (openclaw#118855)
  test(qa): cover audio proxy and limit handling (openclaw#118863)
  test(qa): cover PDF extraction dispatch (openclaw#118860)
  test(ui): add service-worker update primary QA proof (openclaw#118805)
  test(qa): cover CLI onboarding and plugin install sources (openclaw#118882)
  test(qa): cover remote logging boundaries (openclaw#118951)
  fix(sms): retry transient MMS failures before durable adoption (openclaw#118994)
  test(qa): cover video generation invocation (openclaw#118864)
  test(qa): cover media reference intake (openclaw#118858)
  test(qa): cover image generation task lifecycle (openclaw#118915)
  feat(sms): track Twilio delivery status (openclaw#118665)
  ...
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Aug 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

maintainer Maintainer-authored PR P2 Normal backlog priority with limited blast radius. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. 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.

Plugin tests fail after bundled owner policy enforcement

1 participant