Delete ui_channel.rs — relocate types, remove all UiMessage/UiSender plumbing

Types relocated:
- StreamTarget → mind/mod.rs (Mind decides Conversation vs Autonomous)
- SharedActiveTools + shared_active_tools() → agent/tools/mod.rs
- ContextSection + SharedContextState → agent/context.rs (already there)
- StatusInfo + ContextInfo → user/mod.rs (UI display state)

Removed UiSender from: Agent::turn, Mind, learn.rs, all function signatures.
The entire message-passing layer is gone. All state flows through
Agent fields (activities, entries, streaming) read by the UI via try_lock.

Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
ProofOfConcept 2026-04-05 22:34:48 -04:00
parent cfddb55ed9
commit f390fa1617
11 changed files with 72 additions and 165 deletions

View file

@ -9,7 +9,6 @@ use reqwest::Client;
use tokio::sync::mpsc;
use super::types::*;
use crate::user::ui_channel::UiSender;
use super::StreamEvent;
/// Stream SSE events from an OpenAI-compatible endpoint, sending
@ -23,7 +22,6 @@ pub(super) async fn stream_events(
messages: &[Message],
tools_json: &serde_json::Value,
tx: &mpsc::UnboundedSender<StreamEvent>,
ui_tx: &UiSender,
reasoning_effort: &str,
sampling: super::SamplingParams,
priority: Option<i32>,
@ -71,7 +69,7 @@ pub(super) async fn stream_events(
)
.await?;
let mut reader = super::SseReader::new(ui_tx);
let mut reader = super::SseReader::new();
reader.request_json = request_json;
let mut content_len: usize = 0;
@ -167,7 +165,6 @@ pub(super) async fn stream_events(
let total_elapsed = reader.stream_start.elapsed();
super::log_diagnostics(
ui_tx,
content_len,
tool_call_count,
reasoning_chars,