Skip to content

Commit 5de95e9

Browse files
authored
feat: allow users to set cwd (letta-ai#1480)
1 parent 8414403 commit 5de95e9

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

src/types/protocol_v2.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,8 @@ export interface TerminalSpawnCommand {
363363
terminal_id: string;
364364
cols: number;
365365
rows: number;
366+
/** Agent's current working directory. Falls back to bootWorkingDirectory if absent. */
367+
cwd?: string;
366368
}
367369

368370
export interface TerminalInputCommand {

src/websocket/listener/client.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,11 @@ async function connectWithRetry(
10181018

10191019
// ── Terminal commands (no runtime scope required) ──────────────────
10201020
if (parsed.type === "terminal_spawn") {
1021-
handleTerminalSpawn(parsed, socket, runtime.bootWorkingDirectory);
1021+
handleTerminalSpawn(
1022+
parsed,
1023+
socket,
1024+
parsed.cwd ?? runtime.bootWorkingDirectory,
1025+
);
10221026
return;
10231027
}
10241028

0 commit comments

Comments
 (0)