Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

[bug] model code --lang curl 生成的 embedding 示例 JSON 缺闭合括号,原样执行必失败

Open Beginner friendly
#232 0 comments 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from modelstudioai/cli

All issues in modelstudioai/cli

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.