Skip to content

fix(ppt-engine): keep a deck's no-quality file name stable - #1155

Merged
LivXue merged 6 commits into
mainfrom
fix/1137-review-findings
Nov 2, 2026
Merged

LivXue merged 6 commits into
mainfrom
fix/1137-review-findings

Conversation

@LivXue

@LivXue LivXue commented Nov 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Follow-up to #1137. This branch carries the review findings that could not be pushed into the contributor's fork branch: the fork is no longer writable.

  • The deck generator in plugins-dist/ppt-engine keyed its generated file name on the effective quality. fix(agent): an empty settings quality no longer pins image calls #1137 makes an empty Settings quality resolve to None where it used to resolve to "", and the digest formatted those two spellings differently even though both send no quality. A deck regenerated after the upgrade therefore stopped overwriting the file its page names. The digest now maps both spellings to the empty spelling's key, so a picker-saved section's deck keeps its name while the call still sends no quality; the exact gpt-image-2 case is the exception under Risk.
  • MediaToolConfig's docstring now states the actual resolution rule: the request's value applies for the gpt-image family; with nothing on the request either, exact gpt-image-2 sends medium and other models send nothing.
  • The media-gen tests now compare an empty Settings quality with a truly unset section, and a live-config e2e covers the report's custom /images/generations route.

Type

  • Fix

Verification

  • Relevant tests pass locally

  • Relevant lint / type checks pass locally

  • User-facing docs or screenshots are updated when needed

  • RED at fix(agent): an empty settings quality no longer pins image calls #1137's base: the picker-saved-empty cases and the custom-route e2e fail, and the deck-name test produces two different file names for the same no-quality request (the two unset-section controls pass).

  • GREEN: pytest tests/test_media_gen_tool.py tests/test_ppt_engine_generate_image_tool.py tests/test_config_self_surface.py tests/test_raven_config_tool.py -q -> 455 passed.

  • The no-quality name is pinned to the empty spelling: normalizing the digest to the None spelling instead makes test_both_spellings_of_no_quality_name_the_same_file fail on the historical name (lantern-b384de827020.png), where the real tree passes.

  • ruff check and ruff format --check on the changed files -> clean.

  • commitlint on the six commits -> 0 problems.

Risk

  • Security impact considered
  • Backward compatibility considered
  • Rollback path is clear for risky changes

One compatibility note: before #1137 the digest had two spellings for "no quality" ("" for an explicitly empty gpt-image section, None for an unset or non-gpt-image one). This PR keeps the "" spelling, which is what the WebUI picker's implicit empty value used; decks whose old name used None still move once. There is no key that preserves both. One class of picker-saved deck is not preserved: an exact gpt-image-2 section's empty quality now resolves to medium (the id's documented default, from #1137), so its name follows the medium spelling and moves once on the first regeneration after the upgrade. Revert this PR to restore the previous digest formatting.

Related Issues

Part of #1106. Follow-up to #1137.

LivXue and others added 4 commits November 1, 2026 13:05
An empty Settings quality now resolves to None instead of "", so a deck regenerated after the upgrade stopped overwriting the file its page names: the digest formatted the two spellings differently even though both send no quality. Normalize the digest to the empty spelling, which is what the picker-saved section used before the fix, and pin it with a test that drives both spellings through the generator.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The old sentence called the fallback the provider default. The resolver sends the request's value for the gpt-image family, keeps gpt-image-2's medium default when the request names none, and sends nothing for the other models, so state exactly that.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The report's provider is a custom OpenAI-compatible base, whose /images/generations route is a different quality-injection site from OpenRouter's /images. Read the section live from a config file, as the agent does, and check the call's quality reaches that request.

Co-Authored-By: Claude Code <noreply@anthropic.com>
The gpt-image-2.5 case was labelled a family without the knob, but it is the same family and takes a quality; what it lacks is the exact-id medium default. Parametrize both section shapes so the "resolves like unset" claim is actually compared.

Co-Authored-By: Claude Code <noreply@anthropic.com>

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

No blockers; this can merge as far as I am concerned.

I reviewed the refreshed github/main...HEAD diff, the image-generation caller and request paths, the filename-key history, PR #1137's merged behavior, and the relevant AGENTS.md, CLAUDE.md, and CONTEXT-MAP.md constraints. I also checked backward compatibility, test strength, and the plugin/runtime boundary. The normalization preserves the picker-saved deck filename while keeping every explicit quality value distinct, and I found no plain error or architecture violation.

Verification: after uv sync --all-packages, uv run pytest tests/test_media_gen_tool.py tests/test_ppt_engine_generate_image_tool.py -q passed with 184 tests. uv run ruff check passed, uv run ruff format --check reported all 4 changed files formatted, and git diff --check github/main...HEAD passed. Before the workspace sync, test collection/execution failed because the fresh default environment lacked raven_ppt and raven_everos; those were environment setup errors, not skipped tests.

@LivXue

LivXue commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility review — PR #1155 @ 5d600eebe4e42807864fbe55997a902cf8278254

Scope: the PR's own diff is a744952c..5d600eeb (4 files, +84/−10): the deck generator's file-name digest now formats the sent quality as sent_quality or "", so the two spellings of "no quality" (None from #1137 and the picker-saved "") name the same file and existing decks keep their names; the schema docstring states the exact resolution; tests cover both an empty settings quality against a custom base and a name comparison against an unset section.

Windows angle: none. The change is digest/string formatting on top of the existing _filename/deck.build_dir path handling — no new path, subprocess, encoding, permission, or filesystem surface, and nothing branches on the platform.

Verification (native Windows 11; detached worktrees D:\tmp\rv-1155 at head and D:\tmp\rv-base-1155 at base a744952c; offline venv from each lock; scratch HOME/USERPROFILE; PYTHONUTF8=1; PYTHONPATH pinned):

  • uv run --no-sync pytest tests/test_media_gen_tool.py tests/test_ppt_engine_generate_image_tool.py -q -n 0 --tb=line
    • head: 184 passed (17.7 s)
    • base: 180 passed (16.7 s)
    • zero failures at both; the four added tests pass, including the empty-settings-quality name comparison.

Coverage gaps: no live deck generation with image references was run (the tests stop at name/request assembly); the full suite was not rerun.

No Windows-specific issue found.

The name test only proved the two no-quality spellings agree, so a digest that normalized to the None spelling still passed while renaming every picker-saved deck. Assert the empty spelling's historical name instead: that is the file a picker-saved section's page already carries.
Only a picker-saved section whose call still sends no quality keeps its file name. An exact gpt-image-2 section now resolves its empty quality to medium, so its name moves once; the comment claimed every such deck keeps its name.

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

No blockers; this can merge as far as I am concerned.

I reviewed the 5d600eebe4e4..ecd42c3c7c2b delta and rechecked it against the previously reviewed caller behavior, backward-compatibility claim, test intent, and repository comment/test rules. The revision only corrects the documented scope of filename stability and pins the canonical empty-spelling digest, preventing the regression test from passing if both calls were normalized to the wrong historical name. The exact gpt-image-2 exception agrees with effective_quality, and the digest input is platform-independent. No tests were weakened and no architecture constraint changed.

Verification: uv run pytest tests/test_media_gen_tool.py tests/test_ppt_engine_generate_image_tool.py -q passed with 184 tests; Ruff check and format check passed; git diff --check github/main...HEAD passed.

@LivXue

LivXue commented Nov 1, 2026

Copy link
Copy Markdown
Member Author

Windows compatibility re-review — PR #1155 @ ecd42c3c7c2b2f13a24ed6b05a9511dd8c469b87

Scope: the delta since the previously reviewed head 5d600eeb is 2 commits / 2 files (+11/−5): the deck generator's comment now names the exact gpt-image-2 exception (its empty quality resolves to medium, so that deck renames once) and a test assertion pins the empty-spelling file name (lantern-b384de827020.png). No behaviour changed.

Windows angle: none. The digest is a SHA-256 over an f-string and Path(...).name reads the basename; the pinned name is platform-independent, and no path, subprocess, encoding, or permission surface is touched.

Verification (native Windows 11; detached worktrees D:\tmp\rv-1155b at head and D:\tmp\rv-base-1155b at base a744952c; offline venv; scratch HOME/USERPROFILE; PYTHONUTF8=1; PYTHONPATH pinned):

  • uv run --no-sync pytest tests/test_media_gen_tool.py tests/test_ppt_engine_generate_image_tool.py -q -n 0 --tb=line
    • head: 184 passed (23.4 s)
    • base: 180 passed (22.6 s)
    • zero failures at both; the name-pinning assertion passes on Windows.

Coverage gaps: no live deck generation with image references; the full suite was not rerun.

No Windows-specific issue found.

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

One-line digest change (sent_quality or '') makes both spellings of no quality name the same deck file, and the tests pin it to the empty spelling's historical name so normalizing the other way would fail. The remaining rename cases (unset or non-gpt-image sections, exact gpt-image-2) are disclosed under Risk. The docstring now matches effective_quality. CI green at ecd42c3.

@LivXue
LivXue merged commit 96a20e7 into main Nov 2, 2026
25 checks passed
@LivXue
LivXue deleted the fix/1137-review-findings branch November 2, 2026 03:04
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.

3 participants