mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 10:23:07 +00:00
Fix concurrency limits and remote branch fetching issues (#788)
* Changes from fix/bug-fixes * feat: Refactor worktree iteration and improve error logging across services * feat: Extract URL/port patterns to module level and fix abort condition * fix: Improve IPv6 loopback handling, select component layout, and terminal UI * feat: Add thinking level defaults and adjust list row padding * Update apps/ui/src/store/app-store.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: Add worktree-aware terminal creation and split options, fix npm security issues from audit * feat: Add tracked remote detection to pull dialog flow * feat: Add merge state tracking to git operations * feat: Improve merge detection and add post-merge action preferences * Update apps/ui/src/components/views/board-view/dialogs/git-pull-dialog.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update apps/ui/src/components/views/board-view/dialogs/git-pull-dialog.tsx Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: Pass merge detection info to stash reapplication and handle merge state consistently * fix: Call onPulled callback in merge handlers and add validation checks --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -334,6 +334,23 @@ export class AutoModeServiceFacade {
|
||||
async (pPath) => featureLoader.getAll(pPath)
|
||||
);
|
||||
|
||||
/**
|
||||
* Iterate all active worktrees for this project, falling back to the
|
||||
* main worktree (null) when none are active.
|
||||
*/
|
||||
const forEachProjectWorktree = (fn: (branchName: string | null) => void): void => {
|
||||
const projectWorktrees = autoLoopCoordinator
|
||||
.getActiveWorktrees()
|
||||
.filter((w) => w.projectPath === projectPath);
|
||||
if (projectWorktrees.length === 0) {
|
||||
fn(null);
|
||||
} else {
|
||||
for (const w of projectWorktrees) {
|
||||
fn(w.branchName);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// ExecutionService - runAgentFn delegates to AgentExecutor via shared helper
|
||||
const executionService = new ExecutionService(
|
||||
eventBus,
|
||||
@@ -357,11 +374,36 @@ export class AutoModeServiceFacade {
|
||||
(pPath, featureId) => getFacade().contextExists(featureId),
|
||||
(pPath, featureId, useWorktrees, _calledInternally) =>
|
||||
getFacade().resumeFeature(featureId, useWorktrees, _calledInternally),
|
||||
(errorInfo) =>
|
||||
autoLoopCoordinator.trackFailureAndCheckPauseForProject(projectPath, null, errorInfo),
|
||||
(errorInfo) => autoLoopCoordinator.signalShouldPauseForProject(projectPath, null, errorInfo),
|
||||
(errorInfo) => {
|
||||
// Track failure against ALL active worktrees for this project.
|
||||
// The ExecutionService callbacks don't receive branchName, so we
|
||||
// iterate all active worktrees. Uses a for-of loop (not .some()) to
|
||||
// ensure every worktree's failure counter is incremented.
|
||||
let shouldPause = false;
|
||||
forEachProjectWorktree((branchName) => {
|
||||
if (
|
||||
autoLoopCoordinator.trackFailureAndCheckPauseForProject(
|
||||
projectPath,
|
||||
branchName,
|
||||
errorInfo
|
||||
)
|
||||
) {
|
||||
shouldPause = true;
|
||||
}
|
||||
});
|
||||
return shouldPause;
|
||||
},
|
||||
(errorInfo) => {
|
||||
forEachProjectWorktree((branchName) =>
|
||||
autoLoopCoordinator.signalShouldPauseForProject(projectPath, branchName, errorInfo)
|
||||
);
|
||||
},
|
||||
() => {
|
||||
/* recordSuccess - no-op */
|
||||
// Record success to clear failure tracking. This prevents failures
|
||||
// from accumulating over time and incorrectly pausing auto mode.
|
||||
forEachProjectWorktree((branchName) =>
|
||||
autoLoopCoordinator.recordSuccessForProject(projectPath, branchName)
|
||||
);
|
||||
},
|
||||
(_pPath) => getFacade().saveExecutionState(),
|
||||
loadContextFiles
|
||||
|
||||
Reference in New Issue
Block a user