Skip to content

fix(quick-start): stop sending a self-derived character name - #358

Merged
minorcell merged 1 commit into
1024XEngineer:mainfrom
huyanxius:fix/quick-start-character-name
Aug 18, 2026
Merged

fix(quick-start): stop sending a self-derived character name#358
minorcell merged 1 commit into
1024XEngineer:mainfrom
huyanxius:fix/quick-start-character-name

Conversation

@huyanxius

Copy link
Copy Markdown
Collaborator

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

  • Quick Start 创建角色时不再传 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 skipped
  • npm run build:通过
  • uv run ruff check .:通过
  • uv run lint-imports:2 kept, 0 broken
  • uv run pytest -q:723 passed、20 skipped
  • OpenAPI 契约漂移检查:openapi.json 无变化
  • 端到端手动验证:Not run(需要配好 AI_* 凭据的本地全栈才能观察后端起名的真实结果)

Scope

  • 本 PR 不包含:Quick Start / Workflow Editor 的「角色名称(选填)」输入框。
  • 本 PR 不包含:后端生成的名称回写 WorkflowRun 供工作流列表展示。当前工作流列表读 setup.input.name,取不到仍显示「工作流 #id」。
  • 后续事项:以上两项属 feat: 支持角色名称填写与自动提取 #188 的前端范围,另开 issue 跟进。

Related Issues

Closes #344
Refs #188, #284, #329

@vercel

vercel Bot commented Aug 17, 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 18, 2026 3:19am

@codecov

codecov Bot commented Aug 17, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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

已核对 Quick Start 的候选图确认和上传母版两条路径:它们共用 persistCharacterTemplate,删除前端构造的 name 后,请求序列化会省略该字段,后端 CharacterCreateresolve_character_name 会按描述生成并统一限制到 20 字;新增回归测试也能防止该字段重新进入创建参数。未发现由本次变更引入的正确性或兼容性问题。

验证:固定 SHA 范围的 git diff --check 通过。尝试运行 service.test.ts,但当前工作区未安装可用的前端依赖,vitest 无法启动,因此未在本地重跑测试。

View job run

@huyanxius
huyanxius requested a review from minorcell August 17, 2026 11:14
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.

@minorcell minorcell left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@minorcell
minorcell merged commit f97426c into 1024XEngineer:main Aug 18, 2026
7 checks passed
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.

fix: Quick Start 自造角色名并超出 20 字上限,绕过后端自动起名

2 participants