Skip to content

fix(feishu): replace Type.Any() with explicit AnyJsonValue schema for Bedrock compatibility#95276

Closed
qingminglong wants to merge 1 commit into
openclaw:mainfrom
qingminglong:fix/94547-feishu-type-any
Closed

fix(feishu): replace Type.Any() with explicit AnyJsonValue schema for Bedrock compatibility#95276
qingminglong wants to merge 1 commit into
openclaw:mainfrom
qingminglong:fix/94547-feishu-type-any

Conversation

@qingminglong

@qingminglong qingminglong commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix three bitable write tools that use Type.Record(Type.String(), Type.Any()) which serializes to empty {} sub-schema, rejected by AWS Bedrock strict draft 2020-12 validation.

Changes

  • Add AnyJsonValue schema (Type.Unsafe<any>({ anyOf: [string, number, boolean, null, array, object] }))
  • Replace Type.Any() in CreateRecordSchema.fields, CreateFieldSchema.property, UpdateRecordSchema.fields

Related issue

Closes #94547

Real behavior proof

Behavior addressed: Type.Any() 序列化为空 {} 被 AWS Bedrock strict draft 2020-12 拒绝

Real environment tested: Linux 4.19.112, Node v22.18.0, typebox

Before-fix evidence:

{ "type": "object", "patternProperties": { "^.*$": {} } }

{} patternProperties 子 schema 不满足 draft 2020-12 的 anyOf/type 约束。

Exact steps or command run after this patch:

node -e "const {Type}=require('typebox'); \
  const V=Type.Unsafe({anyOf:[{type:'string'},{type:'number'},{type:'boolean'},{type:'null'},{type:'array'},{type:'object'}]}); \
  console.log(JSON.stringify(Type.Record(Type.String(),V),null,2))"

After-fix evidence:

{
  "type": "object",
  "patternProperties": {
    "^.*$": {
      "anyOf": [
        { "type": "string" }, { "type": "number" }, { "type": "boolean" },
        { "type": "null" }, { "type": "array" }, { "type": "object" }
      ]
    }
  }
}

patternProperties 子 schema 包含明确的 anyOf,符合 strict draft 2020-12。

Observed result after the fix: 三处 Type.Any()(CreateRecordSchema.fields、CreateFieldSchema.property、UpdateRecordSchema.fields)全部替换为 AnyJsonValue,工具 schema 不再被 AWS Bedrock 拒绝。

What was not tested: 未在包含 AWS Bedrock 的实际环境中验证(缺少 Bedrock 凭证)。schema 序列化对比确认了修复效果。

Type.Any() 序列化为空 {},被 AWS Bedrock 严格 draft 2020-12 校验拒
绝。替换为 Type.Unsafe() 的显式 anyOf 定义(string/number/boolean/
null/array/object)。

Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
@openclaw-barnacle openclaw-barnacle Bot added channel: feishu Channel integration: feishu size: XS triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. labels Jun 20, 2026
@clawsweeper

clawsweeper Bot commented Jun 20, 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: the Feishu/Bedrock schema bug is real, but #94990 is already the stronger open canonical fix for the same three provider-visible schemas, with registered-tool regression coverage and proof marked sufficient.

Root-cause cluster
Relationship: superseded
Canonical: #94990
Summary: This PR is one of several candidate fixes for the same Feishu bitable empty nested schema failure; the open canonical sibling has stronger proof and tests.

Members:

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

Canonical path: Land exactly one Feishu-local schema repair through #94990, then close the duplicate sibling PRs and let the linked issue close from the merged fix.

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

Review details

Best possible solution:

Land exactly one Feishu-local schema repair through #94990, then close the duplicate sibling PRs 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 emit the three Type.Any() record schemas, TypeBox 1.1.39 stores that empty value under patternProperties, and Bedrock receives tool parameters directly. I did not run a live Bedrock request in this read-only review.

Is this the best way to solve the issue?

No. This PR is a plausible narrow repair, but #94990 is the better canonical landing path because it fixes the same schemas with registered-tool coverage and avoids this branch's provider-visible anyOf value shape.

Security review:

Security review cleared: The diff changes one Feishu TypeBox schema file only, with no changes to secrets, permissions, dependency sources, workflows, package metadata, or code execution paths.

AGENTS.md: found and applied where relevant.

What I checked:

  • Root policy read: Root AGENTS.md and extensions/AGENTS.md were read fully; provider-visible schema compatibility, dependency-contract, best-fix, and plugin-boundary guidance affected this review. (AGENTS.md:28, a1271830948b)
  • Current main still has the reported failing schemas: Current main defines create-record fields, create-field property, and update-record fields with Type.Record(Type.String(), Type.Any()), so the linked issue is still a real current-main bug. (extensions/feishu/src/bitable.ts:533, a1271830948b)
  • Latest release still has the same schema shape: The latest release tag v2026.6.8 carries the same three Feishu bitable Type.Any() record value schemas, matching the shipped-version report. (extensions/feishu/src/bitable.ts:533, 844f405ac1be)
  • Bedrock receives the plugin schema directly: The Amazon Bedrock runtime maps each OpenClaw tool's parameters directly into toolSpec.inputSchema.json, making this Feishu schema provider-visible. (extensions/amazon-bedrock/stream.runtime.ts:916, a1271830948b)
  • TypeBox dependency contract inspected: TypeBox 1.1.39 Any() and Unknown() create empty schema objects, while Record stores the supplied value schema under patternProperties, matching the empty nested schema root cause. (1.1.39)
  • Canonical sibling is open and viable: fix(feishu): emit non-empty value schema for bitable write tools (#94547) #94990 is open, mergeable, labeled proof: sufficient and status: ready for maintainer look, and its diff changes the same three schemas while adding registered-tool regression tests. (extensions/feishu/src/bitable.ts:525, fa7bf3faac8c)

Likely related people:

  • Yifeng Wang: Commit 2267d58 introduced the community Feishu plugin, including the bitable implementation and plugin package wiring. (role: introduced behavior; confidence: medium; commits: 2267d58afcc7; files: extensions/feishu/src/bitable.ts, extensions/feishu/openclaw.plugin.json, extensions/feishu/package.json)
  • gaowanqi08141999: Commit 86517b8 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)
  • Peter Steinberger: Recent Feishu bitable history includes the TypeBox schema migration and follow-up bitable validation/account-gate fixes on the same file. (role: recent area contributor; confidence: medium; commits: b2472d65607a, c0094a232d00, 0ee5f47fbabb; files: extensions/feishu/src/bitable.ts)

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

@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. labels Jun 20, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

/clawsweeper

@openclaw-barnacle openclaw-barnacle Bot removed the triage: needs-pr-context Candidate: external PR body lacks required problem context or evidence. label Jun 20, 2026
@clawsweeper clawsweeper Bot added proof: sufficient ClawSweeper judged the real behavior proof convincing. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. P1 High-priority user-facing bug, regression, or broken workflow. merge-risk: 🚨 compatibility 🚨 May break existing users, config, migrations, defaults, or upgrade paths. 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. and removed status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. labels Jun 20, 2026
@qingminglong

Copy link
Copy Markdown
Contributor Author

please help to merge,thanks

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.

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

2 participants