@@ -2745,13 +2745,9 @@ const gatedServer = Effect.gen(function* () {
27452745} )
27462746
27472747// The real Mcp layer behind the tool registry; the bus never delivers, so only flush can register tools.
2748- const startupRegistry = ( url : string , timeout ?: ConfigMCP . Timeout ) =>
2748+ const startupRegistry = ( url : string ) =>
27492749 AppNodeBuilder . build ( LayerNode . group ( [ Mcp . node , Tool . node , McpTool . node ] ) , [
2750- Mcp . node . replace (
2751- resourceMcpLayer (
2752- new ConfigMCP . Remote ( { type : "remote" , url, oauth : false , codemode : false , ...( timeout ? { timeout } : { } ) } ) ,
2753- ) ,
2754- ) ,
2750+ Mcp . node . replace ( resourceMcpLayer ( new ConfigMCP . Remote ( { type : "remote" , url, oauth : false , codemode : false } ) ) ) ,
27552751 Permission . node . replace ( permissions ) ,
27562752 Bus . node . replace ( events ) ,
27572753 Image . node . replace ( imagePassthrough ) ,
@@ -2779,7 +2775,7 @@ testEffect(Layer.empty).effect("flush waits for a server that connects within it
27792775 } ) ,
27802776)
27812777
2782- testEffect ( Layer . empty ) . effect ( "flush stops waiting for a hung server when the default startup window ends" , ( ) =>
2778+ testEffect ( Layer . empty ) . effect ( "flush stops waiting for a hung server when its startup window ends" , ( ) =>
27832779 Effect . gen ( function * ( ) {
27842780 const gated = yield * gatedServer
27852781 yield * Effect . gen ( function * ( ) {
@@ -2803,28 +2799,6 @@ testEffect(Layer.empty).effect("flush stops waiting for a hung server when the d
28032799 } ) ,
28042800)
28052801
2806- testEffect ( Layer . empty ) . effect ( "flush waits as long as a server's own startup timeout" , ( ) =>
2807- Effect . gen ( function * ( ) {
2808- const gated = yield * gatedServer
2809- yield * Effect . gen ( function * ( ) {
2810- const registry = yield * Tool . Service
2811- const registration = yield * McpTool . Service
2812- yield * Deferred . await ( gated . started )
2813- const flush = yield * registration . flush . pipe ( Effect . forkChild ( { startImmediately : true } ) )
2814- // Well past the default window, which would have dropped a server that is still handshaking.
2815- yield * TestClock . adjust ( "3500 millis" )
2816- expect ( flush . pollUnsafe ( ) ) . toBeUndefined ( )
2817-
2818- yield * Deferred . succeed ( gated . release , undefined )
2819- yield * Fiber . join ( flush )
2820- expect ( ( yield * toolDefinitions ( registry ) ) . map ( ( tool ) => tool . name ) ) . toContain ( "resources_echo" )
2821- } ) . pipe (
2822- Effect . ensuring ( Deferred . succeed ( gated . release , undefined ) ) ,
2823- Effect . provide ( startupRegistry ( gated . server . url , new ConfigMCP . Timeout ( { startup : 10_000 } ) ) ) ,
2824- )
2825- } ) ,
2826- )
2827-
28282802it . effect ( "advertises MCP output schemas to Code Mode" , ( ) =>
28292803 Effect . gen ( function * ( ) {
28302804 const registry = yield * Tool . Service
0 commit comments