feat: allow users to set cwd (#1480)

This commit is contained in:
Shubham Naik
2026-03-20 20:15:17 -07:00
committed by GitHub
parent 8414403ce0
commit 5de95e92e3
2 changed files with 7 additions and 1 deletions

View File

@@ -363,6 +363,8 @@ export interface TerminalSpawnCommand {
terminal_id: string; terminal_id: string;
cols: number; cols: number;
rows: number; rows: number;
/** Agent's current working directory. Falls back to bootWorkingDirectory if absent. */
cwd?: string;
} }
export interface TerminalInputCommand { export interface TerminalInputCommand {

View File

@@ -1018,7 +1018,11 @@ async function connectWithRetry(
// ── Terminal commands (no runtime scope required) ────────────────── // ── Terminal commands (no runtime scope required) ──────────────────
if (parsed.type === "terminal_spawn") { if (parsed.type === "terminal_spawn") {
handleTerminalSpawn(parsed, socket, runtime.bootWorkingDirectory); handleTerminalSpawn(
parsed,
socket,
parsed.cwd ?? runtime.bootWorkingDirectory,
);
return; return;
} }