openclaw - ✅(Solved) Fix [Bug] feishu_doc write action fails with 'Cannot read properties of undefined (reading 'split')' [1 pull requests, 2 comments, 1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openclaw/openclaw#61336Fetched 2026-04-08 02:59:48
View on GitHub
Comments
2
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
cross-referenced ×1

Error Message

feishu_doc(action="write", doc_token="Mbv0drINRoC67qxqjxPctBMknqF", content="Test content")

Error: Cannot read properties of undefined (reading 'split')

Fix Action

Workaround

Use Feishu Bitable (多维表格) instead of Documents for structured data storage.

PR fix notes

PR #61367: fix(feishu_doc): guard against undefined content in write/append/insert actions

Description (problem / solution / changelog)

Summary

Fixes #61336 - feishu_doc action=write crashes with Cannot read properties of undefined (reading 'split') when content parameter is not passed.

Root Cause

writeDoc, appendDoc, and insertDoc all call chunkedConvertMarkdown which calls markdown.split('\n') without checking if markdown is undefined/null first.

Fix

  • writeDoc: Returns early with zero counts when content is empty (avoids clearing document unnecessarily)
  • appendDoc: Throws 'Content is required' error before making API calls
  • insertDoc: Throws 'Content is required' error before making API calls

Repro (from issue)

feishu_doc action=write, content=undefined  # crashes

Changed files

  • extensions/feishu/src/docx.ts (modified, +9/-0)
  • src/agents/pi-tools.ts (modified, +5/-1)
  • src/agents/tool-policy.test.ts (modified, +24/-0)
  • src/agents/tool-policy.ts (modified, +19/-2)

Code Example

feishu_doc(action="create", title="Test Document")
   # Returns: document_id: Mbv0drINRoC67qxqjxPctBMknqF

---

feishu_doc(action="write", doc_token="Mbv0drINRoC67qxqjxPctBMknqF", content="Test content")
   # Error: Cannot read properties of undefined (reading 'split')
RAW_BUFFERClick to expand / collapse

Bug Description

The feishu_doc tool's write action fails with error: Cannot read properties of undefined (reading 'split').

Steps to Reproduce

  1. Create a document (success):

    feishu_doc(action="create", title="Test Document")
    # Returns: document_id: Mbv0drINRoC67qxqjxPctBMknqF
  2. Write to document (failure):

    feishu_doc(action="write", doc_token="Mbv0drINRoC67qxqjxPctBMknqF", content="Test content")
    # Error: Cannot read properties of undefined (reading 'split')

Expected Behavior

Document content should be written successfully.

Actual Behavior

Error thrown: Cannot read properties of undefined (reading 'split')

Environment

  • OpenClaw Version: 2026.4.2 (d74a122)
  • OS: macOS
  • Node.js: v22.22.0

Function Status Check

FeatureStatus
Document Create✅ Working
Document Write❌ Broken
Bitable Create✅ Working
Bitable Write✅ Working

Impact

Unable to automate Feishu document updates, affecting documentation workflows.

Workaround

Use Feishu Bitable (多维表格) instead of Documents for structured data storage.

extent analysis

TL;DR

The feishu_doc tool's write action fails due to an undefined property error, suggesting a potential issue with the content parameter or the underlying implementation.

Guidance

  • Verify that the content parameter is correctly formatted and does not contain any unexpected characters or structures that could cause the split method to fail.
  • Check the implementation of the feishu_doc tool to ensure that it properly handles the content parameter and any potential edge cases.
  • Consider using the suggested workaround of using Feishu Bitable for structured data storage, as it is reported to be working.
  • Investigate the difference in implementation between the Document Write and Bitable Write features, as the latter is reported to be working.

Example

No code snippet can be provided without more information about the implementation of the feishu_doc tool.

Notes

The exact cause of the error is unclear without more information about the implementation of the feishu_doc tool. The suggested workaround may not be suitable for all use cases, especially if the content is not structured data.

Recommendation

Apply workaround: Using Feishu Bitable for structured data storage may be a viable temporary solution until the issue with the feishu_doc tool is resolved.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING