← Back to PRs

#16438: feat(feishu): add create_from_markdown import action

by ciberponk open 2026-02-14 19:08 View on GitHub →
channel: feishu size: S
## 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