Skip to content

Commit 67483f1

Browse files
fix(explorer): support async sessionCwdOf for fs-events attach
1 parent 8e5b62d commit 67483f1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1440,20 +1440,20 @@ async function attachAgentList(
14401440
}
14411441

14421442
/** Subscribe an explorer socket to host fs.watch notifications for its cwd. */
1443-
function attachFsEvents(
1443+
async function attachFsEvents(
14441444
ctx: Context,
14451445
hub: FsWatchHub,
14461446
ws: WebSocket,
14471447
req: SidebarHttpRequest,
1448-
): void {
1448+
): Promise<void> {
14491449
try {
14501450
const url = new URL(req.url ?? '/', 'http://dsh.internal')
14511451
const sessionId = url.searchParams.get('sessionId')
14521452
if (sessionId === null) {
14531453
ws.close(1008, 'sessionId is required')
14541454
return
14551455
}
1456-
const cwd = sessionCwdOf(ctx, sessionId, url.searchParams.get('cwd') ?? undefined)
1456+
const cwd = await sessionCwdOf(ctx, sessionId, url.searchParams.get('cwd') ?? undefined)
14571457
ws.on('message', (data) => {
14581458
try {
14591459
const msg = JSON.parse(String(data)) as { type?: unknown; path?: unknown }

0 commit comments

Comments
 (0)