Skip to content

Commit fba8697

Browse files
committed
chore(browser): drop dead workspace_id alias lookups
Followup to 7e36420. P2 made cli_session_name the only key the AgentBrowserManager registers, so the workspace_id fallbacks in control.rs (vision_port) and commands/workspace.rs (close-on-teardown) never match anything. Remove them and refresh the stale comments.
1 parent d532f9a commit fba8697

2 files changed

Lines changed: 7 additions & 6 deletions

File tree

src-tauri/src/commands/workspace.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -704,11 +704,13 @@ pub fn close_workspace(
704704
}
705705

706706
// Close agent browser CLI session for this workspace.
707-
// Release port entries for both cli_session_name and workspace_id keys.
707+
// P2 from docs/plans/browser-stream-fix.md removed the workspace_id
708+
// alias the manager used to register, so closing under
709+
// cli_session_name is sufficient — there is no longer a second key
710+
// to reap.
708711
{
709712
let cli_name = state.find_detached_agent_browser(&workspace_id)
710713
.map(|s| s.cli_session_name.clone());
711-
let ws_id = workspace_id.clone();
712714
let app_handle = app.clone();
713715
tauri::async_runtime::spawn(async move {
714716
let manager: State<'_, AgentBrowserManager> = app_handle.state();
@@ -717,8 +719,6 @@ pub fn close_workspace(
717719
eprintln!("[AGENT_BROWSER] Failed to close agent browser for workspace: {error}");
718720
}
719721
}
720-
// Also remove the workspace_id port entry (may be a separate HashMap key).
721-
let _ = manager.close(&ws_id).await;
722722
});
723723
}
724724

src-tauri/src/control.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -768,9 +768,10 @@ async fn dispatch_request(app: &AppHandle, request: ControlRequest) -> ControlRe
768768
};
769769

770770
// Get the port for this session (already allocated above or in start_stream).
771-
// Try cli_session_name first (key used by start_stream/close), then workspace_id.
771+
// P2 from docs/plans/browser-stream-fix.md removed the
772+
// `workspace_id` alias the manager used to register, so
773+
// `cli_session_name` is the only key the manager knows.
772774
let vision_port = agent_browser.get_port(&cli_session_name).await
773-
.or(agent_browser.get_port(&workspace_id).await)
774775
.unwrap_or(crate::agent_browser::DEFAULT_STREAM_PORT);
775776

776777
let result = match action_kind.as_str() {

0 commit comments

Comments
 (0)