{"record":{"id":"70e8af5810d94785","repo":"HKUDS/Vibe-Trading","slug":"vibe-trading-home-must-not-be-a-unc-path-env-roo","errorCode":null,"errorMessage":"VIBE_TRADING_HOME must not be a UNC path: {env_root!r}","messagePattern":"VIBE_TRADING_HOME must not be a UNC path: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"agent/src/config/paths.py","lineNumber":30,"sourceCode":"\ndef get_runtime_root(config_path: Path | None = None) -> Path:\n    \"\"\"Return the runtime root directory for user-level agent state.\n\n    Args:\n        config_path: Optional explicit config file path. When provided, the\n            runtime root is derived from that file's parent directory.\n\n    Returns:\n        The directory containing the explicit structured config file when one\n        is provided, otherwise the ``VIBE_TRADING_HOME`` environment override,\n        otherwise the default ``~/.vibe-trading`` runtime root.\n    \"\"\"\n    if config_path is not None:\n        return config_path.expanduser().parent\n    env_root = os.environ.get(_HOME_ENV_VAR, \"\").strip()\n    if env_root:\n        if env_root.startswith((\"//\", \"\\\\\\\\\")):\n            raise ValueError(\n                f\"{_HOME_ENV_VAR} must not be a UNC path: {env_root!r}\"\n            )\n        return Path(env_root).expanduser()\n    return Path.home() / \".vibe-trading\"\n\n\ndef get_sessions_dir() -> Path:\n    \"\"\"Return the user-level directory holding chat session records.\"\"\"\n    return get_runtime_root() / \"sessions\"\n\n\ndef get_runs_dir() -> Path:\n    \"\"\"Return the user-level directory holding run artifacts.\"\"\"\n    return get_runtime_root() / \"runs\"\n\n\ndef get_swarm_runs_dir() -> Path:\n    \"\"\"Return the user-level directory holding swarm run records.\"\"\"","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/HKUDS/Vibe-Trading/blob/80ffdda44c5c4db0dd84d70e051cca591cea67df/agent/src/config/paths.py#L12-L48","documentation":"Raised by get_runtime_root when the VIBE_TRADING_HOME environment variable starts with '//' or '\\\\', i.e. a Windows UNC network path. Runtime state on UNC paths is explicitly unsupported, so config_path-parent, env-root, and session-dir derivation all refuse it.","triggerScenarios":"Setting VIBE_TRADING_HOME=\\\\server\\share\\vibe or //server/share/vibe on Windows and then calling anything that resolves the runtime root (_build_welcome_panel, get_sessions_dir, migrate_legacy_state, etc.).","commonSituations":"Corporate Windows environments with redirected profiles or mapped network home directories; CI runners on network shares; copy-pasting a UNC path into .env.","solutions":["Point VIBE_TRADING_HOME at a local drive path, e.g. C:\\Users\\me\\.vibe-trading.","If the share is required, map it to a drive letter first and use that letter in the env var.","Unset VIBE_TRADING_HOME to fall back to Path.home() / '.vibe-trading'."],"exampleFix":"# before\nVIBE_TRADING_HOME=\\\\fileserver\\share\\vibe-trading\n\n# after\nVIBE_TRADING_HOME=C:\\Users\\me\\.vibe-trading","handlingStrategy":"validation","validationCode":"import os\n\ndef runtime_home_valid() -> bool:\n    v = os.environ.get('VIBE_TRADING_HOME', '').strip()\n    return not v.startswith(('//', '\\\\\\\\'))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use local drive paths (or mapped drive letters) for VIBE_TRADING_HOME on Windows","Add an env-var sanity check at process start","Prefer the default ~/.vibe-trading unless a custom location is required"],"tags":["config","windows","unc-path","env-var","filesystem"],"backgroundTag":"invalid-env-var-value","analyzedSha":"80ffdda44c5c4db0dd84d70e051cca591cea67df","analyzedAt":"2026-08-28T12:46:38.989Z","schemaVersion":2},"datasetVersion":"2026-08-28T16:17:29.566Z"}