From b36327948d1773f5c542f1335ec4965ce8f9d7d8 Mon Sep 17 00:00:00 2001 From: rock Date: Tue, 15 Sep 2026 08:53:11 +0900 Subject: [PATCH] fix: separate agent and memory endpoint namespaces /memory/* - memory service (organized by project) /agents/* - agent service (separate offering) --- crates/mem-cli/src/handlers/agent_handler.rs | 6 +++--- crates/mem-cli/src/http_server.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/mem-cli/src/handlers/agent_handler.rs b/crates/mem-cli/src/handlers/agent_handler.rs index 53e5209..c769100 100644 --- a/crates/mem-cli/src/handlers/agent_handler.rs +++ b/crates/mem-cli/src/handlers/agent_handler.rs @@ -390,7 +390,7 @@ pub struct PromptResponse { pub created_at: String, } -/// POST /memory/agents/{project_id}/prompts - Create agent prompt +/// POST /agents/{id}/prompts - Create agent prompt pub async fn create_prompt_handler( req: HttpRequest, path: web::Path, @@ -462,7 +462,7 @@ pub struct MapRoleToPromptRequest { pub priority: Option, } -/// POST /memory/agents/{project_id}/roles - Map role to prompt +/// POST /agents/{id}/roles - Map role to prompt pub async fn map_role_to_prompt_handler( req: HttpRequest, path: web::Path, @@ -548,7 +548,7 @@ pub struct RolePromptsResponse { pub prompts: Vec, } -/// GET /memory/agents/{project_id}/roles/{role_name}/prompts - Get prompts for role +/// GET /agents/{id}/roles/{role_name}/prompts - Get prompts for role pub async fn get_role_prompts_handler( req: HttpRequest, path: web::Path<(String, String)>, diff --git a/crates/mem-cli/src/http_server.rs b/crates/mem-cli/src/http_server.rs index 0776535..c1ddcc0 100644 --- a/crates/mem-cli/src/http_server.rs +++ b/crates/mem-cli/src/http_server.rs @@ -440,9 +440,9 @@ pub async fn start_server(port: u16, api_key: String, database_url: &str) -> Res .route("/agents/{id}", web::put().to(crate::handlers::agent_handler::update_agent_handler)) .route("/agents/{id}", web::delete().to(crate::handlers::agent_handler::delete_agent_handler)) .route("/agents/{id}/metrics", web::get().to(crate::handlers::agent_handler::get_agent_metrics_handler)) - .route("/memory/agents/{project_id}/prompts", web::post().to(crate::handlers::agent_handler::create_prompt_handler)) - .route("/memory/agents/{project_id}/roles", web::post().to(crate::handlers::agent_handler::map_role_to_prompt_handler)) - .route("/memory/agents/{project_id}/roles/{role_name}/prompts", web::get().to(crate::handlers::agent_handler::get_role_prompts_handler)) + .route("/agents/{id}/prompts", web::post().to(crate::handlers::agent_handler::create_prompt_handler)) + .route("/agents/{id}/roles", web::post().to(crate::handlers::agent_handler::map_role_to_prompt_handler)) + .route("/agents/{id}/roles/{role_name}/prompts", web::get().to(crate::handlers::agent_handler::get_role_prompts_handler)) }); tracing::info!("HttpServer instance created, binding to 0.0.0.0:{}", port);