Skip to content

Commit 4d3d594

Browse files
committed
fix(mcp): preserve Kimi launch args on hydration
1 parent 69a9fad commit 4d3d594

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

electron/mcp/coordinator.test.ts

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3551,6 +3551,36 @@ describe('Coordinator hydrateTask — restart hydration', () => {
35513551
expect(task?.status).toBe('exited');
35523552
});
35533553

3554+
it('hydrateTask keeps Kimi launch args empty when the existing task command is reused', async () => {
3555+
coordinator.setCoordinatorSpawnDefaults('coord-1', 'kimi', []);
3556+
coordinator.setMCPServerInfo(
3557+
'coord-1',
3558+
'http://localhost:3001',
3559+
'coordinator-token',
3560+
'subtask-token',
3561+
'/path/server.js',
3562+
);
3563+
const task = await coordinator.createTask({
3564+
name: 'kimi-task',
3565+
prompt: 'do',
3566+
coordinatorTaskId: 'coord-1',
3567+
});
3568+
3569+
const result = coordinator.hydrateTask({
3570+
id: task.id,
3571+
name: task.name,
3572+
projectId: task.projectId,
3573+
projectRoot: task.projectRoot,
3574+
branchName: task.branchName,
3575+
worktreePath: task.worktreePath,
3576+
agentId: task.agentId,
3577+
coordinatorTaskId: task.coordinatorTaskId,
3578+
mcpConfigPath: task.mcpConfigPath,
3579+
});
3580+
3581+
expect(result.mcpLaunchArgs).toEqual([]);
3582+
});
3583+
35543584
it('hydrateTask restores an undelivered initial prompt for backend delivery', () => {
35553585
coordinator.hydrateTask({
35563586
id: 'hydrated-1',

electron/mcp/coordinator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2126,7 +2126,7 @@ export class Coordinator {
21262126
}
21272127
task.agentCommand = agentCommand ?? task.agentCommand ?? 'claude';
21282128
this.writeKimiAutoDiscoveredMcpConfig(task, mcpConfig);
2129-
return buildMcpLaunchArgs(agentCommand ?? 'claude', mcpConfigPath, mcpConfig);
2129+
return buildMcpLaunchArgs(task.agentCommand, mcpConfigPath, mcpConfig);
21302130
}
21312131

21322132
isRegisteredCoordinator(coordinatorTaskId: string): boolean {

0 commit comments

Comments
 (0)