[travsr-cli] Fix #777: refuse travsr mcp on a terminal instead of hanging - #803
Open
ritikpal1122 wants to merge 1 commit into
Open
[travsr-cli] Fix #777: refuse travsr mcp on a terminal instead of hanging#803ritikpal1122 wants to merge 1 commit into
ritikpal1122 wants to merge 1 commit into
Conversation
…stead of hanging `travsr mcp` speaks JSON-RPC over stdin, so run directly in a terminal it blocked on a request that is never typed: no output, no prompt, no indication anything was wrong. The reported experience was a process that "appears frozen". Guarded on stdin rather than stdout. A client that pipes stdin while leaving stderr on the terminal is a normal working setup, so testing stdout would refuse a legitimate launch. stdin being a terminal is the condition that makes the server unusable, because there is no client on the other end to send a request. TRAVSR_MCP_ALLOW_TTY keeps the escape hatch for driving the protocol by hand, which is a real debugging workflow the guard would otherwise remove. The message names the transport, why nothing happened, and both ways forward. An error that only said "not a tty" would reproduce the same dead end faster. Verified all three paths against the built binary rather than only the unit test: a TTY refuses and exits, piped stdin still serves a real initialize response, and the override serves on a TTY. The test asserts the wording, since faking a terminal is not portable and the branch itself is one call, while the wording is what can regress silently.
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.
Closes #777.
travsr mcpspeaks JSON-RPC over stdin, so run directly in a terminal it blocked on a request that is never typed: no output, no prompt, no indication anything was wrong. The report describes a process that "appears frozen".Two decisions worth calling out
Guarded on stdin, not stdout. A client that pipes stdin while leaving stderr on the terminal is a normal working setup, so testing stdout would refuse a legitimate launch. stdin being a terminal is the condition that actually makes the server unusable, because there is no client on the other end to send a request.
TRAVSR_MCP_ALLOW_TTYkeeps the escape hatch. Pasting a frame by hand to probe a response is a real debugging workflow, and a guard with no override would remove it.Verified against the built binary, not only the unit test
All three paths, because the failure mode here is behavioural:
The middle one matters most: it is the regression this guard could plausibly cause, and it does not.
On the test
It asserts the wording, not the TTY branch. Faking a terminal on stdin is not portable, and the branch itself is a single
is_terminalcall. What can regress silently is the message, and the entire point of the issue is that the user was left with nothing to act on, so a message that stopped namingtravsr connector the override would reintroduce the dead end in a quieter form.Verification
One file changed.