Skip to content

POK-53: 支持:飞书文件与语音附件本地持久化#59

Draft
HYT-koota wants to merge 1 commit into
danielwpz:mainfrom
HYT-koota:codex/pok-53-lark-inbound-files
Draft

POK-53: 支持:飞书文件与语音附件本地持久化#59
HYT-koota wants to merge 1 commit into
danielwpz:mainfrom
HYT-koota:codex/pok-53-lark-inbound-files

Conversation

@HYT-koota
Copy link
Copy Markdown
Collaborator

@HYT-koota HYT-koota commented May 25, 2026

这次 PR 的定位

@HYT-koota HYT-koota marked this pull request as draft May 25, 2026 10:31
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7152fe90e1

ℹ️ About Codex in GitHub

Your team has set up Codex to 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 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +3207 to +3208
type: descriptor.kind === "audio" ? "audio" : "file",
},
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Request audio resources with file type

The new audio download path calls messageResource.get with params.type: "audio", but the IM resource API accepts image or file (audio/video are fetched via file). In real audio-message traffic this causes the fetch to fail and no local asset is persisted, so the main feature in this commit is broken for audio inputs.

Useful? React with 👍 / 👎.

Comment on lines 3308 to 3310
async function readLarkResourceBuffer(stream: NodeJS.ReadableStream): Promise<Buffer> {
const chunks: Buffer[] = [];
for await (const chunk of stream) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid buffering full inbound files in memory

This implementation reads each attachment stream fully into a Buffer before writing it to disk. For large file/media uploads, that can cause high memory spikes or OOM in the inbound worker, because Buffer.concat materializes the entire payload at once; streaming directly to a file (with backpressure and optional size limits) is needed for reliable production handling.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant