Skip to content

fix(tools): emit warning for empty allOf/anyOf availability groups (fixes #92361) - #92368

Closed
liuhao1024 wants to merge 1 commit into
openclaw:mainfrom
liuhao1024:fix/availability-empty-group-warning
Closed

liuhao1024 wants to merge 1 commit into
openclaw:mainfrom
liuhao1024:fix/availability-empty-group-warning

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

What does this PR do?

Emit a console.warn diagnostic when tool availability descriptors contain empty allOf/anyOf groups, instead of silently hiding the tool. Also adds the signal property to these diagnostics for consistency with other diagnostic types.

Related Issue

Fixes #92361

Type of Change

  • Bug fix (non-breaking)

Changes Made

  • src/tools/availability.ts: Add signal property to empty-group diagnostics; emit console.warn in evaluateToolAvailability when unsupported-signal diagnostics are detected
  • src/tools/planner.test.ts: Update test expectation to match new diagnostic shape

How to Test

  1. node scripts/run-vitest.mjs run src/tools/availability.test.ts — all 9 tests pass
  2. node scripts/run-vitest.mjs run src/tools/planner.test.ts — all 6 tests pass
  3. Observe console.warn output in stderr for the malformed-availability test case

Real behavior proof

Behavior or issue addressed:
Empty allOf/anyOf arrays in tool availability descriptors produce unsupported-signal diagnostics that are silently consumed — tools are hidden with no actionable feedback to authors. This is an authoring error that should be surfaced at evaluation time.

Real environment tested:
macOS 26.4.1, Node.js v22, pnpm, OpenClaw main branch (d481994)

Exact steps or command run after the patch:

cd /Users/liuhao/.hermes/workdir/openclaw
node scripts/run-vitest.mjs run src/tools/availability.test.ts src/tools/planner.test.ts

Evidence after fix:

stderr | src/tools/planner.test.ts > buildToolPlan > hides descriptors with malformed empty allOf availability
[openclaw:tools] Tool "malformed" has malformed availability — Empty availability allOf group — this is an authoring error; the group should contain at least one entry

stderr | src/tools/availability.test.ts > evaluateToolAvailability > surfaces an unsupported-signal sibling even when another anyOf branch is available
[openclaw:tools] Tool "example" has malformed availability — Empty availability allOf group — this is an authoring error; the group should contain at least one entry

 ✓  unit  src/tools/planner.test.ts (6 tests) 29ms
 ✓  unit  src/tools/availability.test.ts (9 tests) 32ms

 Test Files  2 passed (2)
      Tests  15 passed (15)

Observed result after fix:
Warning is emitted with tool name and descriptive message when empty availability groups are detected. All 15 tests pass.

What was not tested:
Live gateway startup with malformed descriptors (the fix is in the pure evaluation layer, no gateway integration needed).

Empty allOf/anyOf arrays in tool availability descriptors produce
unsupported-signal diagnostics that were silently consumed — tools
were hidden with no actionable feedback to authors.

- Add signal property to empty-group diagnostics for consistency
- Log console.warn in evaluateToolAvailability when unsupported-signal
  diagnostics are detected, including the tool name and message
- Update messages to clarify these are authoring errors

Fixes openclaw#92361
@openclaw-barnacle openclaw-barnacle Bot added size: XS proof: supplied External PR includes structured after-fix real behavior proof. labels Jun 12, 2026
@clawsweeper

clawsweeper Bot commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs real behavior proof before merge. Reviewed June 12, 2026, 3:01 AM ET / 07:01 UTC.

Summary
Review failed before ClawSweeper could summarize the requested change.

PR surface: Source +14, Tests +2. Total +16 across 2 files.

Reproducibility: unclear. The review failed before ClawSweeper could establish a reproduction path.

Review metrics: none identified.

Merge readiness
Overall: 🌊 off-meta tidepool
Proof: 🌊 off-meta tidepool
Patch quality: 🌊 off-meta tidepool
Result: rating does not apply to this item.

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

Risk before merge

  • [P1] No close action taken because the review did not complete.

Maintainer options:

  1. Decide the mitigation before merge
    Retry the Codex review after fixing the execution failure.
  2. Pause or close
    Do not merge this PR until maintainers decide whether the risk is worth taking.

Next step before merge

  • [P1] Review did not complete, so no work-lane recommendation was made.
Review details

Best possible solution:

Retry the Codex review after fixing the execution failure.

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

Unclear. The review failed before ClawSweeper could establish a reproduction path.

Is this the best way to solve the issue?

Unclear. Retry the review first so ClawSweeper can evaluate the actual issue and fix direction.

AGENTS.md: unclear because the file could not be read completely.

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

Label changes

Label justifications:

  • rating: 🌊 off-meta tidepool: Overall readiness is 🌊 off-meta tidepool; proof is 🌊 off-meta tidepool and patch quality is 🌊 off-meta tidepool.
Evidence reviewed

PR surface:

Source +14, Tests +2. Total +16 across 2 files.

View PR surface stats
Area Files Added Removed Net
Source 1 17 3 +14
Tests 1 3 1 +2
Docs 0 0 0 0
Config 0 0 0 0
Generated 0 0 0 0
Other 0 0 0 0
Total 2 20 4 +16

What I checked:

  • failure reason: retryable codex transport failure (capacity)
  • codex failure detail: Codex review failed for this PR with exit 1.
  • codex stderr: merging.

Likely related people:

  • unknown: Codex failed before it could trace repository history. (role: review did not complete; confidence: low)
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.

@liuhao1024

Copy link
Copy Markdown
Contributor Author

Closing to free up PR slots for higher-quality contributions. The ClawSweeper rating indicates this may not align with the project's current priorities.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proof: supplied External PR includes structured after-fix real behavior proof. rating: 🌊 off-meta tidepool PR readiness rating does not apply to this item. size: XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tool availability evaluator silently ignores empty allOf/anyOf groups during expression normalization

1 participant