Skip to content

fix(messaging): prefer local media paths over keys - #174

Merged
riba2534 merged 1 commit into
mainfrom
codex/fix-media-key-path
Jul 30, 2026
Merged

riba2534 merged 1 commit into
mainfrom
codex/fix-media-key-path

Conversation

@riba2534

Copy link
Copy Markdown
Owner

变更

  • 本地媒体路径存在时优先于 img_ / file_ 资源 key 前缀
  • 同步修复独立媒体参数和 --upload-images 的路径判定
  • 覆盖图片、文件、Opus、MP4、视频封面和内联图片回归测试
  • 更新 feishu-cli-messaging Skill 的歧义处理说明

根因

媒体输入此前仅按字符串前缀识别飞书资源 key,导致当前目录中的
img_logo.png、file_report.pdf 等真实文件跳过上传,并把文件名作为无效 key 提交。

验证

  • go test ./...
  • go test -race ./cmd
  • go vet ./...
  • make check-skills
  • gofmt -l cmd internal
  • git diff --check
  • 使用真实编译产物在专用飞书话题测试群验证裸相对路径图片和文件,读回类型分别为 image、file

@riba2534

Copy link
Copy Markdown
Owner Author

@codex review

@riba2534
riba2534 merged commit 74754bd into main Jul 30, 2026

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

Copy link
Copy Markdown

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: b7ad8b3ffc

ℹ️ 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 thread cmd/send_message.go
Comment on lines +225 to +226
_, err = os.Stat(resolvedPath)
return err == nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P3 Badge Restrict path precedence to regular files

When a real Feishu key happens to match a directory or another non-regular filesystem entry in the current/base directory, os.Stat succeeds, so the key is reclassified as a local path and later rejected by image/file validation instead of being sent unchanged. The documented precedence applies to existing media files; check info.Mode().IsRegular() here before overriding an img_/file_ key.

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