trying to get closer to pi

This commit is contained in:
Michael Neale
2026-02-10 15:59:30 +11:00
parent b16986dd77
commit 2addd93717
4 changed files with 83 additions and 1225 deletions
File diff suppressed because it is too large Load Diff
@@ -276,40 +276,6 @@ new file mode 100644
assert!(content == "new content" || content == "new content\n");
}
#[tokio::test]
async fn test_undo_after_diff() {
let temp_dir = TempDir::new().unwrap();
let file_path = temp_dir.path().join("test.txt");
std::fs::write(&file_path, "original\n").unwrap();
let diff = r#"--- a/test.txt
+++ b/test.txt
@@ -1 +1 @@
-original
+modified"#;
let history = Arc::new(Mutex::new(HashMap::new()));
// Apply diff
let result = apply_diff(&file_path, diff, &history).await;
if let Err(e) = &result {
eprintln!("Error applying diff in test_undo_after_diff: {:?}", e);
}
assert!(result.is_ok());
// patcher doesn't preserve trailing newlines in the same way
let content_after = std::fs::read_to_string(&file_path).unwrap();
assert!(content_after == "modified" || content_after == "modified\n");
// Undo should restore original
let undo_result = text_editor_undo(&file_path, &history).await;
if let Err(e) = &undo_result {
eprintln!("Error undoing in test_undo_after_diff: {:?}", e);
}
assert!(undo_result.is_ok());
assert_eq!(std::fs::read_to_string(&file_path).unwrap(), "original\n");
}
#[tokio::test]
async fn test_multi_file_diff() {
let temp_dir = TempDir::new().unwrap();
+7 -7
View File
@@ -808,8 +808,8 @@ impl Agent {
}
pub async fn subagents_enabled(&self, session_id: &str) -> bool {
// In small mode, disable subagents for simpler tool set
if std::env::var("GOOSE_SMALL_MODE").map(|v| v == "true").unwrap_or(false) {
// Small mode is on by default — disable subagents unless explicitly opted out
if std::env::var("GOOSE_SMALL_MODE").map(|v| v != "false").unwrap_or(true) {
return false;
}
if self.config.goose_mode != GooseMode::Auto {
@@ -842,9 +842,9 @@ impl Agent {
.await
.unwrap_or_default();
// In small mode, filter developer extension to core tools only (read, edit, write, shell)
// Other extensions keep all their tools
let small_mode = std::env::var("GOOSE_SMALL_MODE").map(|v| v == "true").unwrap_or(false);
// Small mode on by default: filter developer extension to core tools only (read, edit, write, shell)
// Set GOOSE_SMALL_MODE=false to expose all tools
let small_mode = std::env::var("GOOSE_SMALL_MODE").map(|v| v != "false").unwrap_or(true);
if small_mode {
let core_tools = ["read", "edit", "write", "shell"];
prefixed_tools.retain(|tool| {
@@ -1194,8 +1194,8 @@ impl Agent {
tool_call_cut_off,
);
// In small mode, skip MOIM injection for simpler prompts
let conversation_for_llm = if std::env::var("GOOSE_SMALL_MODE").map(|v| v == "true").unwrap_or(false) {
// Small mode on by default: skip MOIM injection for simpler prompts
let conversation_for_llm = if std::env::var("GOOSE_SMALL_MODE").map(|v| v != "false").unwrap_or(true) {
conversation.clone()
} else {
super::moim::inject_moim(
+1 -1
View File
@@ -168,7 +168,7 @@ impl Agent {
let model_config = provider.get_model_config();
let small_mode =
std::env::var("GOOSE_SMALL_MODE").map(|v| v == "true").unwrap_or(false);
std::env::var("GOOSE_SMALL_MODE").map(|v| v != "false").unwrap_or(true);
// Prepare system prompt
let mut extensions_info = self.extension_manager.get_extensions_info().await;