Skip to content

fix(plugins): isolate config format validation - #182807

Merged
steipete merged 2 commits into
mainfrom
fix/profile-selected-validators
Oct 24, 2026
Merged

steipete merged 2 commits into
mainfrom
fix/profile-selected-validators

Conversation

@steipete

@steipete steipete commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes plugin config validation temporarily changing the TypeBox format rules observed by other validators during a reentrant call.

User Impact

Plugin config checks, error reporting, and conditional defaults use the same format rules without changing validation in other tools. URI validation, standard annotation formats, and already-registered custom formats are preserved.

Why This Change Was Made

The plugin validator previously installed and restored process-wide format callbacks around schema creation and every check. It now prepares schema-local refinements once, then shares that schema across validation and defaults. The compiled path and the existing fresh-state fallback remain in place.

This is a standalone correctness subset of the validator work. Profile-selected dynamic validation follows separately.

Evidence

  • 52 owning and sibling tests passed in 30.61s: manifest validation, required-field/source defaults, schema normalization, and shared defaults (pnpm test <files> --maxWorkers=1).
  • The reentrant regression fails with the original owner in both acceleration modes (4.72s) and passes after the change. It checks that a caller still rejects an invalid email while a plugin property getter is executing.
  • Custom formats, URI diagnostics, conditional defaults, and defaults on union-typed properties retain their behavior.
  • Tiny actual-owner AOT probe: the original exits 1 because plugin validation leaks its format policy into a caller; the fixed owner exits 0 and the caller still rejects the invalid email. Each probe compiled in under one second with the supplied experimental toolchain. Dynamic-regex warnings remain; no interpreter-free claim is made.
  • Targeted types, lint, format and Codex autoreview completed before each push. The assertion-safety ratchet was regenerated to record the removed cast.

No whole-app AOT build is involved. This fixes an ordinary Node/Bun ownership bug; AOT engine selection is a separate change.

Current-head CI (976ee61e51cb, run 40125921871, attempt 1) completed with 114 successful jobs and three failing tests in two jobs, plus their aggregate gate. Each failing assertion reproduces on clean main with unchanged test/owner inputs: Telegram control updates missing status/stop (137.24s total), restored requester wake limit 2 versus 3 (483.80s including the ordinary prerequisite build), and widget revision remaining 1 after a second restart (75.92s). CI remains failed; this PR uses the native pre-existing-failure route. No test, timeout, or check was weakened. Security checks passed.

A bounded trace found no concrete connection between those failures and the validator change. Gateway logs held only in fixture memory were not printed at the failing assertions, so the evidence does not claim to exclude every hidden tool-side error. The original assertion-ratchet CI failure was caused by this PR and is fixed by the current one-line baseline regeneration.

@clawsweeper

clawsweeper Bot commented Oct 24, 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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 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-24T19:19:40.418023Z f9c2812 PR opened
ℹ️ 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.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation size: M labels Oct 24, 2026
@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. P2 Normal backlog priority with limited blast radius. 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 24, 2026
@clawsweeper

clawsweeper Bot commented Oct 24, 2026

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

This PR replaces temporary global TypeBox format overrides with schema-local format checks shared by validation and conditional defaults.

Example: A plugin property getter checks whether another validator accepts "not an email".

  • Before: The nested check can accept it while plugin validation temporarily treats email formats as annotations.
  • After: The nested check rejects it while the plugin retains its annotation-only email behavior.

Review scores

Measure Result What it means
Overall readiness 🦐 gold shrimp (3/6) Useful and source-consistent, with focused owner-level evidence; failed exact-head checks remain unattributed.
Proof confidence 🦐 gold shrimp (3/6) The maintainer-authored PR is outside the ordinary contributor proof gate; its body reports Node/Bun owner regressions and a tiny actual-owner AOT probe, without attached shipped-entry-point output.
Patch quality 🦐 gold shrimp (3/6) No actionable review findings were identified.

Product

Kind: Bug fix · Worth it: Yes · Fix scope: Complete
User problem: Plugin config validation can temporarily alter validation results observed by another tool during a reentrant call.
Reason: The maintainer-authored direction repairs an existing isolation contract without adding settings or changing intended plugin format policy.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored PR addresses a source-verifiable isolation bug still present on main; no definite introduced defect was found.

Priority: P2
Reviewed head: f9c2812198942accf0365f2ef4769321e2a4b065

Before merge

None.

Findings

None.

Tests

  • Missing end-to-end proof: The supplied evidence reports owner-level regressions and an AOT probe, without a shipped CLI/Gateway scenario or latest-stable upgrade run.
Agent review details

How this fits together

Plugin manifest schemas and configuration values enter the shared validation owner, which prepares cached validators, applies source-selected defaults, and returns validated values or structured diagnostics.

flowchart LR
  A[Manifest schema] --> B[Schema admission and cache]
  B --> C[Local format refinements]
  C --> D[TypeBox validator]
  C --> E[Conditional defaults]
  F[Configuration value] --> E
  E --> D
  D --> G[Value or diagnostics]
Loading

Technical review

Best possible solution:

Keep format policy on the prepared schema within the existing validation owner, preserving defaults, diagnostics, and the fresh evaluation-context fallback.

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

The main-source registry override and synchronous value access establish the reentrant path; the PR reports a red-on-base regression in both acceleration modes, but this review executed no target code.

Is this the best way to solve the issue?

Schema-local refinements address the leaking owner directly, reuse the shared schema traversal, and remove the superseded global override rather than adding a competing validation path.

AGENTS.md: found and applied where relevant.

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

Provenance checked

  • Global plugin format scope changes intended behavior with a stated reason (3548cff: The TypeBox migration preserved URI-only validation and annotation-only standard formats; later compilation scoping aligned cached checks with diagnostics.)
  • Shared schema traversal keeps the original intent (b3ce00b: Centralize browser-safe normalization across plugin validation, defaults, MCP, and Control UI while preserving resource placement and nullable semantics.)
  • Cached fallback evaluation keeps the original intent (feeb173: Provide a fresh evaluation context for nonaccelerated schemas with unevaluated constraints.)

Testing

Proof path: in-process harness.

Security

None.

Evidence

What I checked:

  • Pinned introduced change: The introduced diff removes withPluginFormatSemantics and prepares one schema-local format policy for compiled validation, interpreted diagnostics, and defaults. (src/plugins/schema-validator.ts:414, f9c281219894)
  • Current-main defect remains: Main still rewrites the process-wide format registry around synchronous plugin validation, allowing reentrant property access to observe plugin-specific callbacks. (src/plugins/schema-validator.ts:158, d1c0b1c15c65)
  • Distinct regression coverage: The changed manifest suite exercises reentrant email checking with acceleration enabled and disabled, URI and custom-format rejection, and local format semantics during conditional-default selection. (src/plugins/schema-validator.manifest.test.ts:76, f9c281219894)
  • Determining dependency contract: The patch imports TypeBox and emits its ~refine schema extension. TypeBox 1.4.1 directly invokes each refinement's check callback in compiled and interpreted validation and uses its error callback for diagnostics. (src/schema/engine/_refine.ts:43, cd6a6070188f)
  • Preserved format contract: fix: restore plugin URL and annotation validation #156855 documents why URI rejection, annotation-only email/UUID behavior, and matching checks and diagnostics must be preserved; this PR retains those policies while removing their global scope. (src/plugins/schema-validator.ts:77, ea6fab90586d)
  • Exact-head CI remains blocked: The reviewed head has a failed ci-gate, including baseline/assertion checks and three Node shards. Available annotations identify Gateway restart and chat failures but do not establish attribution; detailed logs redirect to a blocked storage host. (f9c281219894)

Likely related people:

  • Peter Steinberger: Raw commit feeb173 adds src/plugins/schema-validator.ts:111 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: feeb17321950; files: src/plugins/schema-validator.ts)

PR surface

Source +51, Tests +69, Docs +1. Total +121 across 4 files. Added test files: 0.

View PR surface stats
Area Files Added Removed Net
Source 2 151 100 +51
Tests 1 97 28 +69
Docs 1 1 0 +1
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 4 249 128 +121

Labels

Label changes:

  • add P2: The demonstrated source path leaks validation semantics during reentrant calls, with a limited and specific trigger.
  • add rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • add status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.

Label justifications:

  • P2: The demonstrated source path leaks validation semantics during reentrant calls, with a limited and specific trigger.
  • rating: 🦐 gold shrimp: Overall readiness is 🦐 gold shrimp; proof is 🦐 gold shrimp and patch quality is 🦐 gold shrimp.
  • 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 24, 2026, 3:33 PM ET / 19:33 UTC.

@steipete
steipete merged commit 20b8af6 into main Oct 24, 2026
204 of 208 checks passed
@steipete
steipete deleted the fix/profile-selected-validators branch October 24, 2026 20:05
@steipete

Copy link
Copy Markdown
Contributor Author

Merged via explicitly authorized admin squash with attributed pre-existing CI failures.

github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Oct 25, 2026
* fix(plugins): isolate config format validation

* chore: shrink schema assertion debt baseline
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Improvements or additions to documentation P2 Normal backlog priority with limited blast radius. 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