fix(skill-mcp-manager): drop superseded stale clients

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

Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
YeonGyu-Kim
2026-03-12 02:24:29 +09:00
parent 7997606892
commit cbb378265e
2 changed files with 19 additions and 0 deletions
@@ -42,6 +42,7 @@ export async function getOrCreateClient(params: {
const isStale = state.pendingConnections.has(clientKey) && state.pendingConnections.get(clientKey) !== currentConnectionPromise
if (isStale) {
state.clients.delete(clientKey)
try { await client.close() } catch {}
throw new Error(`Connection for "${info.sessionID}" was superseded by a newer connection attempt.`)
}