Files
Genarrative/apps
k88936 7c67a6fcc0 agc_generate_image 的 kind 传了非字符串不再静默当成 image
- bridge_image_generation_kind 原来用 and_then(Value::as_str)…unwrap_or("image"):{"kind":true}、{"kind":5}、{"kind":[]} 都会被当成 image 继续生成;空串也会被静默当默认值
- 改成按 schema 语义区分:缺省与显式 null 用默认 image;字符串按原值走 canonical 校验(空串/未知值走 KindUnsupported);其它类型返回新的 GenerateImageError::KindNotText { got }
- 测试补四条断言:kind=true 报「kind 必须是字符串」、kind="" 报「不是受支持的素材类型」、缺省与 null 仍解析为 image

验证:cargo test --bin genarrative-ai-game-creator-shell -- agent::direct_tool_bridge:: 41 passed;agent:: tests::project:: 1078 passed(两条失败为既有 flaky:art_director_request_exposes_canvas_only_for_the_keyed_owner_route / background_agent_runtime_can_generate_platform_art_asset,单独重跑通过)
2026-10-01 15:39:56 +08:00
..