Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(mcp): preserve actionable device screenshot errors #24040

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

Showing 4 changed files with 118 additions and 2 deletions (loading 1).

x
0 of 4 viewed, 4 left
5 additions and 2 deletionsapps/server/src/device/DeviceHubOperations.tsModified
View file
@@ -7,7 +7,7 @@
import * as Duration from "effect/Duration";
import * as Effect from "effect/Effect";
import * as Schema from "effect/Schema";
-import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http";
+import { HttpClient, HttpClientError, HttpClientRequest, HttpClientResponse } from "effect/http";
​
import type { DeviceHostReady, DeviceOperations, HostDevice } from "./DeviceHost.ts";
​
@@ -236,7 +236,10 @@
(cause) =>
new DeviceOperationError({
operation: "screenshot",
- reason: "request_failed",
+ reason:
+ HttpClientError.isHttpClientError(cause) && cause.reason._tag === "StatusCodeError"
+ ? "hub_rejected"
+ : "request_failed",
cause,
}),
31 additions and 0 deletionsapps/server/src/device/DeviceService.test.tsModified
View file
@@ -39,6 +39,37 @@
const decodeBootError = Schema.decodeUnknownSync(Schema.fromJsonString(DeviceBootError));
const encodeBootError = Schema.encodeSync(Schema.fromJsonString(DeviceBootError));
​