Skip to content

implement TUI restart capability via MCP tool and CLI flag#546

Merged
JeremyDev87 merged 1 commit intomasterfrom
feat/tui-restart-capability
Feb 18, 2026
Merged

implement TUI restart capability via MCP tool and CLI flag#546
JeremyDev87 merged 1 commit intomasterfrom
feat/tui-restart-capability

Conversation

@JeremyDev87
Copy link
Owner

Summary

Closes #545

Adds TUI restart capability through two entry points that share a single restart function:

  • restart_tui MCP tool — AI agents can call this tool when the TUI becomes unresponsive or shows a blank screen
  • codingbuddy tui --restart CLI flag — users can restart the TUI directly from the terminal

Changes

New Files

  • cli/restart-tui.ts — shared restart logic: kills existing TUI client via pkill, prunes stale registry entries, validates a live MCP server instance exists, then spawns a fresh TUI client
  • cli/restart-tui.spec.ts — unit tests for restartTui()
  • mcp/handlers/tui.handler.tsTuiHandler implementing restart_tui MCP tool using AbstractHandler pattern
  • mcp/handlers/tui.handler.spec.ts — unit tests for TuiHandler

Modified Files

  • mcp/handlers/index.ts — export TuiHandler
  • mcp/mcp.module.ts — register TuiHandler as NestJS provider
  • cli/cli.types.ts — add TuiOptions interface with restart: boolean
  • cli/cli.ts — parse --restart flag in tui command, pass to runTui()
  • cli/run-tui.ts — handle restart option: call restartTui() and print success/failure to stderr
  • cli/cli.spec.ts — tests for tui and tui --restart flag parsing
  • cli/run-tui.spec.ts — tests for restart flow in runTui()

Test Plan

  • All 167 test files pass (3,859 tests)
  • restartTui() returns error when no MCP server instances found
  • restartTui() kills existing TUI client via pkill before relaunching
  • restartTui() prunes registry before relaunching
  • restart_tui MCP tool returns { success, reason, pid } on success
  • restart_tui MCP tool returns isError: true when restart fails or throws
  • codingbuddy tui --restart calls restartTui() and prints result to stderr
  • codingbuddy tui (without --restart) behavior unchanged
  • restart_tui appears in list_tools output

…#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
@vercel
Copy link

vercel bot commented Feb 18, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
codingbuddy-landing Ready Ready Preview, Comment Feb 18, 2026 11:51am

@JeremyDev87 JeremyDev87 self-assigned this Feb 18, 2026
@JeremyDev87 JeremyDev87 added feat tui TUI Agent Monitor labels Feb 18, 2026
@JeremyDev87 JeremyDev87 changed the title feat(tui): implement TUI restart capability via MCP tool and CLI flag implement TUI restart capability via MCP tool and CLI flag Feb 18, 2026
@JeremyDev87 JeremyDev87 merged commit bd30b67 into master Feb 18, 2026
25 checks passed
@JeremyDev87 JeremyDev87 deleted the feat/tui-restart-capability branch February 18, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat tui TUI Agent Monitor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(tui): Add TUI restart/reset capability via MCP tool and CLI flag

1 participant