tinyhumansai/openhuman · error

missing --workspace

Error message

missing --workspace

What it means

Value-presence guard in `parse_workspace_flag`, used by the `subconscious status` path. When --workspace/-w is the final token there is no following argument to read, so the parser fails instead of treating the flag as valueless. It reports a truncated command line, not an invalid path.

Solutions

  1. Put the path immediately after the flag: `--workspace /path/to/ws` (short form -w).
  2. Omit the flag to use the configured workspace_dir.
  3. Quote paths that contain spaces.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/core/subconscious_cli.rs:239 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/694ab3c31b83a1e9. Report an issue: GitHub.

Appendix: source

Thrown at src/core/subconscious_cli.rs:239

            "interval_minutes": mode.default_interval_minutes().max(5),
        });

        println!("{}", serde_json::to_string_pretty(&status)?);
        Ok(())
    })
}

// ── helpers ────────────────────────────────────────────────────────────────

fn parse_workspace_flag(args: &[String]) -> Result<Option<PathBuf>> {
    let mut workspace: Option<PathBuf> = None;
    let mut i = 0;
    while i < args.len() {
        match args[i].as_str() {
            "--workspace" | "-w" => {
                workspace = Some(PathBuf::from(
                    args.get(i + 1)
                        .ok_or_else(|| anyhow!("missing --workspace"))?,
                ));
                i += 2;
            }
            other => return Err(anyhow!("unknown flag '{other}'")),
        }
    }
    Ok(workspace)
}

fn is_help(s: &str) -> bool {
    matches!(s, "--help" | "-h" | "help")
}

fn print_help() {
    eprintln!(
        "Usage: openhuman subconscious <command> [options]

Commands:

View on GitHub (pinned to 7491200858)