{"record":{"id":"10abe65df74be307","repo":"HKUDS/nanobot","slug":"the-native-tui-can-open-only-websocket-sessions-u","errorCode":null,"errorMessage":"the native TUI can open only WebSocket sessions; use --classic to resume {session_id!r}","messagePattern":"the native TUI can open only WebSocket sessions; use --classic to resume (.+?)","errorType":"exception","errorClass":"TuiSessionError","httpStatus":null,"severity":"error","filePath":"nanobot/cli/tui_launcher.py","lineNumber":492,"sourceCode":"    try:\n        port = int(settings.get(\"port\") or 8765)\n    except (TypeError, ValueError):\n        port = 8765\n    secret = str(\n        settings.get(\"tokenIssueSecret\")\n        or settings.get(\"token_issue_secret\")\n        or settings.get(\"token\")\n        or \"\"\n    ).strip()\n    return f\"http://{host}:{port}\", secret\n\n\ndef _websocket_chat_id(session_id: str) -> str | None:\n    \"\"\"Map the CLI selector to the WebSocket namespace used by the native TUI.\"\"\"\n    if session_id.startswith(\"websocket:\"):\n        return session_id.split(\":\", 1)[1] or None\n    if \":\" in session_id:\n        raise TuiSessionError(\n            \"the native TUI can open only WebSocket sessions; use --classic to resume \"\n            f\"{session_id!r}\"\n        )\n    return session_id or None\n\n\ndef _initial_tui_chat_id(session_id: str | None) -> str | None:\n    \"\"\"Start fresh unless the caller explicitly selects a TUI chat.\"\"\"\n    if session_id is not None:\n        return _websocket_chat_id(session_id)\n    return None\n\n\ndef _initial_tui_workspace(workspace_override: str | None) -> Path:\n    \"\"\"Use the launch directory unless the caller explicitly selects a workspace.\"\"\"\n    workspace = Path(workspace_override) if workspace_override is not None else Path.cwd()\n    return workspace.expanduser().resolve(strict=False)\n","sourceCodeStart":474,"sourceCodeEnd":510,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/cli/tui_launcher.py#L474-L510","documentation":"Error \"the native TUI can open only WebSocket sessions; use --classic to resume {session_id!r}\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/cli/tui_launcher.py:492 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}