fix(code_generator): emit unique, tutorial-specific output instead of identical boilerplate#78
Closed
fix(code_generator): emit unique, tutorial-specific output instead of identical boilerplate#78
Conversation
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Co-authored-by: groupthinking <154503486+groupthinking@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix code_generator.py to produce unique tutorial-specific output
fix(code_generator): emit unique, tutorial-specific output instead of identical boilerplate
Mar 20, 2026
Contributor
There was a problem hiding this comment.
Additional Suggestions:
- Three methods in code_generator.py were partially fixed; two still ignore important parameters for feature-specific code generation
- User-derived content from video analysis (tutorial steps, technology names, features, and project titles) was directly inserted into generated JSX/HTML code without HTML escaping - FIXED
- Title and URL parameters are directly inserted into markdown without escaping, allowing markdown special characters to be interpreted as formatting syntax instead of literal text
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.
Both
code_generator.pyfiles produced the same static boilerplate regardless of which video was processed — extracted tutorial steps, keywords, and features were accepted as parameters but never used in the generated output.src/youtube_extension/backend/code_generator.py_generate_vanilla_main_js— was ignoring bothtutorial_stepsandfeaturesentirely. Now generates a named function per step (executeStep1(), …) wired intorunTutorialSteps(), plus optional helpers keyed to detected features (setupFormHandlers,fetchInitialData,setupDarkModeToggle,initSearch)._generate_fastapi_main— addedextracted_infoparam; now inlines step comments, exposes/api/tutorial/stepslisting the video's extracted steps, and creates one domain route per keyword (e.g. a FastAPI tutorial produces/api/fastapi). Removes the hardcoded generic/api/messagesendpoints._generate_python_api— passesextracted_infothrough to_generate_fastapi_main.Example diff for a "Build a REST API with FastAPI" video vs. "GraphQL with Python":
src/agents/specialized/code_generator.pyexecute— propagates top-levelvideo_title/tutorial_stepsinputs intocontextbefore dispatch._generate_api_endpoint— prepends# Endpoint generated for: <title>+ step comments; tutorial steps are reflected in the processing-logic block._generate_generic_api— now acceptsintentand prepends a video/intent header, making each generated API unique to its source.Original prompt
⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.