[AI] fix(plugins): recognize document-extractors as a capability kind…#91597
Conversation
|
Codex review: needs maintainer review before merge. Reviewed June 28, 2026, 5:01 AM ET / 09:01 UTC. Summary PR surface: Source +2, Tests +20. Total +22 across 2 files. Reproducibility: yes. for the inspect classification symptom by source inspection: current main and Review metrics: 1 noteworthy metric.
Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness 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:
Next step before merge
Security Review detailsBest possible solution: Land the diagnostic fix after maintainers accept the additive public inspect kind, while keeping the broader document extraction runtime/build regression on its linked PR path. Do we have a high-confidence way to reproduce the issue? Yes for the inspect classification symptom by source inspection: current main and Is this the best way to solve the issue? Yes for the diagnostic bug: wiring the existing manifest contract into the inspect classifier is the narrow owner-boundary fix. It is not the complete runtime document-reading fix for the linked user report. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 7ba9212665a7. Label changesLabel justifications:
Evidence reviewedPR surface: Source +2, Tests +20. Total +22 across 2 files. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
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
|
Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597.
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597.
0fafe27 to
459d11c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
459d11c to
5fad0c5
Compare
Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597.
… in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to openclaw#91539
Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597.
5fad0c5 to
70ce170
Compare
|
Land-ready verification for
This lands the inspect-classification fix only. It does not claim to fix runtime PDF/DOCX extraction, so #91539 remains open for the separate package/runtime path. |
|
Merged via squash.
|
openclaw#91597) * [AI] fix(plugins): recognize document-extractors as a capability kind in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to openclaw#91539 * [AI] test(plugins): add document-extractors shape contract coverage Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597. * [AI] chore: rebase on main to refresh CI * test(plugins): fold extractor into shape matrix --------- Co-authored-by: Peter Steinberger <[email protected]>
openclaw#91597) * [AI] fix(plugins): recognize document-extractors as a capability kind in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to openclaw#91539 * [AI] test(plugins): add document-extractors shape contract coverage Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597. * [AI] chore: rebase on main to refresh CI * test(plugins): fold extractor into shape matrix --------- Co-authored-by: Peter Steinberger <[email protected]>
openclaw#91597) * [AI] fix(plugins): recognize document-extractors as a capability kind in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to openclaw#91539 * [AI] test(plugins): add document-extractors shape contract coverage Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597. * [AI] chore: rebase on main to refresh CI * test(plugins): fold extractor into shape matrix --------- Co-authored-by: Peter Steinberger <[email protected]>
openclaw#91597) * [AI] fix(plugins): recognize document-extractors as a capability kind in inspect-shape PluginCapabilityKind did not include "document-extractors", causing plugins that declare contracts.documentExtractors (like document-extract) to show capabilityCount=0 and shape="non-capability" in plugins inspect. Add "document-extractors" to PluginCapabilityKind and read from plugin.contracts.documentExtractors in buildPluginCapabilityEntries(). Related to openclaw#91539 * [AI] test(plugins): add document-extractors shape contract coverage Add a test case verifying that plugins declaring contracts.documentExtractors are classified as plain-capability shape with capabilityCount=1 and capabilities including the document-extractors kind. Addresses ClawSweeper P2 review finding on PR openclaw#91597. * [AI] chore: rebase on main to refresh CI * test(plugins): fold extractor into shape matrix --------- Co-authored-by: Peter Steinberger <[email protected]>
Summary
PluginCapabilityKindininspect-shape.tsdid not include"document-extractors", so plugins declaringcontracts.documentExtractors(like the bundleddocument-extractplugin) showedcapabilityCount: 0,tools: [], andshape: "non-capability"inopenclaw plugins inspect. This made the plugin appear broken in diagnostics even though its contract declaration was correct.Add
"document-extractors"to thePluginCapabilityKindunion type and readplugin.contracts?.documentExtractorsinbuildPluginCapabilityEntries(), so the inspection system correctly reflects the plugin's declared extraction capability.Change Type
Scope
Linked Issue
Motivation
The document-extract plugin (bundled,
contracts.documentExtractors: ["pdf"]) was misclassified as"non-capability"shape withcapabilityCount: 0inopenclaw plugins inspect. Users upgrading to 2026.6.1 saw the plugin report zero capabilities despite the manifest contract being valid, causing confusion about whether PDF/DOCX extraction was functional.The root cause is that
PluginCapabilityKind— the enumeration used bybuildPluginCapabilityEntries()to count and classify plugin capabilities — never included"document-extractors". All other contract types (providers, channels, etc.) have corresponding capability kinds, butdocumentExtractorswas missing from the list.Changes
File:
src/plugins/inspect-shape.ts"document-extractors"toPluginCapabilityKindtype union (alphabetically after"transcript-source"){ kind: "document-extractors" as const, ids: plugin.contracts?.documentExtractors ?? [] }entry inbuildPluginCapabilityEntries()No new imports. Reads from
plugin.contracts?.documentExtractorswhich already exists onPluginRecordviaPluginManifestContracts.Verification
src/plugins/contracts/shape.contract.test.ts— passed (1 test)src/plugins/status.test.ts— passed (27 tests)src/plugins/contracts/registry.contract.test.ts— passed (21 tests)Real Behavior Proof
Behavior addressed: Plugins with
contracts.documentExtractorsnow show correctcapabilityCount,shape, andcapabilitiesinopenclaw plugins inspectoutput.Real environment tested: Linux (Ubuntu), Node.js 22.19+, local checkout on branch
fix/document-extractors-capability-kind-91539, commit 12b8f60.Exact steps or command run after this patch:
Evidence after fix: Live
openclaw plugins inspectoutput confirms the fix:shape"non-capability""plain-capability"capabilityCount01capabilityMode"none""plain"capabilities[][{"kind":"document-extractors","ids":["pdf"]}]Full after-fix output (redacted workspace path):
{ "shape": "plain-capability", "capabilityMode": "plain", "capabilityCount": 1, "capabilities": [ { "kind": "document-extractors", "ids": ["pdf"] } ], "plugin": { "id": "document-extract", "status": "loaded", "contracts": { "documentExtractors": ["pdf"] } } }Observed result after fix: Shape diagnostic correctly reflects document-extract contract as a plugin capability.
What was not tested: Runtime document extraction functionality (PDF/DOCX file reading) is unchanged — this PR only fixes diagnostic display.
Risks
PluginCapabilityKindis used inPluginCapabilityEntry.kindandPluginShapeSummary.capabilities[].kind. Adding a new union member is additive — existing consumers that iterate or filter onkindwill now see"document-extractors"entries. No breaking change for code that pattern-matches on the existing kinds.