implement TUI restart capability via MCP tool and CLI flag#546
Merged
JeremyDev87 merged 1 commit intomasterfrom Feb 18, 2026
Merged
implement TUI restart capability via MCP tool and CLI flag#546JeremyDev87 merged 1 commit intomasterfrom
JeremyDev87 merged 1 commit intomasterfrom
Conversation
…#545) - Add shared restartTui() logic in restart-tui.ts (pkill + registry prune + relaunch) - Add TuiHandler with restart_tui MCP tool that terminates unresponsive TUI and spawns fresh client - Register TuiHandler in McpModule and export from handlers/index.ts - Add --restart flag to CLI tui command (cli.types.ts TuiOptions, parseArgs update) - Wire restart flag through runTui() with success/failure stderr output - Add unit tests for all new modules and updated flows
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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
Closes #545
Adds TUI restart capability through two entry points that share a single restart function:
restart_tuiMCP tool — AI agents can call this tool when the TUI becomes unresponsive or shows a blank screencodingbuddy tui --restartCLI flag — users can restart the TUI directly from the terminalChanges
New Files
cli/restart-tui.ts— shared restart logic: kills existing TUI client viapkill, prunes stale registry entries, validates a live MCP server instance exists, then spawns a fresh TUI clientcli/restart-tui.spec.ts— unit tests forrestartTui()mcp/handlers/tui.handler.ts—TuiHandlerimplementingrestart_tuiMCP tool usingAbstractHandlerpatternmcp/handlers/tui.handler.spec.ts— unit tests forTuiHandlerModified Files
mcp/handlers/index.ts— exportTuiHandlermcp/mcp.module.ts— registerTuiHandleras NestJS providercli/cli.types.ts— addTuiOptionsinterface withrestart: booleancli/cli.ts— parse--restartflag intuicommand, pass torunTui()cli/run-tui.ts— handlerestartoption: callrestartTui()and print success/failure to stderrcli/cli.spec.ts— tests fortuiandtui --restartflag parsingcli/run-tui.spec.ts— tests for restart flow inrunTui()Test Plan
restartTui()returns error when no MCP server instances foundrestartTui()kills existing TUI client viapkillbefore relaunchingrestartTui()prunes registry before relaunchingrestart_tuiMCP tool returns{ success, reason, pid }on successrestart_tuiMCP tool returnsisError: truewhen restart fails or throwscodingbuddy tui --restartcallsrestartTui()and prints result to stderrcodingbuddy tui(without--restart) behavior unchangedrestart_tuiappears inlist_toolsoutput