[bug] model code --lang curl 生成的 embedding 示例 JSON 缺闭合括号,原样执行必失败
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- shell, typescript
- Domain
- cli
Research direction
Run bl model code --model text-embedding-v4 --lang curl, then search the TypeScript CLI sources for the curl output template and its embedding --data JSON. Update the template so both JSON objects close, and verify the generated command runs successfully after replacing the workspace placeholder; check that Python and Java output remains unchanged.
Written by the indexing model from the issue text.
Description
Environment
- CLI: bl 2.0.1(npm 最新)
- Skill: 2.0.1(bailian-* 整包)
- Node: v24.8.0
- OS: macOS 15 (Darwin 25.6.0, arm64)
- Region: cn (cn-beijing)
Reproduce
bl model code --model text-embedding-v4 --lang curl
生成输出(末尾 --data 的 JSON 缺少 }} 闭合):
curl --location 'https://[workspace-id].cn-beijing.maas.aliyuncs.com/api/v1/services/embeddings/text-embedding/text-embedding' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"model": "text-embedding-v4",
"input": {
"texts":["衣服的质量杠杠的,很漂亮,不枉我等了这么久啊,喜欢,以后还来这里买"]
}'
把 [workspace-id] 替换为实际 workspace 后原样执行。
Expected
生成的示例(替换 workspace 占位符后)可直接运行成功,返回 embedding 向量。
Actual
服务端返回 400:
{"code":"BadRequest.JsonDecodeError","message":"truncated JSON document","request_id":"e1bbb878-ebb0-9518-8b1c-99a769b062fd"}
原因:--data 的 JSON 体只有 { "model": ..., "input": { "texts": [...] ,缺少外层与 input 对象的闭合 }}。手工补齐后同一请求成功(返回 1024 维向量)。
Full output
{"code":"BadRequest.JsonDecodeError","message":"truncated JSON document","request_id":"e1bbb878-ebb0-9518-8b1c-99a769b062fd"}
Exit code: 0 (curl 本身成功,服务端 400)
JSON error (if any)
{
"code": "BadRequest.JsonDecodeError",
"message": "truncated JSON document",
"request_id": "e1bbb878-ebb0-9518-8b1c-99a769b062fd"
}
Already tried
- bl 2.0.1 已是 npm 最新版,skill 版本一致
qwen3.7-text-embedding等其他 embedding 模型同样复现(模板共性问题)- 同一请求体补齐
}}后 curl 成功 → 排除鉴权/网络/参数问题,定位为示例生成器模板 bug - python/java 两种
--lang生成正常,仅 curl 受影响
Notes
- Frequency: always(所有 embedding 模型的 curl 示例均缺闭合括号)
- Invoked via: terminal / agent (Claude Code)
- Dominant language
- TypeScript
- Stars
- 333
- Forks
- 28
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 37
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelstudioai/cli
-
[bug] bl update: darwin-arm64 binary ships invalid ad-hoc signature, killed by macOS (Killed: 9)Open
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
modelstudioai/cli#223 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
modelstudioai/cli#231 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
modelstudioai/cli#230 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
modelstudioai/cli#229 ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
modelstudioai/cli#202 · 1 comment · 1 reaction ·
All issues in modelstudioai/cli
Similar issues
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 68/100
remix-run/react-router#15558 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
solana-foundation/pay-kit#341 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
supabase/agent-skills#607 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day