fix: resolve user templates in remote PPTX generation - #279
Merged
Conversation
…erate The remote server's template resolution in _prepare_workspace() only searched builtin templates (storage.list_templates()), so a deck referencing an uploaded user template silently fell back to blank-dark.pptx with no warning. - Resolve user templates first via get_user_template_metadata / download_user_template (same order as analyze_template) - Raise ValueError with available template list when an explicitly referenced template cannot be resolved (no more silent fallback) - Drop the templateS3Key fallback (never set by production code) - Keep blank-dark default when no template is specified Fixes #206 SPEC: 20260804-1420_fix-user-template-resolution-generate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #206 — custom templates uploaded via the Web UI were silently ignored during PPTX generation on AWS (Layer 3/4), falling back to
blank-dark.pptxwith no warning.Root cause
Template resolution in
_prepare_workspace()(servers/remote/tools/generate.py) only matched againststorage.list_templates()(builtin templates). User templates were never searched, and the unresolved name silently fell back to the default.Changes
get_user_template_metadata/download_user_template— same resolution order asanalyze_templateValueError(with the available template list, same format asanalyze_template) when an explicitly referenced template cannot be resolved — no more silent wrong-design fallbackdeck.get("templateS3Key")fallback: never set by production code (create_deck), it existed only in the test fixtureblank-dark.pptxdefault when no template is specified (unchanged behavior)_prepare_workspaceis shared bygenerate_pptxand the compose/preview verify pass, so one fix covers both paths.Testing
templateS3Key)make lint/make testpass (758 passed, 5 skipped)Out of scope
servers/local) — separate logic, unaffectedbackgroundoverrides written by composers can still hide a template's background image; that is spec-driven behavior, not a resolution bug (can be tracked separately)