fix(tui): preserve launch context in resume commands - #5467
Open
Wsp030914 wants to merge 1 commit into
Open
Conversation
Forward only explicit config and workspace selectors so printed commands reopen the same instance without breaking implicit defaults. Refs HKUDS#5452
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
--configand--workspaceselectors in TUI resume commands/detachReproduction
Start the native TUI with a valid non-default config and workspace:
Start or select a session.
Exit the TUI, or use
/detach.Observe the printed resume command.
Before this fix, the command contains only the session ID:
nanobot configuration.
Actual behavior
The explicit config and workspace selectors are lost. The resume command may
connect to the default nanobot instance instead of reopening the session in its
original launch context.
Expected behavior
The printed command preserves the explicitly supplied selectors:
When no selectors were explicitly supplied, the existing short command should
remain unchanged.
Implementation
The Python TUI launcher forwards only explicitly supplied config and workspace
selectors through TUI-specific environment variables.
The TUI uses those values only when formatting resume commands. The canonical
config path used internally by the gateway remains unchanged.
Testing
uv run --no-sync pytest tests/cli/test_tui_launcher.py -quv run --no-sync ruff check nanobot/cli/agent.py nanobot/cli/tui_launcher.py tests/cli/test_tui_launcher.pyuv run --no-sync basedpyright nanobot/cli/agent.py nanobot/cli/tui_launcher.pycd tui && bun run checkcd tui && bun run testcd tui && bun run buildgit diff --checkFollow-up to #5452 and #5461.