{"record":{"id":"05de1d94b1feb37c","repo":"zeroclaw-labs/zeroclaw","slug":"zeroclaw-sop-approve-deny-pending-requires-the-a","errorCode":null,"errorMessage":"`zeroclaw sop approve/deny/pending` requires the agent-runtime build (the gateway client)","messagePattern":"`zeroclaw sop approve/deny/pending` requires the agent-runtime build \\(the gateway client\\)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"src/main.rs","lineNumber":6848,"sourceCode":"            Err(anyhow::Error::msg(format!(\n                \"Failed to connect to gateway: {e}\"\n            )))\n        }\n    }\n}\n\n/// Dispatch the gateway-backed SOP verbs. Requires the `agent-runtime` build (the\n/// gateway HTTP client + `gateway_admin_url` live behind it, like `shutdown_gateway`);\n/// without it these verbs cannot reach the daemon, so they error clearly.\nasync fn sop_admin_dispatch(cmd: SopCommands, config: &crate::config::Config) -> Result<()> {\n    #[cfg(feature = \"agent-runtime\")]\n    {\n        sop_admin_request(cmd, config).await\n    }\n    #[cfg(not(feature = \"agent-runtime\"))]\n    {\n        let _ = (cmd, config);\n        anyhow::bail!(\n            \"`zeroclaw sop approve/deny/pending` requires the agent-runtime build (the gateway client)\"\n        )\n    }\n}\n\n/// CLI -> daemon dispatch for the out-of-band SOP approval verbs (EPIC C, C8).\n/// Posts to `/admin/sop/*` on the running gateway (mirrors `shutdown_gateway`);\n/// never builds a throwaway local engine, which cannot see the daemon's runs.\n#[cfg(feature = \"agent-runtime\")]\nasync fn sop_admin_request(cmd: SopCommands, config: &crate::config::Config) -> Result<()> {\n    let host = config.gateway.host.clone();\n    let port = config.gateway.port;\n    let prefix = config.gateway.path_prefix.as_deref();\n    let client = reqwest::Client::new();\n    match cmd {\n        SopCommands::Pending => {\n            let url = gateway_admin_url(&host, port, prefix, \"/admin/sop/pending\");\n            let resp = client","sourceCodeStart":6830,"sourceCodeEnd":6866,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/src/main.rs#L6830-L6866","documentation":"`zeroclaw sop approve|deny|pending` must reach the running daemon's `/admin/sop/*` endpoints, and the gateway HTTP client plus `gateway_admin_url` compile only behind the `agent-runtime` cargo feature. In builds without it, `sop_admin_dispatch` bails immediately instead of failing at connect time. Local SOP verbs (list/validate/show) still work because they never touch the gateway.","triggerScenarios":"Running `zeroclaw sop pending|approve|deny` on a binary built with `--no-default-features` or otherwise without `agent-runtime` (e.g. slim distro or downstream packaging).","commonSituations":"Distro/container images that trim cargo features to shrink the binary; custom `cargo build` invocations copying a minimal feature list; a slim CLI paired with a full daemon.","solutions":["Use the standard release binary — agent-runtime is part of the default feature set","Build from source with the feature: `cargo build --release` (default features) or `--features agent-runtime`","If the binary cannot be swapped, drive the daemon directly: GET/POST `http://<gateway.host>:<gateway.port>[<path_prefix>]/admin/sop/{pending,approve,deny}`"],"exampleFix":"# before\ncargo build --release --no-default-features\nzeroclaw sop pending   # bails: needs agent-runtime\n# after\ncargo build --release   # default features include agent-runtime\nzeroclaw sop pending","handlingStrategy":"fallback","validationCode":"# smoke-test the binary's capability before scripting SOP approvals\nout=\"$(zeroclaw sop pending 2>&1)\" || case \"$out\" in\n  *agent-runtime*) echo \"slim build: route SOP admin via HTTP instead\"; exit 3 ;;\n  *) echo \"$out\"; exit 1 ;;\nesac","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin the official release binary in deployment tooling so features are known","After installing any binary, smoke-test `zeroclaw sop pending` once","Document required cargo features in downstream packaging recipes"],"tags":["build-features","sop","gateway","compile-time","zeroclaw"],"backgroundTag":"missing-build-feature","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}