Files
Genarrative/apps
k88936 66e4ece692 入参给了非字符串值时按字段报类型错,不再混进「不能为空」
- ToolTextField 增加 not_text(got),optional_text 在 as_str() 失败时返回它;原来数字/布尔/数组/对象会和空串、null 一起落到 field.empty(),{"prompt":5} 报成「prompt 不能为空」
- 9 个工具 enum 按字段各加一个 NotText 变体(KindNotText、PromptNotText、AspectRatioNotText…),文案形如「生成图片失败:aspectRatio 必须是字符串,当前是「5」。」,仍是一 case 一变体、文案写在变体上
- GenerateImageTextField 改为实现 ToolTextField,删掉 generate_image_optional_text / generate_image_required_text 这两份与共享实现重复的拷贝,generate_image 改走 optional_text / required_text
- 空串 / null / 缺省仍按原来的空值语义处理,只有「有值但不是字符串」换成类型错
- 新增 non_text_field_values_report_a_type_error_instead_of_an_empty_value 覆盖 create_or_derive、prepare_game_art、generate_image 三条路径

验证:cargo test --bin genarrative-ai-game-creator-shell -- agent::direct_tool_bridge:: 41 passed;全量 agent:: 952 passed(唯一失败 concurrent_distinct_frozen_root_steers_create_only_one_replacement 是既有 flaky,单独重跑通过)
2026-10-01 15:01:20 +08:00
..