{"record":{"id":"c95ae06252326a1c","repo":"astrid-runtime/astrid","slug":"mcp-gateway-cleanup-is-only-supported-on-unix-host","errorCode":null,"errorMessage":"MCP gateway cleanup is only supported on Unix hosts","messagePattern":"MCP gateway cleanup is only supported on Unix hosts","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/astrid-cli/src/commands/mcp/mod.rs","lineNumber":90,"sourceCode":"mod ingress;\n#[cfg(unix)]\nmod lifecycle;\n#[cfg(not(unix))]\nmod lifecycle {\n    use std::process::ExitCode;\n\n    use anyhow::Result;\n\n    pub(crate) async fn ready(_principal: Option<&str>, _format: &str) -> Result<ExitCode> {\n        anyhow::bail!(\"MCP gateway readiness is only supported on Unix hosts\")\n    }\n\n    pub(crate) async fn stop_gateway() -> Result<()> {\n        Ok(())\n    }\n\n    pub(crate) fn gc() -> Result<ExitCode> {\n        anyhow::bail!(\"MCP gateway cleanup is only supported on Unix hosts\")\n    }\n}\nmod mrtr;\n// Parent-death detection reads `getppid()` (Unix-only); the module and its use\n// site are target-gated so the CLI still compiles on non-Unix targets.\n#[cfg(unix)]\nmod parent_death;\nmod readiness;\nmod server;\nmod session_guard;\nmod watch;\n\n#[allow(unused_imports)]\npub(crate) use attach::run as attach;\n#[allow(unused_imports)]\npub(crate) use gateway::run as gateway;\n#[allow(unused_imports)]\npub(crate) use lifecycle::{gc, ready, stop_gateway};","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/astrid-runtime/astrid/blob/affd8760f44190dbdfbec23403f4c4b642c33112/crates/astrid-cli/src/commands/mcp/mod.rs#L72-L108","documentation":"Sentinel guard in the non-Unix stub module: gc() always fails because gateway lifecycle (socket probes, PID handling) is only implemented behind #[cfg(unix)]; the caller invoked a Unix-only cleanup subcommand on a non-Unix host.","triggerScenarios":"Invoking `astrid mcp gc` on Windows or another non-Unix host.","commonSituations":"Scheduled cleanup tasks in Windows Task Scheduler; Windows CI maintenance jobs reaping orphaned MCP processes.","solutions":["Run `astrid mcp gc` on Linux or macOS (or WSL2).","Clean up orphaned processes manually on Windows via Task Manager / `taskkill` filtering astrid MCP processes.","Move scheduled cleanup jobs to a Unix runner.","Request Windows support for process reaping."],"exampleFix":"// before (Task Scheduler on Windows)\nastrid mcp gc\n// after\nwsl -e astrid mcp gc","handlingStrategy":"fallback","validationCode":"if !cfg!(unix) {\n    eprintln!(\"mcp gc is Unix-only; clean up processes manually on this host\");\n}","typeGuard":"fn supports_mcp_gc() -> bool { cfg!(unix) }","tryCatchPattern":"match gc() {\n    Err(e) if e.to_string().contains(\"cleanup is only supported on Unix\") =>\n        eprintln!(\"run gc from a Unix host or reap processes manually\"),\n    other => other?,\n}","preventionTips":["Schedule cleanup jobs only on Unix runners","Reap orphaned MCP processes manually on Windows","Use WSL2 for maintenance commands","Document the Unix-only surface of mcp subcommands"],"tags":["platform","cleanup","mcp","unsupported"],"backgroundTag":"unsupported-platform","analyzedSha":"affd8760f44190dbdfbec23403f4c4b642c33112","analyzedAt":"2026-09-09T21:28:12.402Z","contentChangedAt":"2026-09-09T21:28:12.402Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}