Skip to content

fix(workflow-controller): 还没写描述也能先把参考图存下来 - #923

Open
johnnyzhang-eng wants to merge 1 commit into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/907-upload-before-prompt
Open

fix(workflow-controller): 还没写描述也能先把参考图存下来#923
johnnyzhang-eng wants to merge 1 commit into
1024XEngineer:mainfrom
johnnyzhang-eng:fix/907-upload-before-prompt

Conversation

@johnnyzhang-eng

Copy link
Copy Markdown
Contributor

Closes #907

updateCharacterSetup 既保存描述也保存参考图,却在入口 nonEmpty(input.prompt, 'prompt') 拒空描述。用户先传图再想文案时,上传成功了、回写却被拒——图就丢了,而界面上参考图那栏标的是「选填」,报错说的是「prompt 不能为空」,两个词也对不上。

实测:新建项目传了角色正面图,referenceMedia 落库为 [],于是 #909 加的「用我上传的图当母版」那个候选压根不出现。

真正必填的是提交生成那一刻,那道闸在生成按钮上(prompt 为空时按钮置灰),这里不需要再拦一次。

前端 format / lint / typecheck / 1382 passed / build 全过。新增一条用例,变异测试红(退回拒空即失败)。

updateCharacterSetup 既保存描述也保存参考图,却在入口拒空描述。用户先传图再想
文案时,上传成功了、回写却被拒,图就丢了 —— 而界面上参考图那栏标的是「选填」,
报错说的是「prompt 不能为空」,两个词也对不上。

实测:新建项目传了牛的正面图,referenceMedia 落库为空,于是「用我上传的图当母版」
那个候选压根不出现。

真正必填的是提交生成那一刻,那道闸在生成按钮上(prompt 为空时按钮置灰),
这里不需要再拦一次。

Closes 1024XEngineer#907
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
windup Ready Ready Preview Aug 28, 2026 8:48pm

@fennoai fennoai 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.

审阅了角色设定更新、角色母版生成入口及其测试覆盖。上传参考图后保存空描述的目标路径是正确的,但生成必填约束目前可被另一个 UI 入口绕过;定向测试未能运行,因为工作区中的 vitest 可执行文件权限不足。

// 在这里拒空等于「上传成功了,但因为你还没写描述,图丢了」,而界面上参考图那栏
// 标的是「选填」。真正必填的是**提交生成**那一刻,那道闸在生成按钮上(prompt 为空
// 时按钮置灰),不需要这里再拦一次。
const prompt = input.prompt ?? ''

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.

[P1] Retain prompt validation at the generation boundary

This now persists an empty prompt, but the separate character-template node's ready-state action remains enabled and calls generateCharacterTemplate without an options.input override. That path consumes setupNode.input.prompt directly and submits it to the generation API, so a user who uploads a reference image first can click that button and start generation with an empty required description. Please keep the empty value for the upload/update operation while validating the stored prompt in generateCharacterTemplate/the submission path (or otherwise disable that second entry point when it is empty).

@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...end/src/features/workflow-controller/controller.ts 0.00% 0 Missing and 1 partial ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #923      +/-   ##
==========================================
- Coverage   86.12%   86.12%   -0.01%     
==========================================
  Files         306      306              
  Lines       24037    24037              
  Branches     3646     3647       +1     
==========================================
- Hits        20703    20701       -2     
  Misses       2360     2360              
- Partials      974      976       +2     
Flag Coverage Δ
backend 91.27% <ø> (ø)
frontend 79.83% <0.00%> (-0.02%) ⬇️

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

Files with missing lines Coverage Δ
...end/src/features/workflow-controller/controller.ts 83.08% <0.00%> (-0.11%) ⬇️

... and 1 file with indirect coverage changes

🚀 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: 先传参考图会报「prompt 不能为空」,用户被迫先写描述

1 participant