fix(tui): harden themes and platform coverage

This commit is contained in:
Xubin Ren
2026-08-17 20:56:10 +08:00
parent 347583d3f7
commit 35f2d086b0
11 changed files with 208 additions and 15 deletions
+9
View File
@@ -67,6 +67,11 @@ def agent(
"--no-tui",
help="Use the classic Python prompt instead of the native terminal UI",
),
theme: str = typer.Option(
"auto",
"--theme",
help="Terminal UI appearance: auto, dark, or light",
),
):
"""Interact with the agent directly."""
from nanobot.bus.queue import MessageBus
@@ -75,6 +80,9 @@ def agent(
from nanobot.providers.image_generation import image_gen_provider_configs
runtime_config = _load_runtime_config(config, workspace)
theme = theme.strip().lower()
if theme not in {"auto", "dark", "light"}:
raise typer.BadParameter("must be auto, dark, or light", param_hint="--theme")
native_tui = (
message is None
and not classic
@@ -93,6 +101,7 @@ def agent(
config_path=get_config_path().resolve(strict=False),
workspace_override=workspace,
session_id=session_id,
theme=theme,
)
except TuiUnavailableError as exc:
console.print(f"[yellow]Native TUI unavailable: {exc}[/yellow]")