GeezerVison is showing github.com — fix(server): skip host lookup when device tools omit it · pingdotgg/t3code@2a4e795
File tree
Expand file treeCollapse file tree
Open diff view settings
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/server/src/mcp/McpHttpServer.test.ts +1-1Lines changed: 1 addition & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -146,7 +146,7 @@ const callSnapshot = (args: Record<string, unknown>) => callTool("preview_snapsh |
146 | 146 | it.effect.each([ |
147 | 147 | { input: {}, open: false, message: "No device is open in this thread. Call device_open first." }, |
148 | 148 | { |
149 | | - input: { deviceId: "missing", hostId: "local" }, |
| 149 | + input: { deviceId: "missing" }, |
150 | 150 | open: false, |
151 | 151 | message: "Device missing is not open in this thread. Call device_open first.", |
152 | 152 | }, |
|
Collapse file
Copy file name to clipboardExpand all lines: apps/server/src/mcp/toolkits/device/handlers.ts +8-2Lines changed: 8 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -297,7 +297,10 @@ const handlers = { |
297 | 297 | const scope = yield* requireDeviceAccess; |
298 | 298 | const devices = yield* DeviceService.DeviceService; |
299 | 299 | const threadId = scope.thread.threadId; |
300 | | - const hostId = yield* resolveHostId((yield* devices.state).hosts, input.hostId); |
| 300 | + const hostId = |
| 301 | + input.hostId === undefined |
| 302 | + ? undefined |
| 303 | + : yield* resolveHostId((yield* devices.state).hosts, input.hostId); |
301 | 304 | const target = |
302 | 305 | input.deviceId === undefined |
303 | 306 | ? (yield* devices.sessionsForThread(threadId)).findLast( |
@@ -332,7 +335,10 @@ const handlers = { |
332 | 335 | const scope = yield* requireDeviceAccess; |
333 | 336 | const devices = yield* DeviceService.DeviceService; |
334 | 337 | const deviceId = input.deviceId; |
335 | | - const inputHostId = yield* resolveHostId((yield* devices.state).hosts, input.hostId); |
| 338 | + const inputHostId = |
| 339 | + input.hostId === undefined |
| 340 | + ? undefined |
| 341 | + : yield* resolveHostId((yield* devices.state).hosts, input.hostId); |
336 | 342 | const open = |
337 | 343 | deviceId === undefined |
338 | 344 | ? Option.none() |
|