Skip to repository content54 lines · 2.0 KB · rust
tenant.openagents/omega
No repository description is available.
OpenAgents Git authority 2026-07-28T07:35:23.671Z Public web read
NIP-34 coordinate
30617:7649603503856e5148d571eac2766b288a8ff1e9e35d380337a1d2b0015b4f92:omegaMaintainersHidden in public view
References2 branches · 1 tag
Read-only clone
git clone https://openagents.com/git/tenant.openagents/omega.gitBrowse files
remote_debug.rs
1use gpui::TaskExt;
2use workspace::Workspace;
3use zed_actions::remote_debug::{SimulateDisconnect, SimulateTimeout, SimulateTimeoutExhausted};
4
5pub fn init(cx: &mut gpui::App) {
6 cx.observe_new(|workspace: &mut Workspace, _, cx| {
7 let project = workspace.project().read(cx);
8 let Some(remote_client) = project.remote_client() else {
9 return;
10 };
11
12 workspace.register_action({
13 let remote_client = remote_client.downgrade();
14 move |_, _: &SimulateDisconnect, _window, cx| {
15 let Some(remote_client) = remote_client.upgrade() else {
16 return;
17 };
18
19 log::info!("SimulateDisconnect: forcing disconnect from remote server");
20 remote_client.update(cx, |client, cx| {
21 client.force_disconnect(cx).detach_and_log_err(cx);
22 });
23 }
24 });
25
26 workspace.register_action({
27 let remote_client = remote_client.downgrade();
28 move |_, _: &SimulateTimeout, _window, cx| {
29 let Some(remote_client) = remote_client.upgrade() else {
30 return;
31 };
32
33 log::info!("SimulateTimeout: forcing heartbeat timeout on remote connection");
34 remote_client.update(cx, |client, cx| {
35 client.force_heartbeat_timeout(0, cx);
36 });
37 }
38 });
39
40 let remote_client = remote_client.downgrade();
41 workspace.register_action(move |_, _: &SimulateTimeoutExhausted, _window, cx| {
42 let Some(remote_client) = remote_client.upgrade() else {
43 return;
44 };
45
46 log::info!("SimulateTimeout: forcing heartbeat timeout on remote connection");
47 remote_client.update(cx, |client, cx| {
48 client.force_heartbeat_timeout(remote::remote_client::MAX_RECONNECT_ATTEMPTS, cx);
49 });
50 });
51 })
52 .detach();
53}
54