stopMCPConfigWatcher tears down the hot-reload watcher. Safe to call when no watcher was ever started.
()
| 1764 | // stopMCPConfigWatcher tears down the hot-reload watcher. Safe to |
| 1765 | // call when no watcher was ever started. |
| 1766 | func (cli *ChatCLI) stopMCPConfigWatcher() { |
| 1767 | if cli.mcpWatcherDone != nil { |
| 1768 | select { |
| 1769 | case <-cli.mcpWatcherDone: |
| 1770 | default: |
| 1771 | close(cli.mcpWatcherDone) |
| 1772 | } |
| 1773 | } |
| 1774 | if cli.mcpWatcher != nil { |
| 1775 | _ = cli.mcpWatcher.Close() |
| 1776 | cli.mcpWatcher = nil |
| 1777 | } |
| 1778 | } |
| 1779 | |
| 1780 | func (cli *ChatCLI) cleanup(ctx context.Context) { |
| 1781 | // Teardown should not be aborted if the caller's context was already |