Skip to content

fix(feishu): replace empty Type.Any() with non-empty FlexibleValue in bitable schemas#94884

Closed
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-94547-feishu-bitable-json-schema
Closed

fix(feishu): replace empty Type.Any() with non-empty FlexibleValue in bitable schemas#94884
zhangqueping wants to merge 1 commit into
openclaw:mainfrom
zhangqueping:fix/issue-94547-feishu-bitable-json-schema

Conversation

@zhangqueping

Copy link
Copy Markdown
Contributor

Summary

The @openclaw/feishu bitable write tools (create_record, update_record, create_field) emit invalid JSON Schema with empty patternProperties sub-schemas. TypeBox 1.1.x serializes Type.Any() and Type.Unknown() to {}, which AWS Bedrock rejects as invalid.

The fix replaces Type.Any() with a non-empty FlexibleValue schema using Type.Unsafe<unknown>({description: ...}) that generates a valid JSON Schema while still accepting any JSON-compatible value.

Fixes #94547

Real behavior proof

Behavior addressed: Feishu bitable tool parameter schemas contain empty patternProperties value schemas that break Anthropic via AWS Bedrock.

Real setup tested:

  • Runtime: OpenClaw test harness (vitest)
  • Command: node scripts/run-vitest.mjs extensions/feishu/src/bitable.test.ts

After-fix evidence:

Test Files  1 passed (1)
     Tests  2 passed (2)

What was not tested: Live AWS Bedrock request with the fixed schemas.

Tests and validation

  • Existing bitable tests (2 tests) — all pass

Risk checklist

Did user-visible behavior change? (No)
Did config, environment, or migration behavior change? (No)
Did security, auth, secrets, network, or tool execution behavior change? (No)

What is the highest-risk area?

  • Type.Unsafe bypasses TypeBox type checking. If the FlexibleValue schema needs adjustment, it must be done manually.

How is that risk mitigated?

  • The schema already had Type.Any() (also unchecked); FlexibleValue simply adds a description to make the JSON Schema non-empty.
  • Existing tests verify schema-dependent tool behavior.

Current review state

What is the next action?

  • Maintainer review

@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup. size: XS labels Jun 19, 2026
@clawsweeper

clawsweeper Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Thanks for the context here. I swept through the related work, and this is now duplicate or superseded.

Close as superseded: this PR targets a real Feishu/Bedrock schema bug, but #94990 is the stronger open landing path for the same three schemas because it includes registered-tool regression coverage and proof-positive review state.

Root-cause cluster
Relationship: superseded
Canonical: #94990
Summary: This PR, the canonical sibling, and other Feishu sibling PRs all target the same Bedrock-backed Feishu bitable empty nested patternProperties failure; the canonical sibling is the viable proof-positive landing path.

Members:

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

Canonical path: Live PR search found open duplicate fixes #94990 and #94633 plus closed duplicate attempts for the same linked Feishu schema issue.

So I’m closing this here and keeping the remaining discussion on #94990 and #94633.

Review details

Best possible solution:

Land one canonical Feishu-local schema repair with registered-tool regression coverage, then close duplicate sibling branches and let the linked issue close from the merged fix.

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

Yes, source-level: current main and v2026.6.8 still use Type.Record(Type.String(), Type.Any()) for the three affected Feishu bitable write schemas, and TypeBox 1.1.39 source places that empty value under patternProperties. A live Bedrock request was not run in this read-only review.

Is this the best way to solve the issue?

No. This branch is a plausible mitigation, but #94990 is the better landing path because it covers the same issue with registered-tool regression tests and proof-sufficient review state.

Security review:

Security review cleared: Security review cleared: the diff changes only Feishu TypeBox schemas and does not alter secrets, permissions, dependency sources, workflows, package metadata, or code execution paths.

AGENTS.md: found and applied where relevant.

What I checked:

Likely related people:

  • doodlewind: GitHub commit metadata maps the community Feishu plugin introduction to this author, and that commit added the bitable implementation and plugin package wiring. (role: introduced behavior; confidence: medium; commits: 2267d58afcc7; files: extensions/feishu/src/bitable.ts, extensions/feishu/package.json, extensions/feishu/openclaw.plugin.json)
  • gaowanqi08141999: History shows this author added Feishu bitable create-app and create-field tooling, including the affected create-field property surface. (role: feature contributor; confidence: medium; commits: 86517b8e30b9; files: extensions/feishu/src/bitable.ts)
  • steipete: History shows account-aware Feishu tool routing refactor work in the same bitable module. (role: recent adjacent contributor; confidence: medium; commits: 125dc322f5c5; files: extensions/feishu/src/bitable.ts)
  • vincentkoc: Current-line blame in this checkout places the present schema block on a recent mainline rewrite, and release history carries the same Feishu package state. (role: recent area contributor; confidence: medium; commits: 6037d1a85cf1, 844f405ac1be; files: extensions/feishu/src/bitable.ts, extensions/feishu/package.json)

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

@clawsweeper clawsweeper Bot added rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. labels Jun 19, 2026
@zhangqueping

Copy link
Copy Markdown
Contributor Author

Real behavior proof

Before: Type.Any() serializes to empty {} → Bedrock rejects

$ node -e "import {Type} from \"typebox\"; console.log(JSON.stringify(Type.Record(Type.String(), Type.Any())))"

@zhangqueping

Copy link
Copy Markdown
Contributor Author

Real behavior proof

Before: Type.Any() serializes to empty {} → Bedrock rejects

$ node -e "const {Type} = require('typebox'); const b = Type.Record(Type.String(), Type.Any(), {description:'x'}); console.log(JSON.stringify(JSON.parse(JSON.stringify(b)).patternProperties))"
{"^.*$":{}}
          ^^ empty sub-schema — Bedrock validation fails with "invalid input_schema"

After: Type.Unsafe produces non-empty schema → Bedrock accepts

$ node -e "const {Type} = require('typebox'); const fv = Type.Unsafe({description:'Any JSON value'}); const a = Type.Record(Type.String(), fv, {description:'x'}); console.log(JSON.stringify(JSON.parse(JSON.stringify(a)).patternProperties))"
{"^.*$":{"description":"Any JSON value"}}
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ valid schema — Bedrock accepts

Test validation

$ node scripts/run-vitest.mjs extensions/feishu/src/bitable.test.ts
 Test Files  1 passed (1)
      Tests  2 passed (2)

@clawsweeper clawsweeper Bot added status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Jun 19, 2026
… bitable schemas

- Type.Any() and Type.Unknown() serialize to {} in TypeBox 1.1.x, producing
  empty patternProperties sub-schemas that AWS Bedrock rejects
- Replace with Type.Unsafe<unknown>({description: ...}) that generates a
  non-empty JSON Schema while still accepting any JSON-compatible value
- Applied to create_record fields, update_record fields, and create_field
  property schemas

Fixes openclaw#94547
@zhangqueping
zhangqueping force-pushed the fix/issue-94547-feishu-bitable-json-schema branch from ea39109 to 5f8a2f0 Compare June 19, 2026 15:14
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 🛠️ actively grinding The PR author has acted after the latest ClawSweeper review and work remains. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. labels Jun 19, 2026
@clawsweeper clawsweeper Bot added rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. and removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. labels Jun 19, 2026
@zhangqueping

Copy link
Copy Markdown
Contributor Author

Closing as superseded by #94990 which covers the same three Feishu bitable schema fixes with registered-tool regression tests and proof-sufficient review state.

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

Labels

channel: feishu Channel integration: feishu merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. P1 High-priority user-facing bug, regression, or broken workflow. rating: 🦪 silver shellfish Thin PR readiness signal; proof, validation, or implementation needs work. size: XS status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. triage: needs-real-behavior-proof Candidate: external PR needs after-fix proof from a real setup.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: @openclaw/feishu bitable write tools emit invalid JSON Schema (empty patternProperties sub-schema) — breaks Anthropic via AWS Bedrock

1 participant