fix: make code generator produce video-specific output instead of identical boilerplate#88
Closed
fix: make code generator produce video-specific output instead of identical boilerplate#88
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- Wire AICodeGenerator into generate_project(): delegates to Gemini when GEMINI_API_KEY is set, falls back to templates otherwise - Fix _generate_vanilla_main_js() to embed actual tutorial_steps as a JS array and generate per-feature initialisation stubs instead of returning a hardcoded boilerplate string - Fix discarded title assignments in _generate_web_project() and _generate_api_project() (results were thrown away, now assigned) - Fix _generate_repo_name() in deployment_manager.py to prefer project_config['title'] / 'video_title' over the 'uvai-project' fallback, so repos get meaningful names derived from the video - Add three new tests: vanilla JS uniqueness, two-video diff, and repo-name derivation Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix identical output in code_generator.py for video projects
fix: make code generator produce video-specific output instead of identical boilerplate
Mar 20, 2026
Owner
|
Closing: superseded by PR #113 which ported the UUID suffix fix + _build_title helper from YOUTUBE-EXTENSION PR #706. The root cause (timestamp % 10000 collision + generic fallback title) is fixed. |
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.
All generated projects were byte-for-byte identical because
_generate_vanilla_main_js()silently discarded itstutorial_stepsandfeaturesparameters, returning the same hardcoded string every time. Two additional title extractions were also discarded (result not assigned), and_generate_repo_name()always fell through to"uvai-project".Changes
code_generator.py_generate_vanilla_main_js(): now embeds extractedtutorial_stepsas a real JS array and generates namedinitXxx()stubs for each feature infeaturesgenerate_project()delegates toAICodeGenerator.generate_fullstack_project()whenGEMINI_API_KEYis present and the SDK is importable; falls back to templates on any failure_generate_web_project()and_generate_api_project()both called.get("title", ...)but threw the result away — now assigneddeployment_manager.py_generate_repo_name(): checksproject_config["title"]andproject_config["video_title"]before falling back to"uvai-project", so repos get names derived from the videotests/test_code_generator.pytest_vanilla_main_js_includes_tutorial_steps_and_featurestest_two_different_videos_produce_different_codetest_generate_repo_name_uses_video_titleOriginal prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.