@@ -177,6 +177,9 @@ export function validateStartMCPServerArgs(args: Record<string, unknown>): void
177177 assertString ( args . projectId , 'projectId' ) ;
178178 validatePath ( args . projectRoot , 'projectRoot' ) ;
179179 if ( args . worktreePath !== undefined ) validatePath ( args . worktreePath , 'worktreePath' ) ;
180+ if ( args . coordinatorBranch !== undefined ) {
181+ validateBranchName ( args . coordinatorBranch , 'coordinatorBranch' ) ;
182+ }
180183 if ( args . agentCommand !== undefined ) assertString ( args . agentCommand , 'agentCommand' ) ;
181184 if ( args . agentArgs !== undefined ) assertStringArray ( args . agentArgs , 'agentArgs' ) ;
182185 assertOptionalBoolean ( args . skipPermissions , 'skipPermissions' ) ;
@@ -1181,10 +1184,22 @@ export function registerAllHandlers(win: BrowserWindow): void {
11811184
11821185 ipcMain . handle (
11831186 IPC . MCP_CoordinatorRegistered ,
1184- ( _e , args : { coordinatorTaskId : string ; projectId : string ; worktreePath ?: string } ) => {
1187+ (
1188+ _e ,
1189+ args : {
1190+ coordinatorTaskId : string ;
1191+ projectId : string ;
1192+ coordinatorBranch ?: string ;
1193+ worktreePath ?: string ;
1194+ } ,
1195+ ) => {
11851196 assertString ( args . coordinatorTaskId , 'coordinatorTaskId' ) ;
11861197 assertString ( args . projectId , 'projectId' ) ;
1198+ if ( args . coordinatorBranch !== undefined ) {
1199+ validateBranchName ( args . coordinatorBranch , 'coordinatorBranch' ) ;
1200+ }
11871201 coordinator ?. registerCoordinator ( args . coordinatorTaskId , args . projectId , {
1202+ branchName : args . coordinatorBranch ,
11881203 worktreePath : args . worktreePath ,
11891204 } ) ;
11901205 } ,
@@ -1255,6 +1270,11 @@ export function registerAllHandlers(win: BrowserWindow): void {
12551270 } ,
12561271 ) ;
12571272
1273+ ipcMain . handle ( IPC . MCP_TaskLandingReviewCleared , ( _e , args : { taskId : string } ) => {
1274+ assertString ( args . taskId , 'taskId' ) ;
1275+ coordinator ?. markTaskReviewed ( args . taskId ) ;
1276+ } ) ;
1277+
12581278 ipcMain . handle (
12591279 IPC . MCP_CoordinatedTaskClosed ,
12601280 ( _e , args : { taskId : string ; coordinatorTaskId : string } ) => {
@@ -1281,7 +1301,13 @@ export function registerAllHandlers(win: BrowserWindow): void {
12811301 agentId ?: string ;
12821302 signalDoneAt ?: string ;
12831303 signalDoneConsumed ?: boolean ;
1304+ verification ?: import ( '../mcp/types.js' ) . SubtaskVerification ;
1305+ landingState ?: import ( '../mcp/types.js' ) . LandingState ;
1306+ landingReason ?: string ;
1307+ landingSummary ?: string ;
1308+ landedMetadata ?: import ( '../mcp/types.js' ) . LandedMetadata ;
12841309 mcpConfigPath ?: string ;
1310+ agentCommand ?: string ;
12851311 preambleFileExistedBefore ?: boolean ;
12861312 } ,
12871313 ) => {
@@ -1297,7 +1323,8 @@ export function registerAllHandlers(win: BrowserWindow): void {
12971323 assertString ( args . coordinatorTaskId , 'coordinatorTaskId' ) ;
12981324 validateUUID ( args . coordinatorTaskId , 'coordinatorTaskId' ) ;
12991325 if ( ! coordinator ) throw new Error ( 'coordinator mode not initialized' ) ;
1300- coordinator . hydrateTask ( {
1326+ if ( args . agentCommand !== undefined ) assertString ( args . agentCommand , 'agentCommand' ) ;
1327+ const result = coordinator . hydrateTask ( {
13011328 id : args . id ,
13021329 name : args . name ,
13031330 projectId : args . projectId ,
@@ -1310,13 +1337,20 @@ export function registerAllHandlers(win: BrowserWindow): void {
13101337 controlledBy : args . controlledBy ,
13111338 signalDoneAt : args . signalDoneAt ,
13121339 signalDoneConsumed : args . signalDoneConsumed ,
1340+ verification : args . verification ,
1341+ landingState : args . landingState ,
1342+ landingReason : args . landingReason ,
1343+ landingSummary : args . landingSummary ,
1344+ landedMetadata : args . landedMetadata ,
13131345 mcpConfigPath : args . mcpConfigPath ,
1346+ agentCommand : args . agentCommand ,
13141347 preambleFileExistedBefore : args . preambleFileExistedBefore ,
13151348 } ) ;
13161349 // Signal to renderer that MCP hydration is complete — gates TerminalView auto-spawn.
13171350 if ( ! win . isDestroyed ( ) ) {
13181351 win . webContents . send ( IPC . MCP_TaskHydrated , { taskId : args . id } ) ;
13191352 }
1353+ return result ;
13201354 } ,
13211355 ) ;
13221356 }
@@ -1362,6 +1396,7 @@ export function registerAllHandlers(win: BrowserWindow): void {
13621396 coordinatorTaskId : string ;
13631397 projectId : string ;
13641398 projectRoot : string ;
1399+ coordinatorBranch ?: string ;
13651400 worktreePath ?: string ;
13661401 skipPermissions ?: boolean ;
13671402 propagateSkipPermissions ?: boolean ;
@@ -1406,6 +1441,7 @@ export function registerAllHandlers(win: BrowserWindow): void {
14061441 // so create_task / list_tasks know about it. Idempotent — safe to call on restore.
14071442 coordinator . setDefaultProject ( args . projectId , args . projectRoot , args . coordinatorTaskId ) ;
14081443 coordinator . registerCoordinator ( args . coordinatorTaskId , args . projectId , {
1444+ branchName : args . coordinatorBranch ,
14091445 worktreePath : args . worktreePath ,
14101446 skipPermissions : Boolean ( args . skipPermissions && args . propagateSkipPermissions ) ,
14111447 } ) ;
0 commit comments