diff --git a/src/agent/api/mod.rs b/src/agent/api/mod.rs index c0e0f6e..e448e2b 100644 --- a/src/agent/api/mod.rs +++ b/src/agent/api/mod.rs @@ -44,7 +44,7 @@ pub(crate) struct SamplingParams { // ───────────────────────────────────────────────────────────── /// One token from the streaming completions API. -pub(crate) enum StreamToken { +pub enum StreamToken { Token { text: String, id: u32 }, Done { usage: Option }, Error(String), diff --git a/src/agent/mod.rs b/src/agent/mod.rs index 0c0e7f3..a5fe19c 100644 --- a/src/agent/mod.rs +++ b/src/agent/mod.rs @@ -318,7 +318,7 @@ impl Agent { loop { let _thinking = start_activity(&agent, "thinking...").await; - let (mut rx, _stream_guard) = { + let (rx, _stream_guard) = { let prompt_tokens = agent.assemble_prompt_tokens().await; let st = agent.state.lock().await; agent.client.stream_completion( diff --git a/src/agent/oneshot.rs b/src/agent/oneshot.rs index 5c72cb9..45dcab8 100644 --- a/src/agent/oneshot.rs +++ b/src/agent/oneshot.rs @@ -12,29 +12,11 @@ use crate::subconscious::{defs, prompts}; use std::fs; use std::path::PathBuf; -use std::sync::OnceLock; -use super::api::ApiClient; use super::context::AstNode; use super::tools::{self as agent_tools}; use super::Agent; -// --------------------------------------------------------------------------- -// API client — shared across oneshot agent runs -// --------------------------------------------------------------------------- - -static API_CLIENT: OnceLock = OnceLock::new(); - -fn get_client() -> Result<&'static ApiClient, String> { - Ok(API_CLIENT.get_or_init(|| { - let config = crate::config::get(); - let base_url = config.api_base_url.as_deref().unwrap_or(""); - let api_key = config.api_key.as_deref().unwrap_or(""); - let model = config.api_model.as_deref().unwrap_or("qwen-2.5-27b"); - ApiClient::new(base_url, api_key, model) - })) -} - // --------------------------------------------------------------------------- // AutoAgent — multi-step autonomous agent // --------------------------------------------------------------------------- @@ -52,9 +34,6 @@ pub struct AutoAgent { pub name: String, pub tools: Vec, pub steps: Vec, - sampling: super::api::SamplingParams, - priority: i32, - /// Named outputs from the agent's output() tool calls. /// Collected per-run, read by Mind after completion. pub outputs: std::collections::BTreeMap, // Observable status @@ -122,15 +101,11 @@ impl AutoAgent { name: String, tools: Vec, steps: Vec, - temperature: f32, - priority: i32, + _temperature: f32, + _priority: i32, ) -> Self { Self { name, tools, steps, - sampling: super::api::SamplingParams { - temperature, top_p: 0.95, top_k: 20, - }, - priority, outputs: std::collections::BTreeMap::new(), current_phase: String::new(), turn: 0, diff --git a/src/subconscious/learn.rs b/src/subconscious/learn.rs index 905e163..9fa3d5e 100644 --- a/src/subconscious/learn.rs +++ b/src/subconscious/learn.rs @@ -22,6 +22,7 @@ const SCORE_TIMEOUT: std::time::Duration = std::time::Duration::from_secs(120); // ── Message building ──────────────────────────────────────────── /// What to filter when building the message array for scoring. +#[allow(dead_code)] enum Filter<'a> { None, SkipIndex(usize),