mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
fix: SSE MCP Invocation (#4251)
* only apply transport.start for stdio * instructions * formatting
This commit is contained in:
parent
c67356991e
commit
6423fc301c
1 changed files with 13 additions and 3 deletions
|
|
@ -598,13 +598,23 @@ export class McpHub {
|
|||
}
|
||||
await this.notifyWebviewOfServerChanges()
|
||||
}
|
||||
|
||||
transport.onclose = async () => {
|
||||
const connection = this.findConnection(name, source)
|
||||
if (connection) {
|
||||
connection.server.status = "disconnected"
|
||||
}
|
||||
await this.notifyWebviewOfServerChanges()
|
||||
}
|
||||
} else {
|
||||
// Correctly placed "unsupported type" else block
|
||||
// Should not happen if validateServerConfig is correct
|
||||
throw new Error(`Unsupported MCP server type: ${(configInjected as any).type}`)
|
||||
}
|
||||
// transport.start assignment moved after all type-specific initializations
|
||||
transport.start = async () => {} // No-op now, .connect() won't fail
|
||||
|
||||
// Only override transport.start for stdio transports that have already been started
|
||||
if (configInjected.type === "stdio") {
|
||||
transport.start = async () => {}
|
||||
}
|
||||
|
||||
const connection: McpConnection = {
|
||||
server: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue