Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): keep the preview host after an optional status timeout #14552

Closedmacodev00(GitHub profile, opens in a new tab)wants to merge 1 commit intomain fromrefs/pull/14552/headopened View on GitHub

Showing 4 changed files with 117 additions and 0 deletions (loading 1).

x
0 of 4 viewed, 4 left
4 additions and 0 deletionsapps/server/src/mcp/toolkits/preview/handlers.tsModified
View file
@@ -85,6 +85,10 @@
input: {},
timeoutMs: 500,
updateCurrentTab: false,
+ // The icon lookup is best-effort. Its 500ms deadline must not disconnect
+ // the only desktop host, or the next preview tool reports that no browser
+ // is available.
+ disconnectOnTimeout: false,
...(statusTabId === undefined ? {} : { tabId: statusTabId }),
})
.pipe(Effect.orElseSucceed(() => null));
66 additions and 0 deletionsapps/server/src/mcp/McpHttpServer.test.tsModified
View file
@@ -4,8 +4,10 @@
import { EnvironmentId, PreviewTabId, ProviderInstanceId, ThreadId } from "@t3tools/contracts";
import * as Deferred from "effect/Deferred";
import * as Effect from "effect/Effect";
+import * as Fiber from "effect/Fiber";
import * as FileSystem from "effect/FileSystem";
import * as Layer from "effect/Layer";
+import * as TestClock from "effect/testing/TestClock";
import * as Path from "effect/Path";
import * as Schema from "effect/Schema";
import * as Stream from "effect/Stream";
@@ -213,6 +215,70 @@
).pipe(Effect.provide(TestLayer)),