fix: repo creation race condition + AI review timeouts#20
Merged
Conversation
Repository creation: - Poll for default branch existence (up to 5 retries, 2s apart) before applying branch protection — new repos don't have a branch until the first commit lands - Wrap issue creation in try/catch to prevent crash if issues API isn't ready yet AI reviews: - Add stream: false to ollama request — without it, ollama streams SSE chunks and response.json() hangs until the AbortController fires - Increase default timeout from 120s to 300s for the 3B model - Enable ai_review in config (was disabled) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
repository.createdwebhook fires before the default branch exists. Branch protection API returns 404, then issue creation crashes. Now polls up to 5 times (2s intervals) for the branch to appear, and wraps issue creation in try/catch.stream: false,response.json()hangs reading SSE chunks until the AbortController fires after 120s. Addedstream: falseand bumped default timeout to 300s.ai_review.enabledtotruein config + updated server config.Root causes
repository.createdbefore the repo has any commits/branches — the branch protection PUT returns 404/v1/chat/completionsdefaults to streaming SSE. The code calledresponse.json()expecting a single JSON blob, but got chunked SSE data that never terminates cleanlyTest plan
🤖 Generated with Claude Code