Repository navigation
fix(cli): reject --transport when combined with the tui subcommand - #44
Closed
CryptoJones wants to merge 2 commits into
Closed
CryptoJones wants to merge 2 commits into
CryptoJones wants to merge 2 commits into
Conversation
`--transport` defaulted to "stdio", so `main()` couldn't tell an explicit flag from the default and `perplexity-agent --transport http tui` silently ignored --transport and launched the interactive TUI — e.g. on a headless host whose unit file was edited to add `tui`. The default is now a None sentinel; pairing --transport with the `tui` subcommand is an argparse usage error (exit 2). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The "# fail fast if the API key is missing" comment appeared verbatim on both branches after the call was moved past the subcommand dispatch, reading as accidental copy-paste. The tui-branch one now explains the ordering (loaded after the arg check) instead. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This was referenced Jun 12, 2026
Owner
Author
|
Superseded by #48 (re-targeted onto v0.2.0). |
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.
Resolves #23. Independent of the other open PRs.
--transportdefaulted to"stdio", somain()could not distinguish an explicitly-passed flag from the default —perplexity-agent --transport http tuicheckedargs.command == "tui"first and launched the interactive UI, silently discarding--transport. On a headless host (e.g. a systemd unit edited to appendtui) that swaps the hardened HTTP MCP server for an interactive TUI.The
--transportdefault is now aNonesentinel; combining it with thetuisubcommand is an argparse usage error (exit 2). Plaintui, plain server, and--transport httpserver modes are unchanged.Tests
New
test_main_transport_with_tui_is_rejectedasserts the exit-2 usage error and that the TUI is not launched. Verified against the real entrypoint too. 81 passed, ruff + mypy --strict clean.Closes #23.
🤖 Generated with Claude Code