Skip to content

Commit 1cbbd4b

Browse files
committed
Remove rename blocking during streaming
With stable IDs, workspace rename no longer requires moving files or changing workspace ID. Rename only updates: - metadata.name (display name) - Symlink (~/.cmux/src/project/name → workspaceId) Session directory (~/.cmux/sessions/workspaceId) remains unchanged, so active streams can continue writing safely. Changes: - Remove isStreaming check from WORKSPACE_RENAME handler - Remove "should block rename during active stream" test - Simplifies UX: no more "Press Esc first" error Benefits: - Users can organize workspaces without interrupting work - One less artificial limitation - Cleaner, simpler code (-38 lines)
1 parent 566803a commit 1cbbd4b

File tree

2 files changed

+0
-44
lines changed

2 files changed

+0
-44
lines changed

src/services/ipcMain.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -277,13 +277,6 @@ export class IpcMain {
277277
return Err(validation.error ?? "Invalid workspace name");
278278
}
279279

280-
// Block rename if there's an active stream
281-
if (this.aiService.isStreaming(workspaceId)) {
282-
return Err(
283-
"Cannot rename workspace while stream is active. Press Esc to stop the stream first."
284-
);
285-
}
286-
287280
// Get current metadata
288281
const metadataResult = await this.aiService.getWorkspaceMetadata(workspaceId);
289282
if (!metadataResult.success) {

tests/ipcMain/renameWorkspace.test.ts

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -209,43 +209,6 @@ describeIntegration("IpcMain rename workspace integration tests", () => {
209209
15000
210210
);
211211

212-
test.concurrent(
213-
"should block rename during active stream and require Esc first",
214-
async () => {
215-
const { env, workspaceId, cleanup } = await setupWorkspace("anthropic");
216-
try {
217-
// Clear events before starting stream
218-
env.sentEvents.length = 0;
219-
220-
// Start a long-running stream
221-
void sendMessageWithModel(
222-
env.mockIpcRenderer,
223-
workspaceId,
224-
"Run this bash command: for i in {1..60}; do sleep 0.5; done && echo done"
225-
);
226-
227-
// Wait for stream to start
228-
const startCollector = createEventCollector(env.sentEvents, workspaceId);
229-
await startCollector.waitForEvent("stream-start", 10000);
230-
231-
// Try to rename during active stream - should be blocked
232-
const renameResult = await env.mockIpcRenderer.invoke(
233-
IPC_CHANNELS.WORKSPACE_RENAME,
234-
workspaceId,
235-
"new-name"
236-
);
237-
expect(renameResult.success).toBe(false);
238-
expect(renameResult.error).toContain("stream is active");
239-
expect(renameResult.error).toContain("Press Esc");
240-
241-
// Test passed - rename was successfully blocked during active stream
242-
} finally {
243-
await cleanup();
244-
}
245-
},
246-
15000
247-
);
248-
249212
test.concurrent(
250213
"should fail to rename with invalid workspace name",
251214
async () => {

0 commit comments

Comments
 (0)