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
3 changes: 2 additions & 1 deletion crates/goose-acp/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ name = "generate-acp-schema"
path = "src/bin/generate_acp_schema.rs"

[features]
default = ["code-mode"]
default = ["code-mode", "local-inference"]
code-mode = ["goose/code-mode"]
local-inference = ["goose/local-inference"]

[lints]
workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/goose-acp/tests/common_tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,7 @@ pub async fn run_prompt_basic<C: Connection>() {
expected_session_id.assert_matches(&session.session_id().0);
}

#[cfg(feature = "code-mode")]
pub async fn run_prompt_codemode<C: Connection>() {
Comment on lines +360 to 361
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Gate all code-mode ACP tests consistently

Adding #[cfg(feature = "code-mode")] here removes run_prompt_codemode from no-code-mode builds, but crates/goose-acp/tests/provider_test.rs still imports and invokes it unconditionally (use ... run_prompt_codemode and test_prompt_codemode). That makes cargo test -p goose-acp --no-default-features fail to compile with an unresolved symbol, so the no-default-features path is currently broken.

Useful? React with 👍 / 👎.

Comment thread
r0x0d marked this conversation as resolved.
let expected_session_id = ExpectedSessionId::default();
let prompt =
Expand Down
6 changes: 4 additions & 2 deletions crates/goose-acp/tests/provider_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
mod common_tests;
use common_tests::fixtures::provider::ClientToProviderConnection;
use common_tests::fixtures::run_test;
#[cfg(feature = "code-mode")]
use common_tests::run_prompt_codemode;
use common_tests::{
run_config_mcp, run_fs_read_text_file_true, run_fs_write_text_file_false,
run_fs_write_text_file_true, run_initialize_doesnt_hit_provider, run_load_model,
run_load_session_mcp, run_model_list, run_model_set, run_permission_persistence,
run_prompt_basic, run_prompt_codemode, run_prompt_image, run_prompt_image_attachment,
run_prompt_mcp,
run_prompt_basic, run_prompt_image, run_prompt_image_attachment, run_prompt_mcp,
};

#[test]
Expand Down Expand Up @@ -71,6 +72,7 @@ fn test_prompt_basic() {
}

#[test]
#[cfg(feature = "code-mode")]
fn test_prompt_codemode() {
run_test(async { run_prompt_codemode::<ClientToProviderConnection>().await });
}
Expand Down
6 changes: 4 additions & 2 deletions crates/goose-acp/tests/server_test.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
mod common_tests;
use common_tests::fixtures::run_test;
use common_tests::fixtures::server::ClientToAgentConnection;
#[cfg(feature = "code-mode")]
use common_tests::run_prompt_codemode;
use common_tests::{
run_config_mcp, run_fs_read_text_file_true, run_fs_write_text_file_false,
run_fs_write_text_file_true, run_initialize_doesnt_hit_provider, run_load_model,
run_load_session_mcp, run_model_list, run_model_set, run_permission_persistence,
run_prompt_basic, run_prompt_codemode, run_prompt_image, run_prompt_image_attachment,
run_prompt_mcp,
run_prompt_basic, run_prompt_image, run_prompt_image_attachment, run_prompt_mcp,
};

#[test]
Expand Down Expand Up @@ -65,6 +66,7 @@ fn test_prompt_basic() {
}

#[test]
#[cfg(feature = "code-mode")]
fn test_prompt_codemode() {
run_test(async { run_prompt_codemode::<ClientToAgentConnection>().await });
}
Expand Down
3 changes: 2 additions & 1 deletion crates/goose-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ comfy-table = "7.2.2"
winapi = { version = "0.3", features = ["wincred"] }

[features]
default = ["code-mode"]
default = ["code-mode", "local-inference"]
code-mode = ["goose/code-mode", "goose-acp/code-mode"]
cuda = ["goose/cuda"]
local-inference = ["goose/local-inference", "goose-acp/local-inference"]
# disables the update command
disable-update = []

Expand Down
5 changes: 5 additions & 0 deletions crates/goose-cli/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,6 +858,7 @@ enum Command {
command: TermCommand,
},
/// Manage local inference models
#[cfg(feature = "local-inference")]
#[command(about = "Manage local inference models", visible_alias = "lm")]
LocalModels {
#[command(subcommand)]
Expand Down Expand Up @@ -885,6 +886,7 @@ enum Command {
},
}

#[cfg(feature = "local-inference")]
#[derive(Subcommand)]
enum LocalModelsCommand {
/// Search HuggingFace for GGUF models
Expand Down Expand Up @@ -1006,6 +1008,7 @@ fn get_command_name(command: &Option<Command>) -> &'static str {
Some(Command::Update { .. }) => "update",
Some(Command::Recipe { .. }) => "recipe",
Some(Command::Term { .. }) => "term",
#[cfg(feature = "local-inference")]
Some(Command::LocalModels { .. }) => "local-models",
Some(Command::Completion { .. }) => "completion",
Some(Command::ValidateExtensions { .. }) => "validate-extensions",
Expand Down Expand Up @@ -1459,6 +1462,7 @@ async fn handle_term_subcommand(command: TermCommand) -> Result<()> {
}
}

#[cfg(feature = "local-inference")]
async fn handle_local_models_command(command: LocalModelsCommand) -> Result<()> {
use goose::providers::local_inference::hf_models;
use goose::providers::local_inference::local_model_registry::{
Expand Down Expand Up @@ -1744,6 +1748,7 @@ pub async fn cli() -> anyhow::Result<()> {
}
Some(Command::Recipe { command }) => handle_recipe_subcommand(command),
Some(Command::Term { command }) => handle_term_subcommand(command).await,
#[cfg(feature = "local-inference")]
Some(Command::LocalModels { command }) => handle_local_models_command(command).await,
Some(Command::ValidateExtensions { file }) => {
use goose::agents::validate_extensions::validate_bundled_extensions;
Expand Down
3 changes: 2 additions & 1 deletion crates/goose-server/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ description.workspace = true
workspace = true

[features]
default = ["code-mode"]
default = ["code-mode", "local-inference"]
code-mode = ["goose/code-mode"]
cuda = ["goose/cuda"]
local-inference = ["goose/local-inference"]

[dependencies]
goose = { path = "../goose", default-features = false }
Expand Down
Loading
Loading