diff --git a/src/agent/mod.rs b/src/agent/mod.rs index 522937b..f4ba0c0 100644 --- a/src/agent/mod.rs +++ b/src/agent/mod.rs @@ -178,7 +178,7 @@ pub struct Agent { /// TODO: move to Session — it's session-level, not agent-level. pub agent_cycles: crate::subconscious::subconscious::AgentCycleState, /// Shared active tools — Agent writes, TUI reads. - pub active_tools: crate::agent::tools::SharedActiveTools, + pub active_tools: tools::SharedActiveTools, } fn render_journal(entries: &[context::JournalEntry]) -> String { @@ -326,7 +326,6 @@ impl Agent { pub async fn turn( agent: Arc>, user_input: &str, - target: StreamTarget, ) -> Result { // --- Pre-loop setup (lock 1): agent cycle, memories, user input --- let active_tools = { @@ -567,7 +566,7 @@ impl Agent { /// Used by `turn()` which manages its own locking. async fn dispatch_tool_call_unlocked( agent: &Arc>, - active_tools: &crate::agent::tools::SharedActiveTools, + active_tools: &tools::SharedActiveTools, call: &ToolCall, ds: &mut DispatchState, ) { diff --git a/src/mind/mod.rs b/src/mind/mod.rs index 5ebfbde..4197524 100644 --- a/src/mind/mod.rs +++ b/src/mind/mod.rs @@ -310,7 +310,7 @@ impl Mind { let agent = self.agent.clone(); let result_tx = self.turn_tx.clone(); self.shared.lock().unwrap().turn_handle = Some(tokio::spawn(async move { - let result = Agent::turn(agent, &input, target).await; + let result = Agent::turn(agent, &input).await; let _ = result_tx.send((result, target)).await; })); } diff --git a/src/user/chat.rs b/src/user/chat.rs index b3e643d..e976a84 100644 --- a/src/user/chat.rs +++ b/src/user/chat.rs @@ -222,15 +222,6 @@ fn strip_ansi(text: &str) -> String { out } -fn is_zero_width(ch: char) -> bool { - matches!(ch, - '\u{200B}'..='\u{200F}' | - '\u{2028}'..='\u{202F}' | - '\u{2060}'..='\u{2069}' | - '\u{FEFF}' - ) -} - fn new_textarea(lines: Vec) -> tui_textarea::TextArea<'static> { let mut ta = tui_textarea::TextArea::new(lines); ta.set_cursor_line_style(Style::default()); @@ -287,27 +278,6 @@ impl PaneState { } } - fn append_text(&mut self, text: &str) { - let clean = strip_ansi(text); - if self.use_markdown { - self.md_buffer.push_str(&clean); - } else { - for ch in clean.chars() { - if ch == '\n' { - let line = std::mem::take(&mut self.current_line); - self.lines.push(Line::styled(line, Style::default().fg(self.current_color))); - self.markers.push(Marker::None); - } else if ch == '\t' { - self.current_line.push_str(" "); - } else if ch.is_control() || is_zero_width(ch) { - } else { - self.current_line.push(ch); - } - } - } - self.evict(); - } - fn flush_pending(&mut self) { if self.use_markdown && !self.md_buffer.is_empty() { let parsed = parse_markdown(&self.md_buffer); @@ -385,7 +355,6 @@ pub(crate) struct InteractScreen { history_index: Option, active_pane: ActivePane, pane_areas: [Rect; 3], - needs_assistant_marker: bool, turn_started: Option, call_started: Option, call_timeout_secs: u64, @@ -414,7 +383,6 @@ impl InteractScreen { history_index: None, active_pane: ActivePane::Conversation, pane_areas: [Rect::default(); 3], - needs_assistant_marker: false, turn_started: None, call_started: None, call_timeout_secs: 60, diff --git a/src/user/mod.rs b/src/user/mod.rs index 347829b..d5fd086 100644 --- a/src/user/mod.rs +++ b/src/user/mod.rs @@ -345,7 +345,6 @@ pub async fn run( ) -> Result<()> { let agent = &mind.agent; let shared_mind = &mind.shared; - let turn_watch = mind.turn_watch(); // UI-owned state let mut idle_state = crate::thalamus::idle::State::new(); idle_state.load();