{"record":{"id":"9b0b55578c50a329","repo":"tinyhumansai/openhuman","slug":"tui-feature-disabled-at-compile-time-rebuild-with","errorCode":null,"errorMessage":"tui feature disabled at compile time; rebuild with `--features tui` (or use a default-feature build) to enable `openhuman tui`","messagePattern":"tui feature disabled at compile time; rebuild with `--features tui` \\(or use a default-feature build\\) to enable `openhuman tui`","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/cli.rs","lineNumber":192,"sourceCode":"            Some(\"model\") => parsed.model = Some(value.to_string()),\n            Some(\"provider\") => parsed.provider = Some(value.to_string()),\n            _ => unreachable!(\"launch option target is fixed above\"),\n        }\n        i += 1;\n    }\n\n    parsed.args = args[i..].to_vec();\n    Ok(parsed)\n}\n\n#[cfg(feature = \"tui\")]\nfn run_tui_from_cli(args: &[String]) -> Result<()> {\n    crate::tui::run_from_cli(args)\n}\n\n#[cfg(not(feature = \"tui\"))]\nfn run_tui_from_cli(_args: &[String]) -> Result<()> {\n    anyhow::bail!(\n        \"tui feature disabled at compile time; rebuild with `--features tui` \\\n         (or use a default-feature build) to enable `openhuman tui`\"\n    )\n}\n\n/// Pure launch policy for the bare `openhuman` command. Explicit subcommands\n/// are never rewritten. Docker and redirected/CI sessions keep the headless\n/// CLI behavior; `openhuman tui` remains an explicit override everywhere.\nfn should_auto_launch_tui(\n    args: &[String],\n    stdin_is_terminal: bool,\n    stdout_is_terminal: bool,\n    host: crate::core::types::HostKind,\n    tui_compiled: bool,\n) -> bool {\n    args.is_empty()\n        && stdin_is_terminal\n        && stdout_is_terminal","sourceCodeStart":174,"sourceCodeEnd":210,"githubUrl":"https://github.com/tinyhumansai/openhuman/blob/a221052e0df5b1f7598fceba7329fd1af95d6699/src/core/cli.rs#L174-L210","documentation":"This binary was compiled without the `tui` cargo feature, so `run_tui_from_cli` is the #[cfg(not(feature = \"tui\"))] stub that reports the build fact instead of pretending the subcommand is unknown. It is a compile-time gate, not a runtime setting: no config, env var, or flag can enable the TUI in this binary. Note the message's '(or use a default-feature build)' parenthetical — in this repo `default` does NOT include `tui` (Cargo.toml lists media/skills/flows/mcp/channels/medulla/http-server/scheduler-gate/file-logging), so the reliable fix is an explicit `--features tui` rebuild; the desktop shell intentionally does not forward this gate.","triggerScenarios":"Running `openhuman tui` (or the alias `openhuman chat`) on a binary built with `--no-default-features`, a slim/kernel feature list, or the contrib `default` set — all of which omit `tui`; a desktop-shell build, which deliberately never gets the feature.","commonSituations":"Interactive debugging against a slim build optimized for compile speed; CI-built binaries; scripts assuming the TUI exists everywhere; stale binaries from an older feature configuration.","solutions":["Rebuild with the gate enabled: `cargo build --bin openhuman-core --features tui`","Or use a binary you know was built with `tui` in its feature list (check with `cargo tree -i ratatui` against that build)","Or stay headless: `openhuman run` / namespace commands are always compiled and need no gate"],"exampleFix":"# before\nopenhuman tui   # -> tui feature disabled at compile time\n# after\ncargo build --manifest-path Cargo.toml --bin openhuman-core --features tui\n./target/debug/openhuman-core tui","handlingStrategy":"validation","validationCode":"# bash: fail fast if this binary lacks the tui gate before relying on it\nif ! cargo tree --manifest-path Cargo.toml -i ratatui --features tui >/dev/null 2>&1; then\n  echo 'build does not enable tui; rebuild with --features tui' >&2; exit 1\nfi\n# at runtime, probe the stub's distinctive stderr marker in a subprocess:\nif openhuman tui </dev/null 2>&1 | grep -q 'feature disabled at compile time'; then\n  echo 'this binary has no TUI; falling back to headless CLI' >&2\nfi","typeGuard":null,"tryCatchPattern":"out=$(openhuman tui 2>&1 >/dev/null); case \"$out\" in *'disabled at compile time'*) echo 'build lacks --features tui; using headless CLI instead' >&2; openhuman run;; *) echo \"$out\" >&2; exit 1;; esac","preventionTips":["Note that the repo's default feature list does NOT include tui — always pass --features tui explicitly when building for interactive use","The desktop shell intentionally never forwards this gate; do not expect the TUI there","Pin and document the exact cargo feature list for binaries you distribute"],"tags":["feature-gate","build-config","tui","cli"],"backgroundTag":null,"analyzedSha":"a221052e0df5b1f7598fceba7329fd1af95d6699","analyzedAt":"2026-08-16T12:47:06.542Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}