refactor(auto-mode): convert getStatusForProject to async and enhance feature retrieval

- Updated getStatusForProject method in AutoModeServiceCompat and its facade to be asynchronous, allowing for better handling of feature status retrieval.
- Modified related status handlers in the server routes to await the updated method.
- Introduced a new method, getRunningFeaturesForWorktree, in ConcurrencyManager to improve feature ID retrieval based on branch normalization.
- Adjusted BoardView component to ensure consistent handling of running auto tasks across worktrees.

These changes improve the responsiveness and accuracy of the auto mode feature in the application.
This commit is contained in:
gsxdsm
2026-02-14 21:07:24 -08:00
parent 0f0f5159d2
commit 0745832d1e
8 changed files with 92 additions and 36 deletions

View File

@@ -757,7 +757,7 @@ Address the follow-up instructions above. Review the previous work and make the
* Get status for this project/worktree
* @param branchName - The branch name, or null for main worktree
*/
getStatusForProject(branchName: string | null = null): ProjectAutoModeStatus {
async getStatusForProject(branchName: string | null = null): Promise<ProjectAutoModeStatus> {
const isAutoLoopRunning = this.autoLoopCoordinator.isAutoLoopRunningForProject(
this.projectPath,
branchName
@@ -766,10 +766,12 @@ Address the follow-up instructions above. Review the previous work and make the
this.projectPath,
branchName
);
const runningFeatures = this.concurrencyManager
.getAllRunning()
.filter((f) => f.projectPath === this.projectPath && f.branchName === branchName)
.map((f) => f.featureId);
// Use branchName-normalized filter so features with branchName "main"
// are correctly matched when querying for the main worktree (null)
const runningFeatures = await this.concurrencyManager.getRunningFeaturesForWorktree(
this.projectPath,
branchName
);
return {
isAutoLoopRunning,