Repository navigation
Conversation
When the browser can't reach fx's loopback listener, as in a sandbox or over SSH, `/mcp login` in the TUI now finishes with the address the browser ends on, pasted into the composer. It works from a typed `/mcp login` and from the `/mcp` menu, the same way `fx mcp login` already reads a pasted address from stdin. The return is matched against the waiting sign-in's redirect and state, and it never reaches the model, a slash command, or the prompt history, including a long paste that the composer folds into a block. When fx can't open a browser, the waiting sign-in says it takes a pasted return. app_mcp_runtime.zig and mcp_host_menu_presentation.zig join the root test block, so their tests run in zig build test.
A return pasted after its sign-in ended went on as a prompt. fx now keeps the last sign-in that ended and answers such a paste with a notice. A return pasted twice says the sign-in is already finishing, and a paste that can't finish says why. The paste hint is defined once, in menu.zig.
fx keeps the last 8 sign-ins, including one another sign-in replaced, and sends a pasted return on only when its sign-in is the newest for its server, since the runtime keeps one login per server and an older return would fail the newer one. A paste job clears only its own sign-in's flag, and its failure notice says what went wrong. The paste job holds its own reference to the host sink, so the sink outlives destroyHost while a job still runs. The same sign-in posted again keeps its paste. fx-term.wasm's budget grows to 4,270,000 bytes for the new TUI code.
fazxes
marked this pull request as ready for review
November 24, 2026 22:26
main raised fx-term.wasm's budget to 4,276,000 for its own code. With both changes, fx-term.wasm measures 4,279,997 bytes after optimize, so the budget is 4,290,000.
This branch has not been deployed
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
/mcp loginin the TUI finishes a sign-in when you paste the address the browser ends on into the composer and press Enter, from a typed/mcp loginor the/mcpmenu. Before, onlyfx mcp logintook a pasted return, from its own stdin loop, which the TUI can't use because the composer owns the terminal. So a TUI sign-in from a sandbox or over SSH timed out./mcpserver screen./mcpcommands, becauseRuntime.finishLoginwaits on the host's owner thread. The job holds its own reference to the host sink, so the sink outlivesdestroyHostwhile the job runs.VerbJob, the paste job still uses the shell's MCP state while it runs, anddestroyHostwaits for it at most 5 s. Fixing that for both jobs is a separate change.fx-term.wasm's size budget grows to 4,290,000 bytes. The TUI code lands in it, and with main's own raise to 4,276,000 it measures 4,279,997 bytes.app_mcp_runtime.zigandmcp_host_menu_presentation.zigare now in the root test block. Their tests never ran inzig build testbefore.host_verbs, the counter the exit path waits on, polled with a 2 s deadline. The job has no other signal to wait on.Docs
fx.sh/docs/capabilities/mcp, the paragraph that starts "On a machine without a browser": replace it with