-
Notifications
You must be signed in to change notification settings - Fork 575
Fix concurrency limits and remote branch fetching issues #788
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7072ec3
8eb61d2
074eb13
50899b1
e678848
8fcc865
29bc5d7
23c001e
08c8595
5f2e045
260b482
53a10ef
a78cead
b3f7b34
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -163,6 +163,10 @@ export class AutoLoopCoordinator { | |||||||||||||||||||||||||||||||||
| const { projectPath, branchName } = projectState.config; | ||||||||||||||||||||||||||||||||||
| while (projectState.isRunning && !projectState.abortController.signal.aborted) { | ||||||||||||||||||||||||||||||||||
| try { | ||||||||||||||||||||||||||||||||||
| // Count ALL running features (both auto and manual) against the concurrency limit. | ||||||||||||||||||||||||||||||||||
| // This ensures auto mode is aware of the total system load and does not over-subscribe | ||||||||||||||||||||||||||||||||||
| // resources. Manual tasks always bypass the limit and run immediately, but their | ||||||||||||||||||||||||||||||||||
| // presence is accounted for when deciding whether to dispatch new auto-mode tasks. | ||||||||||||||||||||||||||||||||||
| const runningCount = await this.getRunningCountForWorktree(projectPath, branchName); | ||||||||||||||||||||||||||||||||||
| if (runningCount >= projectState.config.maxConcurrency) { | ||||||||||||||||||||||||||||||||||
| await this.sleep(5000, projectState.abortController.signal); | ||||||||||||||||||||||||||||||||||
|
|
@@ -298,11 +302,17 @@ export class AutoLoopCoordinator { | |||||||||||||||||||||||||||||||||
| return Array.from(activeProjects); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * Get the number of running features for a worktree. | ||||||||||||||||||||||||||||||||||
| * By default counts ALL running features (both auto-mode and manual). | ||||||||||||||||||||||||||||||||||
| * Pass `autoModeOnly: true` to count only auto-mode features. | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| async getRunningCountForWorktree( | ||||||||||||||||||||||||||||||||||
| projectPath: string, | ||||||||||||||||||||||||||||||||||
| branchName: string | null | ||||||||||||||||||||||||||||||||||
| branchName: string | null, | ||||||||||||||||||||||||||||||||||
| options?: { autoModeOnly?: boolean } | ||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The return this.concurrencyManager.getRunningCountForWorktree(projectPath, branchName); |
||||||||||||||||||||||||||||||||||
| ): Promise<number> { | ||||||||||||||||||||||||||||||||||
| return this.concurrencyManager.getRunningCountForWorktree(projectPath, branchName); | ||||||||||||||||||||||||||||||||||
| return this.concurrencyManager.getRunningCountForWorktree(projectPath, branchName, options); | ||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||
|
Comment on lines
310
to
316
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: # First, examine the file and the specific lines mentioned
wc -l apps/server/src/services/auto-loop-coordinator.tsRepository: AutoMaker-Org/automaker Length of output: 120 🏁 Script executed: # Read the file to check the method signatures at the referenced lines
cat -n apps/server/src/services/auto-loop-coordinator.ts | sed -n '90,100p;240,280p;310,320p'Repository: AutoMaker-Org/automaker Length of output: 2892 🏁 Script executed: # Search for all invocations of getRunningCountForWorktree
rg -n --type=ts 'getRunningCountForWorktree' -B 1 -A 2Repository: AutoMaker-Org/automaker Length of output: 19906 🏁 Script executed: # Check if there are any calls to getRunningCountForWorktree that might omit the branchName parameter
rg -n --type=ts 'getRunningCountForWorktree\s*\(\s*[^,)]+\s*\)' -v 'branchName'Repository: AutoMaker-Org/automaker Length of output: 117 🏁 Script executed: # Also search the entire codebase (including route handlers and other sources) that might call this method
rg -n 'getRunningCountForWorktree\(' | head -50Repository: AutoMaker-Org/automaker Length of output: 3523 🏁 Script executed: # Check the auto-mode/facade.ts call context
cat -n apps/server/src/services/auto-mode/facade.ts | sed -n '888,896p'Repository: AutoMaker-Org/automaker Length of output: 323 🏁 Script executed: # Search for any route handlers that might call getRunningCountForWorktree
rg -n 'getRunningCountForWorktree' apps/server/src/routes/ 2>/dev/null || echo "No matches in routes/"Repository: AutoMaker-Org/automaker Length of output: 88 🏁 Script executed: # Verify the method signature in ConcurrencyManager for comparison
cat -n apps/server/src/services/concurrency-manager.ts | sed -n '179,185p'Repository: AutoMaker-Org/automaker Length of output: 335 Add The 🔧 Proposed fix async getRunningCountForWorktree(
projectPath: string,
- branchName: string | null,
+ branchName: string | null = null,
options?: { autoModeOnly?: boolean }
): Promise<number> {📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| trackFailureAndCheckPauseForProject( | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The error message for a timed-out fetch operation is quite verbose. It could be shortened to improve readability in logs while still conveying the essential information.