Skip to content
Merged
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
13 changes: 11 additions & 2 deletions src/agent/routine_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1150,9 +1150,11 @@ pub fn spawn_cron_ticker(
interval: Duration,
) -> tokio::task::JoinHandle<()> {
tokio::spawn(async move {
// Run one check immediately so routines due at startup don't wait
// an extra full polling interval.
engine.check_cron_triggers().await;

let mut ticker = tokio::time::interval(interval);
Comment thread
G7CNF marked this conversation as resolved.
// Skip immediate first tick
ticker.tick().await;

loop {
ticker.tick().await;
Expand Down Expand Up @@ -1358,4 +1360,11 @@ mod tests {
assert_eq!(finish_reason_length, crate::llm::FinishReason::Length);
assert_eq!(finish_reason_stop, crate::llm::FinishReason::Stop);
}

#[test]
fn test_truncate_adds_ellipsis_when_over_limit() {
let input = "abcdefghijk";
let out = super::truncate(input, 5);
assert_eq!(out, "abcde...");
}
}
40 changes: 20 additions & 20 deletions src/tools/builtin/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,26 +420,6 @@ impl Tool for MemoryReadTool {
}
}

#[cfg(test)]
mod path_routing_tests {
use super::looks_like_filesystem_path;

#[test]
fn detects_filesystem_paths() {
assert!(looks_like_filesystem_path("/Users/nige/file.md"));
assert!(looks_like_filesystem_path("C:\\Users\\nige\\file.md"));
assert!(looks_like_filesystem_path("D:/work/file.md"));
assert!(looks_like_filesystem_path("~/notes.md"));
}

#[test]
fn allows_workspace_memory_paths() {
assert!(!looks_like_filesystem_path("MEMORY.md"));
assert!(!looks_like_filesystem_path("daily/2026-03-11.md"));
assert!(!looks_like_filesystem_path("projects/alpha/notes.md"));
}
}

/// Tool for viewing workspace structure as a tree.
///
/// Returns a hierarchical view of files and directories with configurable depth.
Expand Down Expand Up @@ -636,3 +616,23 @@ mod tests {
assert_eq!(schema["properties"]["depth"]["default"], 1);
}
}

#[cfg(test)]
mod path_routing_tests {
use super::looks_like_filesystem_path;

#[test]
fn detects_filesystem_paths() {
assert!(looks_like_filesystem_path("/Users/nige/file.md"));
assert!(looks_like_filesystem_path("C:\\Users\\nige\\file.md"));
assert!(looks_like_filesystem_path("D:/work/file.md"));
assert!(looks_like_filesystem_path("~/notes.md"));
}

#[test]
fn allows_workspace_memory_paths() {
assert!(!looks_like_filesystem_path("MEMORY.md"));
assert!(!looks_like_filesystem_path("daily/2026-03-11.md"));
assert!(!looks_like_filesystem_path("projects/alpha/notes.md"));
}
}
6 changes: 5 additions & 1 deletion src/tools/mcp/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1751,7 +1751,11 @@ mod tests {
"https://app.attio.com/oidc/authorize",
"test-client",
"http://127.0.0.1:9876/callback",
&["mcp".to_string(), "offline_access".to_string(), "openid".to_string()],
&[
"mcp".to_string(),
"offline_access".to_string(),
"openid".to_string(),
],
Some(&pkce),
&extra_params,
Some("https://mcp.attio.com/mcp"),
Expand Down
Loading