fix(feishu): recover JSON media filenames#81125
Conversation
|
Codex review: needs real behavior proof before merge. Summary Reproducibility: yes. by source inspection: current main leaves JSON file_name metadata and payload fallback filenames raw, and the existing media test pins the mojibake value. I did not run live Feishu or local tests in this read-only review. Real behavior proof Next step before merge Security Review detailsBest possible solution: Land the narrow Feishu plugin fix after redacted real runtime proof, or an explicit maintainer proof override, confirms patched inbound saves recover CJK filenames while preserving valid Latin-1 names. Do we have a high-confidence way to reproduce the issue? Yes by source inspection: current main leaves JSON file_name metadata and payload fallback filenames raw, and the existing media test pins the mojibake value. I did not run live Feishu or local tests in this read-only review. Is this the best way to solve the issue? Yes for the code direction: reusing the existing conservative Feishu recovery helper at the JSON metadata and fallback boundaries is narrow and matches the prior Content-Disposition fix. The remaining blocker is proof, not a better code design. Acceptance criteria:
What I checked:
Likely related people:
Remaining risk / open question:
Codex review notes: model gpt-5.5, reasoning high; reviewed against 4d2e70872640. |
|
Pushed follow-up commit What changed:
Validation on PR head
Author check before push: I do not have credentialed live Feishu proof from this environment, so the proof question may still require maintainer acceptance or a separate redacted live Feishu receipt/save log. This push addresses the code correctness gap from the review. @clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. Re-review progress:
|
6d6adb7 to
90b4221
Compare
…ame-mojibake # Conflicts: # extensions/feishu/src/bot-content.ts
|
Rebased/merged current Local verification after resolving:
Latest head: |
|
Resolved the branch conflict with current Verification run from Result: 2 test files passed, 109 tests passed. |
|
I believe the author-side work here is complete, but this PR still looks blocked on the real-behavior proof/re-review path rather than code changes. The branch has the Feishu JSON filename mojibake fix and previously supplied focused behavior evidence; the remaining gap appears to be the proof evaluation/review state. Could ClawSweeper or a maintainer please re-run/re-check the real behavior proof for the current PR head? @clawsweeper re-review |
|
Closing this to free an open PR slot. ClawSweeper still needs real behavior proof here, so this can be reopened if we can provide that proof later. |
Summary
Fixes #81103
Real behavior proof
Behavior or issue addressed: Feishu inbound media responses can provide a JSON
file_namevalue whose UTF-8 CJK bytes were interpreted as Latin-1, causing saved filenames like武汉15座山登山信息汇总.csvto become mojibake. This PR makes the JSON metadata path recover the CJK filename the same way the Content-Disposition path already does, while preserving valid Latin-1 filenames.Real environment tested: Local OpenClaw checkout on macOS in
/Users/andy/openclaw-81103, branchfix/feishu-json-filename-mojibake, Node v25.8.2 / pnpm v11.1.0. The local run used the actual patched Feishu media code path and the exact JSONfile_namepayload shape from the report; no Feishu secrets were printed.Exact steps or command run after this patch:
Evidence after fix: Terminal output from the local OpenClaw checkout:
Observed result after fix: The CJK filename from the JSON
file_namepayload is recovered as武汉15座山登山信息汇总.csvinstead of remaining mojibake, and the valid Latin-1 filenamecafé-©.txtremains unchanged. The focused Feishu media and bot tests both passed after the patch.What was not tested: I did not run a credentialed live Feishu bot upload/download against Feishu's production API in this environment. The live external service path should be equivalent because this fix runs after Feishu returns the download response metadata and before OpenClaw passes the filename to media storage.
Validation
pnpm test extensions/feishu/src/media.test.tspnpm test extensions/feishu/src/bot.test.tspnpm exec oxfmt --check --threads=1 extensions/feishu/src/media.ts extensions/feishu/src/media.test.tspnpm check:changed -- --base upstream/main --head HEADPR settings
If this PR is squashed or reworked, please preserve author attribution or include: Co-authored-by: Andy Ye 35905412+TurboTheTurtle@users.noreply.github.com