Files
market/skills/dashscope-image-gen
xyx 42617e292d fix(dashscope-image-gen): 切换到 /images/generations 端点 v1.3.0 (#26)
## 概要 / Summary

修复 dashscope-image-gen 技能的核心端点问题,从 `/chat/completions`(对 wan 图片模型返回 HTTP
400)切换到 `/images/generations`,同时新增多项防护措施防止模型偏离执行路径。

Fix the core endpoint issue: switch from `/chat/completions` (returns
HTTP 400 for wan image models) to `/images/generations`, with enhanced
guardrails to prevent model deviation.

## 变更内容 / Changes

**核心修复**
- 端点:`/chat/completions` → `/images/generations`
- 请求体:`messages` 数组 → `prompt` 字符串 + `size` + `n`
- 响应处理:`choices[].message.content` 图片 URL → `b64_json` base64 解码

**新增防护**
- `curl -o` 保存响应到临时文件,避免 ~2MB base64 灌入终端浪费 token
- 新增"供应商与默认算力"章节,明确 DesireCore Cloud 始终可用,无需探索
- 强化 7 条强制规则(原 5 条),禁止探索未列出的模型/端点/配置文件
- 端口发现优先从系统提示词获取,兜底 `${DESIRECORE_HOME:-$HOME/.desirecore}`
- 错误处理改为表格格式 + "禁止自行重试其他方案"

## 测试 / Test Plan

- [x] dev 模式端到端测试:用户输入"生成一张小猪" → 4 次工具调用,0 失败,图片成功生成并展示
- [x] 对比历史:第一次测试 472 条/7+ 失败 → 第二次 141 条/5 失败 → **本次 108 条/0 失败**
2026-06-10 17:23:52 +08:00
..