Repository navigation
Conversation
Greptile SummaryThis PR fixes a bug in the Key observations:
Confidence Score: 4/5
Prompt To Fix All With AIThis is a comment left during a code review.
Path: extensions/feishu/src/docx.ts
Line: 1322-1330
Comment:
**Unnecessary `clearDocumentContent` call and misleading `blocks_deleted` in response**
`writeDoc()` always calls `clearDocumentContent()` as its first step (line 825), which lists the document's blocks and then issues a batch-delete request. For a freshly-created document this produces zero deletions, but it still fires two extra API calls (a list + a no-op delete) on every `create` + `content` invocation.
Additionally, the spread `{ ...created, ...writeResult }` will include `blocks_deleted: 0` in the returned JSON. Callers of the `create` action are likely to find this field confusing or misleading, since no blocks were ever deleted.
Two possible improvements:
1. Exclude `blocks_deleted` from the merged result when calling from `create`:
```suggestion
if (p.content) {
const writeResult = await writeDoc(
client,
created.document_id,
p.content,
getMediaMaxBytes(p, defaultAccountId),
api.logger,
);
const { blocks_deleted: _bd, ...writeResultWithoutDeleted } = writeResult;
return json({ ...created, ...writeResultWithoutDeleted });
}
```
2. Alternatively, extract an `appendOnlyDoc` helper (similar to `appendDoc`) that skips the clear step, and call that from `create` instead of `writeDoc`.
How can I resolve this? If you propose a fix, please make it concise.Last reviewed commit: 4d6accc |
There was a problem hiding this comment.
Pull request overview
This PR fixes feishu_doc’s create action so that when content is provided, the tool immediately writes the provided markdown into the newly created Feishu Doc (instead of creating a title-only document and requiring a second write call).
Changes:
- Update
feishu_doccreateaction to callwriteDoc()aftercreateDoc()whencontentis provided. - Return a merged response containing both document metadata (id/url) and write results (e.g., blocks/images processed).
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4d6accc891
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
332be61 to
b82fc86
Compare
|
Codex review: needs real behavior proof before merge. Latest ClawSweeper review: 2026-05-22 08:52 UTC / May 22, 2026, 4:52 AM ET. Workflow note: Future ClawSweeper reviews update this same comment in place. How this review workflow works
Summary Reproducibility: yes. Source inspection on current main gives a high-confidence path: pass PR rating Rank-up moves:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. Real behavior proof Mantis proof suggestion Risk before merge
Maintainer options:
Next step before merge Security Review findings
Review detailsBest possible solution: Land a refreshed Feishu plugin change that writes create-time markdown through the existing write path, preserves created metadata or rolls back on write failure, and includes redacted real Feishu proof; otherwise reject Do we have a high-confidence way to reproduce the issue? Yes. Source inspection on current main gives a high-confidence path: pass Is this the best way to solve the issue? No, not yet. Create-plus-write through the existing Label justifications:
Full review comments:
Overall correctness: patch is incorrect Acceptance criteria:
What I checked:
Likely related people:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 25e489395ab0. |
…ided - Create case now calls writeDoc() if content is provided - Strips blocks_deleted from merged response (new doc has no deletions) - Rebased onto latest upstream/main Co-authored-by: 小欧 🦊 <[email protected]>
Lint/check step rejects bare underscore _ as unused variable. Rename to 'omitted' and use void to suppress the warning.
TS2339: Property 'content' does not exist on type. The create action schema was missing the optional content field.
Break long Type.Optional line to match project convention.
93630c1 to
46c89af
Compare
|
ProjectClownfish pushed a narrow repair to this branch so the original contributor path can stay canonical. Source PR: #48377 |
|
ClawSweeper PR egg 🎁 Pass real behavior proof to wake the egg and unlock a hatchable treat. Where did the egg go?
|
|
This pull request has been automatically marked as stale due to inactivity. |
|
Closing due to inactivity. |
Summary
Fixes #48373
The
feishu_doccreateaction was silently ignoring thecontentparameter, creating an empty document with only the title. Agents had to make a separatewritecall to populate the document.Root Cause
In
extensions/feishu/src/docx.ts, thecreatecase only calledcreateDoc(), which does not accept acontentparameter. Thep.contentvalue was never referenced.Fix
The
createcase now:contentis provided, callswriteDoc()to populate itChanges
Testing
createDoc()signature andwriteDoc()parameters match the existing codebasewriteDoc()function which handles markdown conversion, chunked insertion, and image processing🤖 Submitted by 小欧 🦊