fix(quick-start): stop sending a self-derived character name - #358
Merged
minorcell merged 1 commit intoAug 18, 2026
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Contributor
There was a problem hiding this comment.
已核对 Quick Start 的候选图确认和上传母版两条路径:它们共用 persistCharacterTemplate,删除前端构造的 name 后,请求序列化会省略该字段,后端 CharacterCreate 与 resolve_character_name 会按描述生成并统一限制到 20 字;新增回归测试也能防止该字段重新进入创建参数。未发现由本次变更引入的正确性或兼容性问题。
验证:固定 SHA 范围的 git diff --check 通过。尝试运行 service.test.ts,但当前工作区未安装可用的前端依赖,vitest 无法启动,因此未在本地重跑测试。
Quick Start built the character name from the first 32 characters of the prompt, but CharacterCreate.name accepts at most 20, so confirming a character template failed for any prompt longer than 20 characters. Drop the name from the create payload and let the backend derive it from the description, matching what workflow-editor already does. Long prompts now finish character creation, and the backend naming added in 1024XEngineer#329 becomes reachable from Quick Start.
huyanxius
force-pushed
the
fix/quick-start-character-name
branch
from
August 18, 2026 03:19
850246c to
0226879
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Quick Start 创建角色时不再自己拼角色名,改由后端按描述生成。提示词超过 20 字的角色现在能正常完成确认母版,不再在最后一步失败。
Why
persistCharacterTemplate用提示词前 32 字作为角色名,而CharacterCreate.name的上限是 20 字(web/api/character.py:35,DB 字段为String(20))。提示词超过 20 字时POST /characters在参数校验阶段就被拒:{"code": 400, "message": "请求参数校验失败", "data": [{"type": "string_too_long", "loc": ["body", "name"], "msg": "String should have at most 20 characters"}]}失败点在流程末尾——母版候选图已生成、用户已选定,点确认才报错,生成开销白花。中文描述几乎必然超过 20 字,因此这条路径基本不可用。
同时,因为 Quick Start 始终传入
name,#329 加的后端自动起名在这条路径上永远走不到。Changes
name,由后端按description生成。name一旦重新出现在创建请求里就失败。Implementation
CreateCharacterInput.name本就是可选字段(entities/character/index.ts:67),workflow-editor/runtime.ts一直是不传name的形状,这次让两条创建路径一致。没有改成"前端截到 20 字":截断提示词正是后端起名失败时的兜底值,前端硬截等于把最差结果写死,也会继续绕开 #329。删除后名称长度由后端单点保证。
Verification
npm run format:check:通过,153 个文件npm run lint:通过npm run typecheck:通过npm run test:coverage:51 个文件 / 530 passed、4 skippednpm run build:通过uv run ruff check .:通过uv run lint-imports:2 kept, 0 brokenuv run pytest -q:723 passed、20 skippedopenapi.json无变化AI_*凭据的本地全栈才能观察后端起名的真实结果)Scope
setup.input.name,取不到仍显示「工作流 #id」。Related Issues
Closes #344
Refs #188, #284, #329