Skip to content

Commit 48265bf

Browse files
committed
fix: restore backend controlMap on app restart
1 parent 90a5194 commit 48265bf

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

electron/ipc/register.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1231,6 +1231,7 @@ export function registerAllHandlers(win: BrowserWindow): void {
12311231
baseBranch?: string;
12321232
worktreePath: string;
12331233
coordinatorTaskId: string;
1234+
controlledBy?: 'coordinator' | 'human';
12341235
},
12351236
) => {
12361237
assertString(args.id, 'id');
@@ -1250,6 +1251,7 @@ export function registerAllHandlers(win: BrowserWindow): void {
12501251
worktreePath: args.worktreePath,
12511252
agentId: crypto.randomUUID(),
12521253
coordinatorTaskId: args.coordinatorTaskId,
1254+
controlledBy: args.controlledBy,
12531255
});
12541256
},
12551257
);

electron/mcp/coordinator.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,6 +876,7 @@ export class Coordinator {
876876
worktreePath: string;
877877
agentId: string;
878878
coordinatorTaskId: string;
879+
controlledBy?: 'coordinator' | 'human';
879880
}): void {
880881
if (this.tasks.has(opts.id)) return;
881882
const task: CoordinatedTask = {
@@ -892,6 +893,9 @@ export class Coordinator {
892893
exitCode: null,
893894
};
894895
this.tasks.set(task.id, task);
896+
if (opts.controlledBy === 'human') {
897+
this.controlMap.set(task.id, 'human');
898+
}
895899
}
896900

897901
registerCoordinator(coordinatorTaskId: string, projectId: string, worktreePath?: string): void {

src/App.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ function App() {
363363
baseBranch: task.baseBranch,
364364
worktreePath: task.worktreePath,
365365
coordinatorTaskId: task.coordinatedBy,
366+
controlledBy: task.controlledBy,
366367
}).catch((err) => {
367368
console.warn(`[MCP] Failed to hydrate coordinated task ${taskId}:`, err);
368369
});

0 commit comments

Comments
 (0)