Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions crates/buzz-agent/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ goose = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d1820
# exact same Goose revision as `goose` so shared conversation types stay unified.
goose-agent = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d182080a53286c4942629f66565" }
goose-provider-types = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d182080a53286c4942629f66565" }
goose-context-management = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d182080a53286c4942629f66565" }
goose-sdk-types = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d182080a53286c4942629f66565" }
# ModelConfig: goose re-exports it from goose-providers; goose::model_config
# keeps its own copy private.
goose-providers = { git = "https://github.com/aaif-goose/goose", rev = "0a9749b1cbf38d182080a53286c4942629f66565" }
Expand Down
2 changes: 1 addition & 1 deletion crates/buzz-agent/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -902,7 +902,7 @@ async fn cancel_session(app: &Arc<App>, params: Value) {
/// Construct the goose provider. See [`crate::provider`].
async fn build_provider(
provider_name: &str,
) -> Result<Arc<dyn goose::providers::base::Provider>, AgentError> {
) -> Result<Arc<dyn goose_providers::base::Provider>, AgentError> {
crate::provider::build(provider_name).await
}

Expand Down
23 changes: 10 additions & 13 deletions crates/buzz-agent/src/loop_drive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
//! | tool surface | `Agent::list_tools` |
//! | tool execution | `Agent::dispatch_tool_call` |
//! | system prompt | `Agent::build_turn_system_prompt` → `PromptManager` |
//! | compaction | `goose::context_mgmt::{check_if_compaction_needed, compact_messages}` |
//! | compaction | `goose_context_management` with buzz threshold policy |
//! | conversation store | buzz's own [`crate::turn_state::TurnState`], in memory |
//!
//! Everything that decides *turn shape* stays here: round structure, the
Expand Down Expand Up @@ -158,13 +158,8 @@ pub async fn run_turn(

// The turn's conversation lives here, not in a database. See
// `crate::turn_state` for why goose never needed one.
let (_provider, model_config, _model_id) = ctx.model.snapshot().await;
let model_config = Some(model_config);
let mut state = crate::turn_state::TurnState::new(
ctx.session_id.to_string(),
ctx.working_dir.clone(),
model_config,
);
let mut state =
crate::turn_state::TurnState::new(ctx.session_id.to_string(), ctx.working_dir.clone());
for message in ctx.history.iter().cloned() {
state.push(message);
}
Expand Down Expand Up @@ -203,7 +198,6 @@ pub async fn run_turn(
ctx.model.clone(),
Arc::clone(ctx.mcp),
ctx.hook_extension.map(str::to_string),
ctx.session_id.to_string(),
),
ctx.cancel.clone(),
);
Expand Down Expand Up @@ -621,7 +615,7 @@ fn warn_if_silent_turn(published: bool, text_is_empty: bool, output_tokens: Opti

fn accumulate_usage(
tokens: &mut super::agent::TurnTokens,
usage: &goose::providers::base::ProviderUsage,
usage: &goose_provider_types::conversation::token_usage::ProviderUsage,
) {
let u = &usage.usage;
if let Some(i) = u.input_tokens {
Expand Down Expand Up @@ -716,7 +710,7 @@ mod tests {
use super::*;

fn turn_state() -> crate::turn_state::TurnState {
crate::turn_state::TurnState::new("s".to_string(), std::path::PathBuf::from("/tmp"), None)
crate::turn_state::TurnState::new("s".to_string(), std::path::PathBuf::from("/tmp"))
}

fn usage(
Expand All @@ -726,7 +720,7 @@ mod tests {
total: Option<i32>,
read: Option<i32>,
write: Option<i32>,
) -> goose::providers::base::ProviderUsage {
) -> goose_provider_types::conversation::token_usage::ProviderUsage {
let mut provider_usage = goose_provider_types::conversation::token_usage::Usage::new(
Some(input),
Some(output),
Expand All @@ -736,7 +730,10 @@ mod tests {
// `Usage::new` synthesizes a total when absent; tests need to exercise
// a provider response that genuinely omitted it.
provider_usage.total_tokens = total;
goose::providers::base::ProviderUsage::new(model.to_string(), provider_usage)
goose_provider_types::conversation::token_usage::ProviderUsage::new(
model.to_string(),
provider_usage,
)
}

#[test]
Expand Down
6 changes: 3 additions & 3 deletions crates/buzz-agent/src/mcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub struct McpRegistry {
init_timeout: Duration,
tool_timeout: Duration,
hook_timeout: Duration,
skills: Vec<goose::custom_requests::SourceEntry>,
skills: Vec<goose_sdk_types::custom_requests::SourceEntry>,
}

impl McpRegistry {
Expand Down Expand Up @@ -219,7 +219,7 @@ impl McpRegistry {
skills: goose::skills::discover_skills(Some(std::path::Path::new(cwd)))
.into_iter()
.filter(|skill| {
skill.source_type != goose::custom_requests::SourceType::BuiltinSkill
skill.source_type != goose_sdk_types::custom_requests::SourceType::BuiltinSkill
})
.collect(),
};
Expand Down Expand Up @@ -370,7 +370,7 @@ impl McpRegistry {
tools
}

pub fn skills(&self) -> &[goose::custom_requests::SourceEntry] {
pub fn skills(&self) -> &[goose_sdk_types::custom_requests::SourceEntry] {
&self.skills
}

Expand Down
4 changes: 2 additions & 2 deletions crates/buzz-agent/src/model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

use std::sync::Arc;

use goose::providers::base::Provider;
use goose_providers::base::Provider;
use goose_providers::model::ModelConfig;
use tokio::sync::RwLock;

Expand Down Expand Up @@ -97,7 +97,7 @@ mod tests {
_system: &str,
_messages: &[Message],
_tools: &[rmcp::model::Tool],
) -> Result<goose::providers::base::MessageStream, ProviderError> {
) -> Result<goose_provider_types::base::MessageStream, ProviderError> {
unreachable!("tests never call the model")
}
}
Expand Down
Loading
Loading