From 04aeb4d31d8be3725c52693fa83e7fbccc7ba059 Mon Sep 17 00:00:00 2001 From: echobt Date: Wed, 4 Feb 2026 15:24:26 +0000 Subject: [PATCH 1/2] fix(auth): use unwrap_or_default for SystemTime operations --- src/cortex-app-server/src/auth.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cortex-app-server/src/auth.rs b/src/cortex-app-server/src/auth.rs index 414f36f..4f240c3 100644 --- a/src/cortex-app-server/src/auth.rs +++ b/src/cortex-app-server/src/auth.rs @@ -45,7 +45,7 @@ impl Claims { pub fn new(user_id: impl Into, expiry_seconds: u64) -> Self { let now = SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .unwrap_or_default() .as_secs(); Self { @@ -75,7 +75,7 @@ impl Claims { pub fn is_expired(&self) -> bool { let now = SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .unwrap_or_default() .as_secs(); self.exp < now } @@ -187,7 +187,7 @@ impl AuthService { pub async fn cleanup_revoked_tokens(&self) { let now = SystemTime::now() .duration_since(UNIX_EPOCH) - .unwrap() + .unwrap_or_default() .as_secs(); let mut revoked = self.revoked_tokens.write().await; From 977a3ee10a2ae77d92dec5483485f456fb6aeb67 Mon Sep 17 00:00:00 2001 From: echobt Date: Wed, 4 Feb 2026 15:29:06 +0000 Subject: [PATCH 2/2] fix(tools): align tool handler names with registration names --- src/cortex-engine/src/tools/handlers/file_ops.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cortex-engine/src/tools/handlers/file_ops.rs b/src/cortex-engine/src/tools/handlers/file_ops.rs index ef9f044..430cb24 100644 --- a/src/cortex-engine/src/tools/handlers/file_ops.rs +++ b/src/cortex-engine/src/tools/handlers/file_ops.rs @@ -204,7 +204,7 @@ impl Default for WriteFileHandler { #[async_trait] impl ToolHandler for WriteFileHandler { fn name(&self) -> &str { - "Write" + "Create" } async fn execute(&self, arguments: Value, context: &ToolContext) -> Result { @@ -445,7 +445,7 @@ impl Default for SearchFilesHandler { #[async_trait] impl ToolHandler for SearchFilesHandler { fn name(&self) -> &str { - "search_files" + "SearchFiles" } async fn execute(&self, arguments: Value, context: &ToolContext) -> Result {