feat(skill-mcp-manager): enhance manager with improved test coverage

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-02-01 19:01:40 +09:00
parent 09e738c989
commit c73314f643
3 changed files with 65 additions and 5 deletions
@@ -395,6 +395,35 @@ describe("SkillMcpManager", () => {
// then
expect(manager.getConnectedServers()).toEqual([])
})
it("unregisters signal handlers after disconnectAll", async () => {
// given
const info: SkillMcpClientInfo = {
serverName: "signal-server",
skillName: "signal-skill",
sessionID: "session-1",
}
const config: ClaudeCodeMcpServer = {
url: "https://example.com/mcp",
}
const before = process.listenerCount("SIGINT")
// when
try {
await manager.getOrCreateClient(info, config)
} catch {
// Expected to fail connection, still registers cleanup handlers
}
const afterRegister = process.listenerCount("SIGINT")
await manager.disconnectAll()
const afterDisconnect = process.listenerCount("SIGINT")
// then
expect(afterRegister).toBe(before + 1)
expect(afterDisconnect).toBe(before)
})
})
describe("isConnected", () => {