forked from bai/curriculum-project-hub
fix(hub): strip card markdown images + prefer inline ![] over send_file
Feishu interactive markdown rejects  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  for 图文, send_file only for downloadable attachments. Release v0.0.37.
This commit is contained in:
@@ -296,7 +296,8 @@ function mcpInstructions(enabledTools: ReadonlySet<CphHubMcpToolId>): string {
|
||||
const instructions: string[] = [];
|
||||
if (enabledTools.has("send_file")) {
|
||||
instructions.push(
|
||||
"Use send_file when the user asks to receive, resend, download, or attach a file.",
|
||||
"Use send_file only for downloadable attachments the user should save (PDF, DOCX, ZIP, etc.).",
|
||||
"For inline 图文 answers, put  in the final assistant text instead of send_file; the hub embeds those images in the reply card.",
|
||||
"Do not claim a file was sent unless send_file returns success.",
|
||||
"If a generated file path is uncertain, list or inspect the workspace first, then call send_file with the actual path.",
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user