Skip to content

AI turns documents or topics into real, native PowerPoint decks—with native shapes, transitions and animations, data-backed charts and tables on demand, audio narration from speaker notes, and support for your own .pptx templates. · by Hugo He

fix(image-gen): honor confirmed image_ai_path and image_strategy from Confirm UI

hugohe3f5b829601259
diff --git a/skills/ppt-master/SKILL.md b/skills/ppt-master/SKILL.md
index c868f8a8..10005f9d 100644
--- a/skills/ppt-master/SKILL.md
+++ b/skills/ppt-master/SKILL.md
@@ -404,6 +404,8 @@ A deck with only `ai` rows never loads `image-searcher.md`; a deck with only `we
> ⚠️ **In-pipeline ai path MUST use manifest mode** — even when only 1 ai row exists. Write `images/image_prompts.json` first, then run `image_gen.py --manifest`, then `image_gen.py --render-md` to produce the `image_prompts.md` sidecar. The positional form (`image_gen.py "prompt" ...`) is reserved for **out-of-pipeline one-off testing / single-image fixups** — it skips manifest + sidecar, leaving no audit trail.
+> ⚠️ **Honor the confirmed image source**: the `ai` generation path (Path A = `image_gen.py` API / Path B = host-native tool / Offline Manual) is **not** auto-only — a confirmed `result.json.image_ai_path` other than `auto` wins. `host-native` forces Path B even when `IMAGE_BACKEND` is configured; `api` forces Path A; `manual` forces offline. The `--manifest` command above is Path A. Full selection rule: [image-generator.md](references/image-generator.md) §7 Path Selection.
+
Workflow:
1. Extract all rows with `Status: Pending` and `Acquire Via ∈ {ai, web}` from the design spec
diff --git a/skills/ppt-master/references/image-generator.md b/skills/ppt-master/references/image-generator.md
index 29117b5f..ec4d8984 100644
--- a/skills/ppt-master/references/image-generator.md
+++ b/skills/ppt-master/references/image-generator.md
@@ -417,14 +417,17 @@ C (AI-generated) supports three implementation modes sharing one `image_prompts.
| `IMAGE_BACKEND` not configured (or Path A fails) AND host has a native image tool | **Path B**: Host-native tool | Agent invokes the host's image capability; outputs land at `project/images/<filename>` |
| **Both Path A and Path B fail/unavailable** | **Offline Manual Mode** | Manifest stays on disk; user generates externally from `items[].prompt` and places files at `project/images/<filename>` |
-**Selection logic** — monotonic A → B → C fallback chain (automatic, no user prompting):
+**Selection logic** — the confirmed user choice wins; absent one, fall back to the automatic A → B → C chain:
+0. **Confirmed override (wins)** — read `<project>/confirm_ui/result.json`. If `image_ai_path` is present and not `auto`, it is an explicit user choice and is honored directly, **even when it contradicts `IMAGE_BACKEND`**:
+ - `api` → **Path A** (`image_gen.py --manifest`).
+ - `host-native` → **Path B** (host's native image tool) — skip A *even if `IMAGE_BACKEND` is configured*.
+ - `manual` → **Offline Manual** (write prompts, hand off).
+ A chat instruction ("use Codex's image tool" / "走接口生成") is equivalent. If the chosen path turns out unavailable (e.g. `host-native` but the host has no image tool), fall through along the chain below from that point. Only when `image_ai_path` is `auto` / absent (or there is no `result.json`) does the automatic chain decide.
1. **Try Path A** — if `IMAGE_BACKEND` is configured (env or `.env`), run `image_gen.py --manifest`. If it fails twice in a row, fall to Path B.
2. **Try Path B** — if `IMAGE_BACKEND` was not configured (A skipped), or A failed, and the host has a native image tool (Codex / Antigravity / Claude Code / similar), the agent invokes the host's image capability directly.
3. **Fall to C (Offline Manual)** — if B is also unavailable (no host-native tool) or fails, write prompts to `images/image_prompts.json` and hand off to the user.
-**User override**: If the user explicitly names Path B ("use Codex's image tool"), skip A and start at B. Explicit naming is the only way to bypass an earlier path in the chain; otherwise the chain is monotonic.
-
**Hard rule**: Step 4 is execution, not re-decision. Never present an interactive choice between paths here — image strategy was locked in Strategist Step 4 h item.
> All three modes share one output contract: file at `project/images/<filename>`. Step 6 SVG references are mode-agnostic.
diff --git a/skills/ppt-master/references/strategist.md b/skills/ppt-master/references/strategist.md
index 7cfd2200..7f97f556 100644
--- a/skills/ppt-master/references/strategist.md
+++ b/skills/ppt-master/references/strategist.md
@@ -336,7 +336,7 @@ After the candidates, append one line:
| Span a personality spectrum | Typically: one conservative-default (industry norm), one shifted-tone (same fit, 1-2 ticks different), one bold-contrast (more expressive, may challenge default). No near-duplicates. |
| `Mood` line MUST include a real-world analogy | Company / publication / event the user can picture. Adjective stacks alone are forbidden. |
| Adapt labels to chat language | Schema is English by default. Chinese chat → render as 「方案 A / 视觉 / 色彩 / 情绪」. Structure stays the same; only the labels translate. |
-| Skip presentation when user has specified | User-named rendering or palette (chat / brand / template) bypasses the candidate flow — lock directly per the truth-precedence rule. |
+| Skip presentation when user has specified | User-named rendering or palette (chat / brand / template), **or a Confirm UI pick in `result.json.image_strategy`** (same shape as color / typography honoring their confirmed candidate), bypasses the candidate flow — lock *that chosen candidate's* `rendering` + `palette` directly per the truth-precedence rule; do not re-pick. |
| `custom` is a tail-case, not a default | When no preset fits, a candidate may set `rendering: custom` and / or `palette: custom` (rules: [`image-renderings/_index.md`](../image-renderings/_index.md) §1.5, [`image-palettes/_index.md`](../image-palettes/_index.md) §2). At most one candidate per dimension may carry `custom`; one candidate may carry both dimensions as `custom`. `Visual` / `Color` lines describe the behavior in prose, never by naming a competing preset. |
**Forbidden — padding with conflicts**: if e.'s HEX cannot find ≥3 compatible palettes, present the smaller set (2 candidates) and state "your color is unusual — only N palettes can carry it without conflict." A `custom` candidate is allowed only when its prose genuinely describes a tail-case the presets cannot — not as a slot-filler. Never fill remaining slots with known-conflicting options.
diff --git a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
index 63c44a3b..9d7b9058 100644
--- a/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
+++ b/skills/ppt-master/scripts/confirm_ui/static/catalogs.json
@@ -389,16 +389,16 @@
"label": "Path A",
"label_zh": "接口后端",
"label_en": "Path A",
- "desc_zh": "触发条件:已配置图像后端;机制:第 5 步运行图像生成脚本。",
- "desc_en": "IMAGE_BACKEND configured; image_gen.py runs in Step 5."
+ "desc_zh": "强制走接口后端,第 5 步运行 image_gen.py(需已配置 IMAGE_BACKEND)。",
+ "desc_en": "Force the API backend — image_gen.py runs in Step 5 (requires IMAGE_BACKEND)."
},
{
"id": "host-native",
"label": "Path B",
"label_zh": "宿主原生工具",
"label_en": "Path B",
- "desc_zh": "触发条件:未配置图像后端,且当前环境提供原生图像工具;机制:直接调用宿主工具生成。",
- "desc_en": "IMAGE_BACKEND not configured and host has a native image tool; host-native generation."
+ "desc_zh": "强制使用当前环境的原生图像工具生成(即使配置了 IMAGE_BACKEND 也跳过接口);需宿主提供原生图像工具(Codex / Claude Code 等)。",
+ "desc_en": "Force the host's native image tool (skips the API even if IMAGE_BACKEND is set); requires a host with a native image tool (Codex / Claude Code / similar)."
},
{
"id": "manual",
diff --git a/skills/ppt-master/scripts/docs/confirm_ui.md b/skills/ppt-master/scripts/docs/confirm_ui.md
index f966d635..8179500e 100644
--- a/skills/ppt-master/scripts/docs/confirm_ui.md
+++ b/skills/ppt-master/scripts/docs/confirm_ui.md
@@ -133,7 +133,7 @@ Both files live under `<project_path>/confirm_ui/`.
```
- Any option field may instead hold a **free-text custom string** (the user picked **Custom**); `color` / `typography` custom entries set `name: "custom"`. Image usage custom values must be concrete prose plans, not the literal string `"custom"`. The AI interprets custom text against the canonical references.
-- `image_ai_path` and `image_strategy` are omitted from `result.json` unless `image_usage` is `ai` or a custom image plan that may include generated images.
+- `image_ai_path` and `image_strategy` are omitted from `result.json` unless `image_usage` is `ai` or a custom image plan that may include generated images. Both are honored downstream as confirmed choices: `image_ai_path` drives the Step 5 generation path (`image-generator.md` §7 — `host-native` forces the host tool even when `IMAGE_BACKEND` is set), and the chosen `image_strategy` candidate is locked verbatim by Strategist h.5 (no re-pick).
- After the user clicks **Confirm**, the page saves `result.json` and shuts the server down (auto-close). In the default `--daemon --wait` flow, the waiting command returns and the AI reads `result.json` immediately; no second chat confirmation is required. Chat confirmation remains the fallback when the page cannot be used. Either way, Step 4 ends with a `--shutdown` cleanup so a never-confirmed page cannot keep holding port 5050 ahead of the Step 6 live preview.
## Scope