Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): refresh MCP clients when reusing a provider session #18884

ClosedAlb11747(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/18884/headopened View on GitHub

Showing 6 changed files with 34 additions and 15 deletions (loading 3).

x
0 of 6 viewed, 6 left
26 additions and 7 deletionsapps/server/src/orchestration-v2/Adapters/OpenCode2AdapterV2.test.tsModified
View file
@@ -833,6 +833,11 @@
// The subagent still runs, so the session is not idle and the next Stop reaches it.
assert.isTrue(yield* runtime.hasPendingBackgroundWork!);
assert.isTrue(yield* runtime.hasPendingBackgroundWorkForThread!(thread));
+ assert.equal(
+ (yield* runtime.unloadThread!({ providerThread: thread }).pipe(Effect.flip))._tag,
+ "ProviderAdapterProtocolError",
+ );
+ assert.isTrue(yield* runtime.hasPendingBackgroundWorkForThread!(thread));
}).pipe(Effect.scoped),
​
@@ -3400,7 +3405,7 @@
it.effect(
- "registers T3's MCP server for the thread alone and removes it when the thread unloads",
+ "registers T3's MCP server for the thread alone, retains it when unload is declined, and removes it after work stops",
() =>
Effect.gen(function* () {
const mcpSessions = yield* McpProviderSessions.McpProviderSessions;
@@ -3429,15 +3434,29 @@
reply("mcp.add", null),
- out("session.prompt", { sessionID: SESSION, text: "<any>" }),
- promptAccepted,
- event("session.execution.succeeded", { sessionID: SESSION }),