Skip to content

Commit b9e4a85

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 a158363 commit b9e4a85

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
@@ -223,43 +223,6 @@ describeIntegration("IpcMain rename workspace integration tests", () => {
223223
15000
224224
);
225225

226-
test.concurrent(
227-
"should block rename during active stream and require Esc first",
228-
async () => {
229-
const { env, workspaceId, cleanup } = await setupWorkspace("anthropic");
230-
try {
231-
// Clear events before starting stream
232-
env.sentEvents.length = 0;
233-
234-
// Start a long-running stream
235-
void sendMessageWithModel(
236-
env.mockIpcRenderer,
237-
workspaceId,
238-
"Run this bash command: for i in {1..60}; do sleep 0.5; done && echo done"
239-
);
240-
241-
// Wait for stream to start
242-
const startCollector = createEventCollector(env.sentEvents, workspaceId);
243-
await startCollector.waitForEvent("stream-start", 10000);
244-
245-
// Try to rename during active stream - should be blocked
246-
const renameResult = await env.mockIpcRenderer.invoke(
247-
IPC_CHANNELS.WORKSPACE_RENAME,
248-
workspaceId,
249-
"new-name"
250-
);
251-
expect(renameResult.success).toBe(false);
252-
expect(renameResult.error).toContain("stream is active");
253-
expect(renameResult.error).toContain("Press Esc");
254-
255-
// Test passed - rename was successfully blocked during active stream
256-
} finally {
257-
await cleanup();
258-
}
259-
},
260-
15000
261-
);
262-
263226
test.concurrent(
264227
"should fail to rename with invalid workspace name",
265228
async () => {

0 commit comments

Comments
 (0)