#16438: feat(feishu): add create_from_markdown import action
channel: feishu
size: S
Cluster:
Memory Management Enhancements
## Summary
- feat(feishu): add create_from_markdown import action
- Split from our `v2026.2.13` patch train as a single-purpose change for easier review.
## Why
- Keep the diff focused and low-risk so it can be merged or reverted independently.
## Scope
- Branch: `feat/feishu-doc-import-create-from-markdown-en`
- Files changed: 3
- Key files:
- `extensions/feishu/src/doc-schema.ts`
- `extensions/feishu/src/docx.test.ts`
- `extensions/feishu/src/docx.ts`
## Test Plan
- Suggested local command:
- `./node_modules/.bin/vitest run extensions/feishu/src/docx.test.ts`
- Validation status:
- [ ] CI checks pass
- [ ] Maintainer re-ran local tests
## Risk & Rollback
- Risk: low to medium; impact limited to touched module(s).
- Rollback: revert this PR commit(s) cleanly.
## Co-authorship
- Co-authored by @ciberponk and Codex (GPT-5).
<!-- greptile_comment -->
<h3>Greptile Summary</h3>
Added `create_from_markdown` action to the `feishu_doc` tool, enabling direct document creation from markdown content via Feishu's import task API. The implementation creates a temporary document, uploads the markdown file, initiates an import task, polls for completion (60s timeout with 2s intervals), and cleans up the temporary document.
**Key changes:**
- New schema entry for `create_from_markdown` action with required `title`, `content`, and `folder_token` parameters
- `createDocFromMarkdownViaImport` function handles the import workflow with polling logic
- Test coverage for the happy path with simulated polling
- Tool description updated to list the new action
**Notes:**
- The cleanup (deletion of temporary document) runs in the `finally` block immediately after import completion, which could potentially race with Feishu's read operations on the temporary file
- Polling logic uses a 60-second timeout with 2-second intervals
<h3>Confidence Score: 4/5</h3>
- This PR is safe to merge with low risk
- The change adds a focused new feature (markdown import) with reasonable implementation. The polling logic has a known issue already documented in previous threads. The main uncertainty is around the timing of the temporary file cleanup which could theoretically race with Feishu's import process, but this is marked as best-effort cleanup. The test coverage validates the happy path. Overall risk is low since this is a new optional action that doesn't modify existing behavior.
- No files require special attention
<sub>Last reviewed commit: 5411e1a</sub>
<!-- greptile_other_comments_section -->
<!-- /greptile_comment -->
Most Similar PRs
#16592: feat(feishu): add write mode import for markdown documents
by ciberponk · 2026-02-14
88.6%
#16647: feat(feishu_doc): allow optional initial content on create
by ciberponk · 2026-02-15
81.2%
#16607: feat(feishu): add get_public_permission doc action
by ciberponk · 2026-02-14
78.6%
#20304: feat(feishu): support Docx table create/write + image/file upload a...
by xuhao1 · 2026-02-18
78.5%
#14402: fix(feishu): chunk large documents for write/append to avoid API 40...
by lml2468 · 2026-02-12
77.6%
#16637: feat(feishu_doc): support optional public_access on create
by ciberponk · 2026-02-14
77.4%
#16594: feat(feishu): add set_public_permission doc action
by ciberponk · 2026-02-14
76.2%
#16409: fix(feishu): preserve docx block order via sequential inserts
by ciberponk · 2026-02-14
72.6%
#14674: feat(feishu): add feishu_chat tool for chat info/member queries
by liuweifly · 2026-02-12
71.7%
#12755: feat(feishu): render post rich text as markdown
by WilsonLiu95 · 2026-02-09
71.4%