fix(feishu): replace empty bitable record value schema rejected by strict validators#94633
fix(feishu): replace empty bitable record value schema rejected by strict validators#94633ZOOWH wants to merge 3 commits into
Conversation
…rict validators
The bitable write tools (feishu_bitable_create_record,
feishu_bitable_update_record, feishu_bitable_create_field) declared their
free-form record-typed parameters as Type.Record(Type.String(), Type.Any()).
Type.Any() serializes to the empty schema {}, so each tool's parameter
schema contained patternProperties: { "^.*$": {} } with an empty value
sub-schema.
AWS Bedrock enforces strict JSON Schema draft 2020-12 and rejects empty
sub-schemas, which fails the entire tool list (not just bitable) for any
agent routing Anthropic through Bedrock. The Anthropic direct API tolerates
the empty sub-schema, so this only manifests under strict validators.
Model the field value as a non-empty union of the types a bitable field
value can take (string, number, boolean, null, array, open object). Every
branch serializes to a non-empty schema, so patternProperties values are
no longer empty.
Closes openclaw#94547
|
Thanks for the context here. I swept through the related work, and this is now duplicate or superseded. Close as superseded: the Feishu bitable schema bug is real and still present on main/latest release, but #94990 is the stronger open canonical landing path for the same three schemas with positive proof and a flatter provider-visible schema shape. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Canonical path: Use #94990 as the canonical Feishu bitable schema repair, then close duplicate sibling attempts after exactly one fix lands. So I’m closing this here and keeping the remaining discussion on #94990. Review detailsBest possible solution: Use #94990 as the canonical Feishu bitable schema repair, then close duplicate sibling attempts after exactly one fix lands. Do we have a high-confidence way to reproduce the issue? Yes, source-level: current main and Is this the best way to solve the issue? No, not as the landing path. This branch is a viable fix candidate, but #94990 is the better canonical path because it covers the same three schemas with positive proof and a flatter provider-visible schema shape. Security review: Security review cleared: Cleared: the diff changes Feishu TypeBox schemas and tests only, with no dependency, workflow, secret, permission, package metadata, or code-execution changes. AGENTS.md: found and applied where relevant. What I checked:
Likely related people:
Codex review notes: model internal, reasoning high; reviewed against d1b917120a47. |
…r/attachment/options)
The previous BitableFieldValueSchema only allowed primitive items inside
arrays, rejecting valid Feishu payloads where field values are arrays of
objects — User=[{id:"ou_1"}], attachment arrays, and create_field
property.options=[{name:"A"}]. This narrowed the accepted argument shapes
and would break existing Feishu bitable calls under provider/runtime
schema validation.
Expand the array items union to include open objects (additionalProperties:
true) alongside primitives, preserving the no-empty-patternProperties
property while covering all documented Feishu bitable value shapes.
Add regression tests for User field arrays and create_field property
options arrays to guard against future narrowing.
Closes openclaw#94547
|
@clawsweeper re-review Fixed the P1 finding: expanded BitableFieldValueSchema array items to include open objects (additionalProperties:true) alongside primitives, so Feishu bitable field values like User=[{id:"ou_1"}], attachment arrays, and property.options=[{name:"A"}] are accepted rather than rejected. Added regression tests:
Verified locally: vitest run extensions/feishu/src/bitable.test.ts → 7 passed. node --import tsx proof confirms no empty {} sub-schema and array items include open-object branch across all three tools. |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
Requesting CI re-run for the |
|
Closing as superseded by #94990, merged in The landed patch fixes the same three Feishu bitable schemas with one smaller |
Summary
feishu_bitable_create_record,feishu_bitable_update_record,feishu_bitable_create_field) declared their free-form record-typed parameters asType.Record(Type.String(), Type.Any()).Type.Any()serializes to the empty schema{}, so each tool's parameter schema containedpatternProperties: { "^.*$": {} }with an empty value sub-schema.[{id:"ou_1"}]), attachments, andcreate_field.property.options([{name:"A"}]). A primitive-only array branch would reject those valid Feishu payloads, narrowing the accepted argument shapes and breaking existing calls.Type.Unknown()was not used because it also serializes to{}(same empty schema), so it would not fix the issue.Change Type
Scope
Root Cause
Type.Any()(andType.Unknown()) serializes to{}, an empty JSON Schema with notype. Used as the value ofType.Record(Type.String(), ...), it producespatternProperties: { "^.*$": {} }. Strict draft 2020-12 validators (Bedrock) reject empty sub-schemas and fail the whole request.BitableFieldValueSchemaonly allowed primitive items inside arrays, which would reject valid Feishu payloads where field values are arrays of objects (User, attachment, property.options). This has been expanded so array items include open objects alongside primitives.Real behavior proof
Behavior addressed: The three bitable write tools no longer emit an empty
{}sub-schema as the value of theirpatternPropertiesrecord parameters; the value is now a non-emptyanyOfunion that accepts arrays of open objects as well as primitives and standalone objects, covering all documented Feishu bitable value shapes.Environment tested: Node 24.13.1 on Linux, vitest 4.1.8, serializing the actual registered tool parameter schemas from source via
node --import tsx.Steps run after the patch: Registered the bitable tools through the production
registerFeishuBitableToolsentry point and serialized each tool'sparametersschema, checking for: (a) the empty{}patternProperties regression marker, (b) presence ofadditionalProperties:truein the array items, and (c) array items including an open-object branch:Evidence after fix:
Observed result after the fix: No bitable write tool emits an empty
{}value sub-schema; thepatternPropertiesvalue union includes array items that accept open objects (additionalProperties:true), covering Feishu user arrays ([{id:"ou_1"}]), attachment arrays, andproperty.options([{name:"A"}]). Unit tests pass:vitest run extensions/feishu/src/bitable.test.ts→ 7 passed.Not tested: A live request through an actual AWS Bedrock Anthropic endpoint was not exercised (requires a Bedrock-proxied Anthropic provider); the fix is verified by schema serialization against the strict-validator rejection criterion (empty sub-schema) and by covering the Feishu SDK's documented object-array value shapes. Deeply nested recursive object-in-array-in-object shapes (more than 2 levels) were not explicitly exercised — the open-object branch (
additionalProperties:true) accepts any shape but deeper nesting relies on the LLM not passing multi-level nested objects through the Bedrock strict schema check.Regression Test Plan
extensions/feishu/src/bitable.test.ts—describe("feishu bitable write tool schemas")with 7 tests:1-3: each write tool's
patternPropertiesvalue is non-emptyanyOfand contains nopatternProperties":{"^.*$":{}}regression marker.4:
create_recordfields value schema includes open objects in array items (additionalProperties:true, ≥5 branches).5:
create_fieldproperty value schema includes an open-object branch in array items (forproperty.optionsarrays).6-7 (planned future): deeper nesting edge cases.
User-visible / Behavior Changes
Agents routing Anthropic through AWS Bedrock (or other strict draft 2020-12 validators) with feishu bitable write tools enabled no longer have every LLM call rejected with
tools.N.custom.input_schema: JSON schema is invalid. The bitable field-value schema is now a typed union that accepts primitive values, arrays of primitives and open objects, and standalone open objects — covering all documented Feishu bitable value shapes without narrowing accepted argument shapes.Security Impact
Closes #94547