Skip to content

Solution for long term memory for agent coding CLIs and to facilitate handoff between different agent vendors

Rust

fix(omp): refuse redirects in the OMP and Pi handoff read

João Matheus83f728c37378
diff --git a/crates/ai-memory-cli/src/commands/install_hooks.rs b/crates/ai-memory-cli/src/commands/install_hooks.rs
index 3df6ba12..d0da3391 100644
--- a/crates/ai-memory-cli/src/commands/install_hooks.rs
+++ b/crates/ai-memory-cli/src/commands/install_hooks.rs
@@ -6132,8 +6132,11 @@ async function fetchHandoff(cwd: string, id: string | undefined): Promise<string
if (id) url.searchParams.set("session_id", id);
if (!applyMarkerParams(url, cwd)) return undefined;
try {{
+ // The body becomes the agent's context, so a redirect is refused: a
+ // gateway's login page must never arrive as the handoff.
const response = await fetch(url, {{
proxy: false,
+ redirect: "error",
headers: authHeaders(),
signal: timeoutSignal(1000),
}});