@@ -56,6 +56,10 @@ impl ModeSelector {
self.set_mode(all_modes[next_index].id.clone(), cx);
}
+ pub fn mode(&self) -> acp::SessionModeId {
+ self.connection.current_mode()
+ }
+
pub fn set_mode(&mut self, mode: acp::SessionModeId, cx: &mut Context<Self>) {
let task = self.connection.set_mode(mode, cx);
self.setting_mode = true;
@@ -1135,6 +1135,7 @@ impl AcpThreadView {
self.is_loading_contents = true;
let model_id = self.current_model_id(cx);
+ let mode_id = self.current_mode_id(cx);
let guard = cx.new(|_| ());
cx.observe_release(&guard, |this, _guard, cx| {
this.is_loading_contents = false;
@@ -1169,7 +1170,8 @@ impl AcpThreadView {
"Agent Message Sent",
agent = agent_telemetry_id,
session = session_id,
- model = model_id
+ model = model_id,
+ mode = mode_id
);
thread.send(contents, cx)
@@ -1182,6 +1184,7 @@ impl AcpThreadView {
agent = agent_telemetry_id,
session = session_id,
model = model_id,
+ mode = mode_id,
status,
turn_time_ms,
);
@@ -5405,6 +5408,16 @@ impl AcpThreadView {
)
}
+ fn current_mode_id(&self, cx: &App) -> Option<Arc<str>> {
+ if let Some(thread) = self.as_native_thread(cx) {
+ Some(thread.read(cx).profile().0.clone())
+ } else if let Some(mode_selector) = self.mode_selector() {
+ Some(mode_selector.read(cx).mode().0)
+ } else {
+ None
+ }
+ }
+
fn current_model_id(&self, cx: &App) -> Option<String> {
self.model_selector
.as_ref()