Skip to content

fix(doctor): report runtime tool schema validation errors - #88493

Closed
vincentkoc wants to merge 1 commit into
fuzz-tool-schema-runtime-20260530from
fix-doctor-runtime-tool-schema-errors-20260531
Closed

vincentkoc wants to merge 1 commit into
fuzz-tool-schema-runtime-20260530from
fix-doctor-runtime-tool-schema-errors-20260531

Conversation

@vincentkoc

@vincentkoc vincentkoc commented May 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • make doctor report runtime tool construction failures as actionable schema-check findings instead of aborting
  • make doctor report provider/plugin normalization failures for agent and bundled MCP runtime tools
  • preserve the fix(agents): quarantine invalid runtime tool schemas #88368 pre-normalization quarantine path while adding doctor diagnostics

Stack

Verification

  • node scripts/run-vitest.mjs src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-core-checks.runtime-errors.test.ts --reporter=verbose
  • ./node_modules/.bin/oxfmt --check $(cat /tmp/doctor-runtime-errors-files-current.txt)
  • node scripts/run-oxlint.mjs $(cat /tmp/doctor-runtime-errors-files-current.txt)
  • git diff --check @{u}...HEAD
  • rg -n "dofbot|doftbot" $(cat /tmp/doctor-runtime-errors-files-current.txt) || true
  • .agents/skills/autoreview/scripts/autoreview --mode branch --base @{u}
  • node scripts/crabbox-wrapper.mjs run --provider aws --label doctor-runtime-errors-check-changed --shell -- "pnpm check:changed" (run_3621756fcf12, AWS lease cbx_09998d224eb3, slug tidal-prawn)

Real behavior proof

Behavior addressed: doctor now reports runtime tool-set load and normalization failures as core/doctor/runtime-tool-schemas findings instead of letting those paths abort schema validation.
Real environment tested: local Codex gwt worktree stacked on #88368 plus AWS Crabbox Linux c7a.8xlarge remote changed gate.
Exact steps or command run after this patch: targeted doctor runtime Vitest, oxfmt, oxlint, diff whitespace check, private-name scrub, autoreview, and AWS Crabbox pnpm check:changed listed above.
Evidence after fix: targeted tests passed 1 routed Vitest shard / 33 tests; formatting, lint, diff, scrub, and autoreview passed; AWS Crabbox run_3621756fcf12 passed pnpm check:changed and cleaned up its lease.
Observed result after fix: doctor returns clear findings for agent runtime load failures, agent runtime schema normalization failures, and bundled MCP normalization failures while preserving runtime quarantine behavior from #88368.
What was not tested: no live Telegram turn in this slice; live channel proof should come after the runtime and doctor stack is landed/retargeted.

@vincentkoc
vincentkoc marked this pull request as ready for review May 31, 2026 01:14
@openclaw-barnacle openclaw-barnacle Bot added size: M maintainer Maintainer-authored PR labels May 31, 2026
@clawsweeper

clawsweeper Bot commented May 31, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge. Reviewed May 31, 2026, 12:56 PM ET / 16:56 UTC.

Summary
The PR changes doctor runtime tool schema validation so tool loading and schema normalization failures are reported as health findings instead of aborting the doctor check, with focused regression tests.

PR surface: Source +77, Tests +141. Total +218 across 2 files.

Reproducibility: yes. from source inspection: current main calls tool construction and normalization inside the doctor runtime schema check without local error conversion, so those exceptions abort the check. The PR adds focused tests for the three reported failure classes.

Review metrics: 1 noteworthy metric.

  • Runtime failure paths: 3 caught/reporting paths. The diff is bounded to doctor findings for agent tool construction, agent/provider schema normalization, and bundled MCP schema normalization failures.

Merge readiness
Overall: 🐚 platinum hermit
Proof: 🐚 platinum hermit
Patch quality: 🐚 platinum hermit
Result: ready for maintainer review.

Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch.

Rank-up moves:

Risk before merge

Maintainer options:

  1. Decide the mitigation before merge
    Keep this as the doctor/reporting companion to the runtime quarantine stack, land it in the intended order, then retarget to main and rerun or explicitly accept the relevant changed-gate proof.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

Security
Cleared: No concrete security or supply-chain concern was found; the diff only changes doctor error reporting and focused tests.

Review details

Best possible solution:

Keep this as the doctor/reporting companion to the runtime quarantine stack, land it in the intended order, then retarget to main and rerun or explicitly accept the relevant changed-gate proof.

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

Yes from source inspection: current main calls tool construction and normalization inside the doctor runtime schema check without local error conversion, so those exceptions abort the check. The PR adds focused tests for the three reported failure classes.

Is this the best way to solve the issue?

Yes, the implementation is a narrow doctor-local reporting fix that preserves runtime policy and converts known error points into health findings. The remaining question is landing order and validation, not the code shape itself.

AGENTS.md: found and applied where relevant.

Codex review notes: model gpt-5.5, reasoning high; reviewed against 0ee5f47fbabb.

Label changes

Label changes:

  • add rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • remove rating: 🦐 gold shrimp: Current PR rating is rating: 🐚 platinum hermit, so this older rating label is no longer current.

Label justifications:

  • P2: This is a normal-priority doctor/runtime reporting bug fix with bounded surface area and no emergency user-impact signal.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit 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 is a member/maintainer PR, so the external contributor proof gate does not apply; the PR body still records focused local validation for reviewer context.
Evidence reviewed

PR surface:

Source +77, Tests +141. Total +218 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 116 39 +77
Tests 1 141 0 +141
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 257 39 +218

Acceptance criteria:

  • [P1] node scripts/run-vitest.mjs src/flows/doctor-core-checks.runtime-errors.test.ts src/flows/doctor-core-checks.runtime.test.ts src/flows/doctor-core-checks.test.ts src/flows/doctor-health-contributions.test.ts --reporter=verbose.
  • [P1] ./node_modules/.bin/oxfmt --check src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime-errors.test.ts.
  • [P1] node scripts/run-oxlint.mjs src/flows/doctor-core-checks.runtime.ts src/flows/doctor-core-checks.runtime-errors.test.ts.
  • [P1] git diff --check origin/main...HEAD.
  • [P1] node scripts/check-changed.mjs --dry-run.

What I checked:

  • Repository policy applied: Root policy requires full AGENTS.md review, broad source/history review, protected maintainer-item handling, and focused validation/proof for PRs. (AGENTS.md:12, 0ee5f47fbabb)
  • Current main abort path: Current main constructs and normalizes runtime tools inside collectRuntimeToolSchemaFindings without local try/catch, so tool construction or normalization exceptions can abort the doctor check. (src/flows/doctor-core-checks.runtime.ts:788, 0ee5f47fbabb)
  • PR implementation: The PR head wraps agent tool construction and provider normalization failures into health findings, and also catches bundled MCP normalization failures while preserving runtime disposal. (src/flows/doctor-core-checks.runtime.ts:704, 7569ddc70d25)
  • Regression coverage: The added test file covers agent runtime tool construction failure, agent schema normalization failure, and bundled MCP schema normalization failure returning doctor findings. (src/flows/doctor-core-checks.runtime-errors.test.ts:74, 7569ddc70d25)
  • Runtime normalization contract: normalizeAgentRuntimeTools delegates to provider schema normalization, and provider-runtime invokes the loaded provider plugin normalizeToolSchemas hook, so this is the correct doctor boundary to catch plugin/provider normalization exceptions. (src/agents/runtime-plan/tools.ts:38, 0ee5f47fbabb)
  • Live PR state: Public GitHub API shows the PR is open, author_association is MEMBER, the maintainer label is present, head is 7569ddc, and the base is the open runtime quarantine branch.

Likely related people:

  • vincentkoc: Recent public commit history shows repeated work on doctor runtime schema and provider catalog diagnostics, including bundled MCP tool-schema validation and provider-catalog doctor findings. (role: recent area contributor; confidence: high; commits: cc290050b439, a02fe525f1c6, 7569ddc70d25; files: src/flows/doctor-core-checks.runtime.ts, src/flows/doctor-core-checks.runtime.test.ts, src/flows/doctor-core-checks.runtime-errors.test.ts)
  • steipete: Local blame for the current main runtime-schema loop and provider/runtime-plan seams points to recent Peter Steinberger commits, and adjacent provider-runtime history includes strict tool-schema work. (role: adjacent runtime/provider owner; confidence: medium; commits: 6b1b2ff20a11, 057be10e5b46, 4c33aaa86c16; files: src/flows/doctor-core-checks.runtime.ts, src/agents/runtime-plan/tools.ts, src/plugins/provider-runtime.ts)
What the crustacean ranks mean
  • 🦀 challenger crab: rare, exceptional readiness with strong proof, clean implementation, and convincing validation.
  • 🦞 diamond lobster: very strong readiness with only minor maintainer review expected.
  • 🐚 platinum hermit: good normal PR, likely mergeable with ordinary maintainer review.
  • 🦐 gold shrimp: useful signal, but proof or patch confidence is still limited.
  • 🦪 silver shellfish: thin signal; proof, validation, or implementation needs work.
  • 🧂 unranked krab: not merge-ready because proof is missing/unusable or there are serious correctness or safety concerns.
  • 🌊 off-meta tidepool: rating does not apply to this item.

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.

How this review workflow works
  • 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.

@clawsweeper clawsweeper Bot added rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. P2 Normal backlog priority with limited blast radius. labels May 31, 2026
@vincentkoc vincentkoc self-assigned this May 31, 2026
@clawsweeper clawsweeper Bot added rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🦞 diamond lobster Very strong PR readiness with only minor maintainer review expected. labels May 31, 2026
@vincentkoc
vincentkoc force-pushed the fix-doctor-runtime-tool-schema-errors-20260531 branch from ec876f1 to 0773aa1 Compare May 31, 2026 14:53
# Conflicts:
#	src/flows/doctor-core-checks.runtime.ts
@vincentkoc
vincentkoc force-pushed the fix-doctor-runtime-tool-schema-errors-20260531 branch from 0773aa1 to 7569ddc Compare May 31, 2026 16:47
@vincentkoc
vincentkoc changed the base branch from main to fuzz-tool-schema-runtime-20260530 May 31, 2026 16:47
@clawsweeper clawsweeper Bot added rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. and removed rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. rating: 🦐 gold shrimp Decent PR readiness signal, but merge confidence is limited. labels May 31, 2026
@steipete
steipete deleted the branch fuzz-tool-schema-runtime-20260530 May 31, 2026 16:58
@steipete steipete closed this May 31, 2026
@shakkernerd
shakkernerd deleted the fix-doctor-runtime-tool-schema-errors-20260531 branch October 19, 2026 23:34
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. 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.

2 participants