Skip to content

fix(cli): clarify asyncTaskId vs generationId in gen status/download + better error message#14230

Merged
arvinxx merged 6 commits into
canaryfrom
fix/gen-status-taskid-error
Apr 27, 2026
Merged

fix(cli): clarify asyncTaskId vs generationId in gen status/download + better error message#14230
arvinxx merged 6 commits into
canaryfrom
fix/gen-status-taskid-error

Conversation

@arvinxx

@arvinxx arvinxx commented Apr 27, 2026

Copy link
Copy Markdown
Member

问题

lh gen status/download 命令在传错 ID 时会触发服务端 500,完全没有有用的错误提示。

根本原因:命令签名是 <generationId> <taskId><taskId> 这个名字不够明确,容易让人误传 gen_xxx(generation ID),而实际上需要传的是 asyncTaskId(UUID 格式,打印在 → Task 后面)。

传错 ID 后,getGenerationStatusasync_tasks 表里查不到记录,抛 NOT_FOUND,但 Vercel/tRPC 层包成了 500,CLI 只吐出一堆 stack trace。

变更

apps/cli/src/commands/generate/index.ts

  • 命令签名 <taskId><asyncTaskId>,和 server 端 tRPC 入参字段名对齐
  • statusdownload 均加了 try/catch,识别 NOT_FOUND / INTERNAL_SERVER_ERROR,输出清晰的引导信息,告知用户 asyncTaskId 是 → Task 后面的 UUID 而非 gen_xxx

packages/builtin-skills/src/lobehub/references/generate.ts

  • 命令签名 <taskId><asyncTaskId>
  • 补充 ⚠️ asyncTaskId vs generationId 说明段,附带示例,明确标出哪个是 asyncTaskId

.agents/skills/cli/references/generate.md(内部开发 skill,顺带更新)

  • 同步修正参数名和说明

测试

复现步骤:

lh gen video "..." -m doubao-seedance-2-0-260128 -p volcengine --aspect-ratio 9:16 --duration 5
# 错误用法(传 gen_xxx 作为第二个参数)
lh gen status gen_abc123 gen_abc123
# 修复后输出:
# ✗ Task not found: gen_abc123
#   Make sure you are passing the correct asyncTaskId (the UUID shown
#   after "→ Task" in the video/image output), not the generation ID (gen_xxx).

@vercel

vercel Bot commented Apr 27, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
lobehub Ready Ready Preview, Comment Apr 27, 2026 3:28pm

Request Review

@dosubot dosubot Bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Apr 27, 2026

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @arvinxx, you have reached your weekly rate limit of 500000 diff characters.

Please try again later or upgrade to continue using Sourcery

@dosubot dosubot Bot added the Bug label Apr 27, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8f68331ac7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/cli/src/commands/generate/index.ts Outdated
@codecov

codecov Bot commented Apr 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.03%. Comparing base (a521045) to head (069c89b).
⚠️ Report is 7 commits behind head on canary.

Additional details and impacted files
@@             Coverage Diff             @@
##           canary   #14230       +/-   ##
===========================================
+ Coverage   68.00%   86.03%   +18.03%     
===========================================
  Files        2260      620     -1640     
  Lines      193666    51652   -142014     
  Branches    23366     8719    -14647     
===========================================
- Hits       131694    44440    -87254     
+ Misses      61843     7083    -54760     
  Partials      129      129               
Flag Coverage Δ
app ?
database 92.04% <ø> (ø)
packages/agent-runtime 79.93% <ø> (ø)
packages/context-engine 83.25% <ø> (ø)
packages/conversation-flow 92.40% <ø> (ø)
packages/file-loaders 87.02% <ø> (ø)
packages/memory-user-memory 74.74% <ø> (ø)
packages/model-bank 99.89% <ø> (ø)
packages/model-runtime 84.28% <ø> (ø)
packages/prompts 68.17% <ø> (ø)
packages/python-interpreter 92.90% <ø> (ø)
packages/ssrf-safe-fetch 0.00% <ø> (ø)
packages/utils 88.41% <ø> (ø)
packages/web-crawler 88.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
Store ∅ <ø> (∅)
Services ∅ <ø> (∅)
Server ∅ <ø> (∅)
Libs ∅ <ø> (∅)
Utils 93.47% <ø> (+13.42%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@arvinxx arvinxx changed the base branch from main to canary April 27, 2026 10:52
@arvinxx arvinxx merged commit ef5be7e into canary Apr 27, 2026
24 of 25 checks passed
@arvinxx arvinxx deleted the fix/gen-status-taskid-error branch April 27, 2026 15:16
mutoe pushed a commit to mutoe/lobehub that referenced this pull request May 1, 2026
…+ better error message (lobehub#14230)

* 🔖 chore(release): release version v2.1.53 [skip ci]

* fix(cli): improve gen status/download error message for wrong asyncTaskId

* docs(cli-skill): clarify asyncTaskId vs generationId in gen status/download

* fix(builtin-skills): clarify asyncTaskId vs generationId in gen status/download

* fix(cli): distinguish asyncTaskId not found vs generationId not found in error message

* Update package.json

---------

Co-authored-by: lobehubbot <i@lobehub.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants