Fix clone_repo TypeError and uvicorn reload loop triggered by data/repos writes - #5
Draft
H0NEYP0T-466 with Copilot wants to merge 2 commits into
Draft
Fix clone_repo TypeError and uvicorn reload loop triggered by data/repos writes#5H0NEYP0T-466 with Copilot wants to merge 2 commits into
H0NEYP0T-466 with Copilot wants to merge 2 commits into
Conversation
Co-authored-by: H0NEYP0T-466 <[email protected]>
Copilot
AI
changed the title
[WIP] Start LinkedIn agent initialization and bot setup
Fix clone_repo TypeError and uvicorn reload loop triggered by data/repos writes
Mar 16, 2026
H0NEYP0T-466
marked this pull request as ready for review
March 16, 2026 08:33
H0NEYP0T-466
marked this pull request as draft
March 16, 2026 08:33
There was a problem hiding this comment.
Pull request overview
Fixes two startup-breaking issues in the backend: a TypeError in repo cloning due to an invalid iterable, and a uvicorn reload loop caused by insufficient reload-exclude coverage for nested data/ paths.
Changes:
- Fix
clone_repo()retry loop to iterate over intended depths (100then1) instead of crashing onenumerate((1)). - Update dev run command to exclude all nested
data/paths from uvicorn reload triggers (data/**).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| backend/github_service.py | Fixes clone retry depth iteration to prevent TypeError and allow fallback behavior. |
| backend/run_commands.txt | Adjusts uvicorn reload-exclude pattern to cover nested files under data/. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| log_callback(f"[github] Cloning {repo_name}...") | ||
| # Attempt clone, falling back to --depth=1 on network/index-pack errors | ||
| for attempt, depth in enumerate((1)): | ||
| for attempt, depth in enumerate([100, 1]): |
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.
Two bugs combined to crash the server during initialization:
clone_repo()always raisedTypeErrordue to a malformed tuple literal, and uvicorn's--reload-excludepattern was too shallow to suppress WatchFiles events from deeply nested cloned repo files.github_service.py—enumerate((1))→enumerate([100, 1])(1)is just the integer1in Python — no tuple is created without a trailing comma. This causedTypeError: 'int' object is not iterableon every new clone attempt, making it impossible to clone any repo.The fix restores the intended fallback strategy:
run_commands.txt—data/*→data/**data/*only excludes one level of depth. Files likedata/repos/some-repo/backend/main.pywere not matched, so everygit cloneintodata/repos/triggered a WatchFiles reload, interrupting initialization mid-run.📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.