fix(hub): strip card markdown images + prefer inline ![] over send_file

Feishu interactive markdown rejects ![](http...) without image_key
(error 230099 empty/missing imagekey). Always mask residual image md in
card builders; skip img tags with empty keys; skip inline-code examples;
fetch remote images with a browser UA and without env HTTP_PROXY.
Steer the agent: use ![alt](workspace-path) for 图文, send_file only for
downloadable attachments.

Release v0.0.37.
This commit is contained in:
2026-07-20 11:38:55 +00:00
parent 73cb0e5b47
commit 93f3f2424c
7 changed files with 71 additions and 16 deletions
@@ -42,6 +42,12 @@ describe("outbound markdown image parsing", () => {
);
expect(maskMarkdownImagesForStreaming("![](https://x/y.png)")).toBe("【图片】");
});
it("ignores markdown image examples inside inline code", () => {
const text = "例如 `![](images/img_5.png)` 这样写,不会当真实图片";
expect(findMarkdownImagesOutsideCode(text)).toEqual([]);
expect(maskMarkdownImagesForStreaming(text)).toBe(text);
});
});
describe("materializeAnswerSegments", () => {