fix: Custom Component Generator Template contains broken URLs returning 404 errors#11866
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. ❌ Your project status has failed because the head coverage (41.47%) is below the target coverage (60.00%). You can increase the head coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #11866 +/- ##
==========================================
- Coverage 35.42% 35.42% -0.01%
==========================================
Files 1541 1541
Lines 75247 75247
Branches 11388 11388
==========================================
- Hits 26660 26658 -2
- Misses 47087 47088 +1
- Partials 1500 1501 +1
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughSeven component URL entries were updated to point from backend Langflow locations to new lfx (Langflow X) source locations across two Custom Component Generator JSON files. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning, 1 inconclusive)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (1)
1196-1197:⚠️ Potential issue | 🔴 CriticalURL-G5J7i (
CUSTOM_COMPONENT_CODE, line 1910) is broken and returns 404.The PR fixes
URL-h1gAB, butURL-G5J7iat line 1910 also needs to be updated. The target path (src/backend/base/langflow/components/custom_component/custom_component.py) no longer exists in the repository after the folder restructure. Find the correct location of the custom component implementation and update the URL accordingly.URL-gEE5N at line 1196 remains functional but now points to a backward compatibility shim that re-exports from
lfx; verify this is the intended source forBASE_COMPONENT_CODE.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component Generator.json around lines 1196 - 1197, The URL referenced by symbol URL-G5J7i used in CUSTOM_COMPONENT_CODE is 404 because the custom component implementation moved; update that URL to point to the new raw file location where the custom component is now implemented (replace the broken raw.githubusercontent URL with the one for src/backend/base/langflow/custom/custom_component/component.py) so CUSTOM_COMPONENT_CODE fetches the correct implementation; also leave URL-gEE5N (used by BASE_COMPONENT_CODE) as-is only after verifying it intentionally points to the backward-compatibility shim that re-exports from lfx.src/lfx/tests/data/starter_projects_1_6_0/Custom Component Generator.json (1)
1847-1848:⚠️ Potential issue | 🔴 CriticalUpdate the
URL-E6QCv(CUSTOM_COMPONENT_CODE) URL to reflect the correct file path.The URL at line 1848 references
src/backend/base/langflow/components/custom_component/custom_component.py, but the actual file is located atsrc/backend/base/langflow/custom/custom_component/custom_component.py. Update the URL to:https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/backend/base/langflow/custom/custom_component/custom_component.pyThis path should be fixed alongside the other URLs updated in this PR for consistency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json around lines 1847 - 1848, Update the URL value for URL-E6QCv (CUSTOM_COMPONENT_CODE) to point to the correct file path: replace "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/backend/base/langflow/components/custom_component/custom_component.py" with "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/backend/base/langflow/custom/custom_component/custom_component.py" so the JSON entry for CUSTOM_COMPONENT_CODE references the actual file location consistent with the other updated URLs.
🧹 Nitpick comments (1)
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (1)
1550-1556: Consider pinning URLs to a commit SHA or release tag to prevent future 404 recurrences.All seven URLs use
refs/heads/main, which is a moving target. This PR was needed precisely because a folder restructure onmainbroke these URLs. Pinning to a stable ref (e.g., a release tag or a fixed commit SHA) would make the template resilient to future refactors without requiring another fix PR.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component Generator.json around lines 1550 - 1556, Those seven resource URLs referencing refs/heads/main (agent.py, structured_output.py, calculator.py, tavily_search.py, ollama.py, conditional_router.py, file.py) should be pinned to an immutable ref; replace each occurrence of refs/heads/main (or the moving "main" branch) with a specific release tag or commit SHA for the corresponding repository/file so the template won't 404 after upstream refactors—update the JSON entries that currently point to those filenames/URLs to use the chosen tag or SHA and verify the raw/blob form still serves the file.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component
Generator.json:
- Around line 1550-1551: Two GitHub blob URLs in the starter project JSON
("https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py"
and
"https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py")
return HTML pages instead of raw source; update those two entries to use
raw.githubusercontent.com equivalents (match the pattern used by the other five
working URLs) so RecursiveUrlLoader fetches plain source rather than GitHub UI
HTML.
In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json:
- Around line 1485-1486: The EXAMPLE_COMPONENTS prompt is receiving rendered
GitHub HTML because the two entries referencing agent.py and
structured_output.py use browser-view "github.com/.../blob/..." URLs; update
those two URLs to their corresponding raw.githubusercontent.com paths (matching
the pattern used for lines 1487–1491) so the URL-LiTXv node returns raw Python
source for agent.py and structured_output.py and not HTML, ensuring
EXAMPLE_COMPONENTS receives clean source code.
---
Outside diff comments:
In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component
Generator.json:
- Around line 1196-1197: The URL referenced by symbol URL-G5J7i used in
CUSTOM_COMPONENT_CODE is 404 because the custom component implementation moved;
update that URL to point to the new raw file location where the custom component
is now implemented (replace the broken raw.githubusercontent URL with the one
for src/backend/base/langflow/custom/custom_component/component.py) so
CUSTOM_COMPONENT_CODE fetches the correct implementation; also leave URL-gEE5N
(used by BASE_COMPONENT_CODE) as-is only after verifying it intentionally points
to the backward-compatibility shim that re-exports from lfx.
In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json:
- Around line 1847-1848: Update the URL value for URL-E6QCv
(CUSTOM_COMPONENT_CODE) to point to the correct file path: replace
"https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/backend/base/langflow/components/custom_component/custom_component.py"
with
"https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/backend/base/langflow/custom/custom_component/custom_component.py"
so the JSON entry for CUSTOM_COMPONENT_CODE references the actual file location
consistent with the other updated URLs.
---
Nitpick comments:
In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component
Generator.json:
- Around line 1550-1556: Those seven resource URLs referencing refs/heads/main
(agent.py, structured_output.py, calculator.py, tavily_search.py, ollama.py,
conditional_router.py, file.py) should be pinned to an immutable ref; replace
each occurrence of refs/heads/main (or the moving "main" branch) with a specific
release tag or commit SHA for the corresponding repository/file so the template
won't 404 after upstream refactors—update the JSON entries that currently point
to those filenames/URLs to use the chosen tag or SHA and verify the raw/blob
form still serves the file.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.jsonsrc/lfx/tests/data/starter_projects_1_6_0/Custom Component Generator.json
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py", | ||
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", |
There was a problem hiding this comment.
blob URLs return GitHub HTML, not raw source — convert them to raw.githubusercontent.com.
Lines 1550–1551 point to github.com/…/blob/main/… URLs. RecursiveUrlLoader will fetch the rendered GitHub HTML page for these, so even after BeautifulSoup text extraction the LLM receives noisy GitHub UI chrome alongside the code — defeating the purpose of using raw source as context. The other five URLs on lines 1552–1556 correctly use raw.githubusercontent.com.
🐛 Proposed fix
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py",
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",
+ "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/base/agents/agent.py",
+ "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py", | |
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", | |
| "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/base/agents/agent.py", | |
| "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component
Generator.json around lines 1550 - 1551, Two GitHub blob URLs in the starter
project JSON
("https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py"
and
"https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py")
return HTML pages instead of raw source; update those two entries to use
raw.githubusercontent.com equivalents (match the pattern used by the other five
working URLs) so RecursiveUrlLoader fetches plain source rather than GitHub UI
HTML.
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py", | ||
| "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", |
There was a problem hiding this comment.
github.com/blob/ URLs return rendered HTML, not raw source — will corrupt the EXAMPLE_COMPONENTS prompt.
Lines 1485–1486 use the GitHub browser-view URL scheme (github.com/.../blob/main/...), while lines 1487–1491 correctly use raw.githubusercontent.com. The URL-LiTXv node feeds its raw_results into the EXAMPLE_COMPONENTS prompt variable, so the LLM will receive full GitHub HTML (navigation, scripts, markup) instead of the Python source for agent.py and structured_output.py.
🐛 Proposed fix — use raw URLs consistently
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py",
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",
+ "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/base/agents/agent.py",
+ "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json
around lines 1485 - 1486, The EXAMPLE_COMPONENTS prompt is receiving rendered
GitHub HTML because the two entries referencing agent.py and
structured_output.py use browser-view "github.com/.../blob/..." URLs; update
those two URLs to their corresponding raw.githubusercontent.com paths (matching
the pattern used for lines 1487–1491) so the URL-LiTXv node returns raw Python
source for agent.py and structured_output.py and not HTML, ensuring
EXAMPLE_COMPONENTS receives clean source code.
|
@coderabbitai full review |
✅ Actions performedFull review triggered. |
There was a problem hiding this comment.
♻️ Duplicate comments (2)
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.json (1)
1550-1551:⚠️ Potential issue | 🟠 MajorReplace
blobURLs withraw.githubusercontent.comURLs.Line 1550 and Line 1551 still point to GitHub
blobpages, so the loader receives rendered HTML instead of raw Python source.🐛 Proposed fix
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py", - "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", + "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/base/agents/agent.py", + "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component Generator.json around lines 1550 - 1551, Replace the GitHub "blob" URLs so the loader receives raw Python source: update the two string entries that currently read "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py" and "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py" to use the raw GitHub content format "https://raw.githubusercontent.com/langflow-ai/langflow/main/src/lfx/src/lfx/base/agents/agent.py" and "https://raw.githubusercontent.com/langflow-ai/langflow/main/src/lfx/src/lfx/components/llm_operations/structured_output.py" respectively so the loader fetches plain Python source instead of HTML.src/lfx/tests/data/starter_projects_1_6_0/Custom Component Generator.json (1)
1485-1486:⚠️ Potential issue | 🔴 CriticalCritical: Blob URLs return HTML, not raw source code.
Lines 1485-1486 use
github.com/.../blob/main/...URLs, which return rendered HTML pages from the GitHub web interface. The URL-LiTXv component feeds this content into theEXAMPLE_COMPONENTSprompt variable, so the LLM will receive full GitHub HTML (navigation bars, scripts, CSS, and markup) instead of the actual Python source code foragent.pyandstructured_output.py.🐛 Proposed fix — use raw.githubusercontent.com URLs
- "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py", - "https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py", + "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/base/agents/agent.py", + "https://raw.githubusercontent.com/langflow-ai/langflow/refs/heads/main/src/lfx/src/lfx/components/llm_operations/structured_output.py",🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json around lines 1485 - 1486, The listed GitHub blob URLs for agent.py and structured_output.py are returning HTML pages; update the values fed into EXAMPLE_COMPONENTS to point to raw file content by replacing the "github.com/.../blob/main/..." URLs with the equivalent "raw.githubusercontent.com/<owner>/<repo>/main/<path/to/file>" raw URLs (ensure the repo/branch/path are correct for agent.py and structured_output.py), so the prompt receives plain Python source instead of rendered HTML.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Duplicate comments:
In `@src/backend/base/langflow/initial_setup/starter_projects/Custom` Component
Generator.json:
- Around line 1550-1551: Replace the GitHub "blob" URLs so the loader receives
raw Python source: update the two string entries that currently read
"https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/base/agents/agent.py"
and
"https://github.com/langflow-ai/langflow/blob/main/src/lfx/src/lfx/components/llm_operations/structured_output.py"
to use the raw GitHub content format
"https://raw.githubusercontent.com/langflow-ai/langflow/main/src/lfx/src/lfx/base/agents/agent.py"
and
"https://raw.githubusercontent.com/langflow-ai/langflow/main/src/lfx/src/lfx/components/llm_operations/structured_output.py"
respectively so the loader fetches plain Python source instead of HTML.
In `@src/lfx/tests/data/starter_projects_1_6_0/Custom` Component Generator.json:
- Around line 1485-1486: The listed GitHub blob URLs for agent.py and
structured_output.py are returning HTML pages; update the values fed into
EXAMPLE_COMPONENTS to point to raw file content by replacing the
"github.com/.../blob/main/..." URLs with the equivalent
"raw.githubusercontent.com/<owner>/<repo>/main/<path/to/file>" raw URLs (ensure
the repo/branch/path are correct for agent.py and structured_output.py), so the
prompt receives plain Python source instead of rendered HTML.
ℹ️ Review info
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
src/backend/base/langflow/initial_setup/starter_projects/Custom Component Generator.jsonsrc/lfx/tests/data/starter_projects_1_6_0/Custom Component Generator.json
…ng 404 errors (#11866) replace with value urls as folder structure seems to have changed Co-authored-by: Olayinka Adelakun <olayinkaadelakun@Olayinkas-MacBook-Pro.local> Co-authored-by: Viktor Avelino <64113566+viktoravelino@users.noreply.github.com>
Description
It seems a folder restructured cause the URL in the template URL component to be invalid. I just changed the path, and they seem to be valid
Testcase
Summary by CodeRabbit