{"record":{"id":"0cfe08d7cf9cc555","repo":"zeroclaw-labs/zeroclaw","slug":"elicitation-returned-unknown-choice-const-const","errorCode":null,"errorMessage":"elicitation returned unknown choice const: {const_value}","messagePattern":"elicitation returned unknown choice const: (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/zeroclaw-api/src/elicitation.rs","lineNumber":213,"sourceCode":"\n/// Decode the accepted `content` payload of an `elicitation/create`\n/// single-select response back into the original display text.\n///\n/// Expects `content.choice` to be a `\"choice-<idx>\"` string whose\n/// index is in bounds against `choices`. Returns the original text.\n/// Returns `Err` if the field is missing, malformed, or out of range —\n/// the same defense-in-depth posture the RFD recommends.\npub fn decode_single_select_accept(content: &Value, choices: &[String]) -> anyhow::Result<String> {\n    let const_value = content\n        .get(\"choice\")\n        .and_then(|v| v.as_str())\n        .ok_or_else(|| anyhow::Error::msg(\"elicitation accept missing content.choice string\"))?;\n    let idx = const_value\n        .strip_prefix(\"choice-\")\n        .and_then(|s| s.parse::<usize>().ok());\n    match idx.and_then(|i| choices.get(i)) {\n        Some(text) => Ok(text.clone()),\n        None => anyhow::bail!(\"elicitation returned unknown choice const: {const_value}\"),\n    }\n}\n\n/// Decode the accepted `content` payload of an `elicitation/create`\n/// multi-select response back into the original display texts.\npub fn decode_multi_select_accept(\n    content: &Value,\n    choices: &[String],\n) -> anyhow::Result<Vec<String>> {\n    let arr = content\n        .get(\"choices\")\n        .and_then(|v| v.as_array())\n        .ok_or_else(|| anyhow::Error::msg(\"elicitation accept missing content.choices array\"))?;\n    let mut out = Vec::with_capacity(arr.len());\n    for v in arr {\n        let s = v\n            .as_str()\n            .ok_or_else(|| anyhow::Error::msg(\"non-string entry in content.choices\"))?;","sourceCodeStart":195,"sourceCodeEnd":231,"githubUrl":"https://github.com/zeroclaw-labs/zeroclaw/blob/88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc/crates/zeroclaw-api/src/elicitation.rs#L195-L231","documentation":"Phase 6 of `zeroclaw update` (src/commands/update.rs:292) — after the new binary is swapped in, smoke_test runs `<exe> --version`; a spawn failure or non-zero exit triggers rollback_binary to restore the Phase-3 `<exe>.bak` backup, then this bail. The system is left on the previous, working version. It means the downloaded binary passed download and validation (size, architecture, --version on the staged copy in Phase 4) but fails to start from its final installed location.","triggerScenarios":"`zeroclaw update` where the newly swapped binary exits non-zero or cannot be executed in place: host linker/runtime incompatibility (binary built against a newer glibc), missing shared library or VC/UCRT runtime, macOS Gatekeeper/quarantine blocking the replaced binary, or a broken release build that only fails at runtime.","commonSituations":"Prebuilt linux-gnu binary on an older distro (glibc too old); missing Visual C++ redistributable on Windows; Gatekeeper quarantine on macOS; a release whose binary was miscompiled or stripped of a needed dependency.","solutions":["Confirm you are still on the old version (`zeroclaw --version`) — the rollback already restored it","Reproduce the real startup error: download the release archive manually, run the extracted binary's --version directly, and check dynamic linking (ldd on Linux)","If the prebuilt binary is incompatible with your system (glibc/runtime), install from source: ./install.sh --source (or --preset full / --features channels-full as needed)","If the binary is genuinely broken on all hosts, report the release with the startup error and stay on your current version until a fixed release ships"],"exampleFix":"# before\n$ zeroclaw update\nError: Update rolled back — smoke test failed: smoke test: updated binary returned non-zero exit code\n\n# after\n$ zeroclaw --version              # still on the old (rolled-back) version\n$ # reproduce the real startup failure of the new binary:\n$ curl -fsSL <release-url>/zeroclaw-x86_64-unknown-linux-gnu.tar.gz -o /tmp/zc.tgz\n$ tar xzf /tmp/zc.tgz -C /tmp && ldd /tmp/zeroclaw | grep 'not found'\n$ ./install.sh --source          # build locally if the prebuilt binary is incompatible","handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":"if let Err(e) = update::run(version, force).await {\n    if e.to_string().contains(\"Update rolled back — smoke test failed\") {\n        // Old version already restored. Verify with `zeroclaw --version`,\n        // keep the deployment pinned on the current version, and either\n        // install from source (./install.sh --source) or wait for a fixed\n        // release. Do not retry the same prebuilt artifact endlessly.\n    }\n}","preventionTips":["On older distros or unusual platforms, prefer source installs over prebuilt release binaries","Check release notes for runtime/glibc requirements before updating fleet hosts","Watch the zeroclaw log's Phase 6 smoke-test entry to distinguish spawn failures from non-zero exits"],"tags":["update","smoke-test","rollback","binary-compatibility","runtime-missing"],"backgroundTag":"binary-compatibility-failure","analyzedSha":"88bb9c8533fc57ed7a03e36ca7c9ed2bf8336dcc","analyzedAt":"2026-08-23T01:07:41.857Z","schemaVersion":2},"datasetVersion":"2026-08-23T08:06:27.607Z"}