BlueGit

ict rusty-teams

feat(calling): teams.exe --unmute for the call e2e test

- meetings start muted on purpose, a direct --join stayed muted, so the test sent silence
- call-e2e unmutes once the guest is in
- found with the CALLING_AUDIO_DUMP stage dumps: raw mic empty, far end full

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

metis Daniel Däschle · pushed by metis

Authored 2026-11-08 · 3 weeks ago

Hash
0513b155746500ca90f9cd1d720bceb9bd5874f3
Parent
883c2e06
3 files changed +11 −1
crates/app-state/src/call/remote_command.rs +8 −0
@@ -1,3 +1,4 @@
1 use calling::{CallCommand, MuteCommand};
1 2 use gpui_kit::*;
2 3
3 4 use super::join::JoinMode;
@@ -6,15 +7,18 @@ use crate::app_state::AppState;
6 7 pub const JOIN_FLAG: &str = "--join";
7 8 pub const HANG_UP_FLAG: &str = "--hang-up";
8 9 pub const ADMIT_ALL_FLAG: &str = "--admit-all";
10 pub const UNMUTE_FLAG: &str = "--unmute";
9 11 const JOIN_COMMAND: &str = "join ";
10 12 const HANG_UP_COMMAND: &str = "hang-up";
11 13 const ADMIT_ALL_COMMAND: &str = "admit-all";
14 const UNMUTE_COMMAND: &str = "unmute";
12 15
13 16 #[derive(Debug, Clone, PartialEq, Eq)]
14 17 pub enum RemoteCommand {
15 18 Join(String),
16 19 HangUp,
17 20 AdmitAll,
21 Unmute,
18 22 }
19 23
20 24 impl RemoteCommand {
@@ -23,6 +27,7 @@ impl RemoteCommand {
23 27 RemoteCommand::Join(link) => format!("{JOIN_COMMAND}{link}"),
24 28 RemoteCommand::HangUp => HANG_UP_COMMAND.to_owned(),
25 29 RemoteCommand::AdmitAll => ADMIT_ALL_COMMAND.to_owned(),
30 RemoteCommand::Unmute => UNMUTE_COMMAND.to_owned(),
26 31 }
27 32 }
28 33
@@ -30,6 +35,7 @@ impl RemoteCommand {
30 35 match text {
31 36 HANG_UP_COMMAND => return Some(RemoteCommand::HangUp),
32 37 ADMIT_ALL_COMMAND => return Some(RemoteCommand::AdmitAll),
38 UNMUTE_COMMAND => return Some(RemoteCommand::Unmute),
33 39 _ => {}
34 40 }
35 41 let link = text.strip_prefix(JOIN_COMMAND)?.trim();
@@ -48,6 +54,7 @@ impl AppState {
48 54 }
49 55 Some(RemoteCommand::HangUp) => self.leave_call(cx),
50 56 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
57 Some(RemoteCommand::Unmute) => self.send_call_command(CallCommand::Mute(MuteCommand::Unmute)),
51 58 None => {}
52 59 }
53 60 }
@@ -63,6 +70,7 @@ mod tests {
63 70 RemoteCommand::Join("https://teams.microsoft.com/l/meetup-join/x".to_owned()),
64 71 RemoteCommand::HangUp,
65 72 RemoteCommand::AdmitAll,
73 RemoteCommand::Unmute,
66 74 ] {
67 75 assert_eq!(RemoteCommand::decode(&command.encode()), Some(command));
68 76 }
@@ -1,3 +1,4 @@
1use calling::{CallCommand, MuteCommand};
1use gpui_kit::*;
2use gpui_kit::*;
2
3
3use super::join::JoinMode;
4use super::join::JoinMode;
@@ -6,15 +7,18 @@ use crate::app_state::AppState;
6pub const JOIN_FLAG: &str = "--join";
7pub const JOIN_FLAG: &str = "--join";
7pub const HANG_UP_FLAG: &str = "--hang-up";
8pub const HANG_UP_FLAG: &str = "--hang-up";
8pub const ADMIT_ALL_FLAG: &str = "--admit-all";
9pub const ADMIT_ALL_FLAG: &str = "--admit-all";
10pub const UNMUTE_FLAG: &str = "--unmute";
9const JOIN_COMMAND: &str = "join ";
11const JOIN_COMMAND: &str = "join ";
10const HANG_UP_COMMAND: &str = "hang-up";
12const HANG_UP_COMMAND: &str = "hang-up";
11const ADMIT_ALL_COMMAND: &str = "admit-all";
13const ADMIT_ALL_COMMAND: &str = "admit-all";
14const UNMUTE_COMMAND: &str = "unmute";
12
15
13#[derive(Debug, Clone, PartialEq, Eq)]
16#[derive(Debug, Clone, PartialEq, Eq)]
14pub enum RemoteCommand {
17pub enum RemoteCommand {
15 Join(String),
18 Join(String),
16 HangUp,
19 HangUp,
17 AdmitAll,
20 AdmitAll,
21 Unmute,
18}
22}
19
23
20impl RemoteCommand {
24impl RemoteCommand {
@@ -23,6 +27,7 @@ impl RemoteCommand {
23 RemoteCommand::Join(link) => format!("{JOIN_COMMAND}{link}"),
27 RemoteCommand::Join(link) => format!("{JOIN_COMMAND}{link}"),
24 RemoteCommand::HangUp => HANG_UP_COMMAND.to_owned(),
28 RemoteCommand::HangUp => HANG_UP_COMMAND.to_owned(),
25 RemoteCommand::AdmitAll => ADMIT_ALL_COMMAND.to_owned(),
29 RemoteCommand::AdmitAll => ADMIT_ALL_COMMAND.to_owned(),
30 RemoteCommand::Unmute => UNMUTE_COMMAND.to_owned(),
26 }
31 }
27 }
32 }
28
33
@@ -30,6 +35,7 @@ impl RemoteCommand {
30 match text {
35 match text {
31 HANG_UP_COMMAND => return Some(RemoteCommand::HangUp),
36 HANG_UP_COMMAND => return Some(RemoteCommand::HangUp),
32 ADMIT_ALL_COMMAND => return Some(RemoteCommand::AdmitAll),
37 ADMIT_ALL_COMMAND => return Some(RemoteCommand::AdmitAll),
38 UNMUTE_COMMAND => return Some(RemoteCommand::Unmute),
33 _ => {}
39 _ => {}
34 }
40 }
35 let link = text.strip_prefix(JOIN_COMMAND)?.trim();
41 let link = text.strip_prefix(JOIN_COMMAND)?.trim();
@@ -48,6 +54,7 @@ impl AppState {
48 }
54 }
49 Some(RemoteCommand::HangUp) => self.leave_call(cx),
55 Some(RemoteCommand::HangUp) => self.leave_call(cx),
50 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
56 Some(RemoteCommand::AdmitAll) => self.admit_all_call_guests(cx),
57 Some(RemoteCommand::Unmute) => self.send_call_command(CallCommand::Mute(MuteCommand::Unmute)),
51 None => {}
58 None => {}
52 }
59 }
53 }
60 }
@@ -63,6 +70,7 @@ mod tests {
63 RemoteCommand::Join("https://teams.microsoft.com/l/meetup-join/x".to_owned()),
70 RemoteCommand::Join("https://teams.microsoft.com/l/meetup-join/x".to_owned()),
64 RemoteCommand::HangUp,
71 RemoteCommand::HangUp,
65 RemoteCommand::AdmitAll,
72 RemoteCommand::AdmitAll,
73 RemoteCommand::Unmute,
66 ] {
74 ] {
67 assert_eq!(RemoteCommand::decode(&command.encode()), Some(command));
75 assert_eq!(RemoteCommand::decode(&command.encode()), Some(command));
68 }
76 }
crates/app/src/main.rs +2 −1
@@ -25,7 +25,7 @@ use gpui_kit::*;
25 25 use store::Store;
26 26
27 27 use crate::app_state::{AppState, Mode};
28 use crate::call::remote_command::{ADMIT_ALL_FLAG, HANG_UP_FLAG, JOIN_FLAG, RemoteCommand};
28 use crate::call::remote_command::{ADMIT_ALL_FLAG, HANG_UP_FLAG, JOIN_FLAG, RemoteCommand, UNMUTE_FLAG};
29 29 use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
30 30
31 31 const LINUX_APP_ID: &str = "rusty-teams";
@@ -83,6 +83,7 @@ fn parse_arguments() -> Arguments {
83 83 JOIN_FLAG => arguments.remote_command = input.next().map(RemoteCommand::Join),
84 84 HANG_UP_FLAG => arguments.remote_command = Some(RemoteCommand::HangUp),
85 85 ADMIT_ALL_FLAG => arguments.remote_command = Some(RemoteCommand::AdmitAll),
86 UNMUTE_FLAG => arguments.remote_command = Some(RemoteCommand::Unmute),
86 87 "--database" => arguments.database = input.next().map(PathBuf::from),
87 88 "--endpoint" => arguments.endpoint = input.next(),
88 89 "--open" => {
@@ -25,7 +25,7 @@ use gpui_kit::*;
25use store::Store;
25use store::Store;
26
26
27use crate::app_state::{AppState, Mode};
27use crate::app_state::{AppState, Mode};
28use crate::call::remote_command::{ADMIT_ALL_FLAG, HANG_UP_FLAG, JOIN_FLAG, RemoteCommand};
28use crate::call::remote_command::{ADMIT_ALL_FLAG, HANG_UP_FLAG, JOIN_FLAG, RemoteCommand, UNMUTE_FLAG};
29use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
29use views::shell::{AppShell, OpenTarget, Startup, bind_keys};
30
30
31const LINUX_APP_ID: &str = "rusty-teams";
31const LINUX_APP_ID: &str = "rusty-teams";
@@ -83,6 +83,7 @@ fn parse_arguments() -> Arguments {
83 JOIN_FLAG => arguments.remote_command = input.next().map(RemoteCommand::Join),
83 JOIN_FLAG => arguments.remote_command = input.next().map(RemoteCommand::Join),
84 HANG_UP_FLAG => arguments.remote_command = Some(RemoteCommand::HangUp),
84 HANG_UP_FLAG => arguments.remote_command = Some(RemoteCommand::HangUp),
85 ADMIT_ALL_FLAG => arguments.remote_command = Some(RemoteCommand::AdmitAll),
85 ADMIT_ALL_FLAG => arguments.remote_command = Some(RemoteCommand::AdmitAll),
86 UNMUTE_FLAG => arguments.remote_command = Some(RemoteCommand::Unmute),
86 "--database" => arguments.database = input.next().map(PathBuf::from),
87 "--database" => arguments.database = input.next().map(PathBuf::from),
87 "--endpoint" => arguments.endpoint = input.next(),
88 "--endpoint" => arguments.endpoint = input.next(),
88 "--open" => {
89 "--open" => {
scripts/call-e2e.mjs +1 −0
@@ -233,6 +233,7 @@ try {
233 233 throw new Error('Teams web guest did not join, see web-join.png');
234 234 }
235 235 await tab.activate();
236 runTeams('--unmute');
236 237 const processId = teamsProcessId();
237 238 if (!processId) throw new Error('teams.exe is not running');
238 239 log(`measuring ${MEASURE_SECONDS}s (teams.exe pid ${processId})`);
@@ -233,6 +233,7 @@ try {
233 throw new Error('Teams web guest did not join, see web-join.png');
233 throw new Error('Teams web guest did not join, see web-join.png');
234 }
234 }
235 await tab.activate();
235 await tab.activate();
236 runTeams('--unmute');
236 const processId = teamsProcessId();
237 const processId = teamsProcessId();
237 if (!processId) throw new Error('teams.exe is not running');
238 if (!processId) throw new Error('teams.exe is not running');
238 log(`measuring ${MEASURE_SECONDS}s (teams.exe pid ${processId})`);
239 log(`measuring ${MEASURE_SECONDS}s (teams.exe pid ${processId})`);