fix(cli): isolate Desktop compatibility probes [skip ci]
An older terminal can ignore the protocol probe flag and consume inherited gateway credentials or terminal input. Scrub its TUI environment and close stdin before probing, then pass only the selected Desktop resolver metadata to the compatible client. Validate the complete ready frame before opening mutation gates, not just its identity metadata. Add failing-before regressions and scope the existing recovery test process stub so real lease cleanup remains testable without changing runtime ownership.
This commit is contained in:
1 parent
48e7c4f697
commit
9a594f74ff
5 files changed
+61
-6
No files matched your search
@@ -18,9 +18,9 @@ from nanobot.cli.tui_launcher import (
|
||||
_initial_tui_chat_id,
|
||||
_initial_tui_workspace,
|
||||
_resolve_source_tui_command,
|
||||
resolve_tui_command,
|
||||
_websocket_chat_id,
|
||||
launch_tui,
|
||||
resolve_tui_command,
|
||||
)
|
||||
from nanobot.config.schema import Config, ModelPresetConfig
|
||||
|
||||
@@ -228,9 +228,15 @@ def test_launcher_keeps_the_tui_alive_while_an_existing_gateway_recovers(
|
||||
|
||||
monkeypatch.setattr("nanobot.gateway.GatewayRuntime", FakeRuntime)
|
||||
monkeypatch.setattr("nanobot.cli.tui_launcher.resolve_tui_command", lambda: ["nanobot-tui"])
|
||||
# Stub only this launcher's child; lease cleanup still needs real subprocess
|
||||
# calls to check live process state (including ps on macOS/Linux).
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.tui_launcher.subprocess.Popen",
|
||||
lambda *args, **kwargs: FakeProcess(),
|
||||
tui_launcher,
|
||||
"subprocess",
|
||||
SimpleNamespace(
|
||||
Popen=lambda *args, **kwargs: FakeProcess(),
|
||||
TimeoutExpired=subprocess.TimeoutExpired,
|
||||
),
|
||||
)
|
||||
monkeypatch.setattr(
|
||||
"nanobot.cli.tui_launcher._webui_endpoint_reachable",
|
||||
|
||||
Reference in new issue
Block a user