fix(coding-agent): preserved bash status while syncing cwd
Propagated the native shell working directory in ShellRunResult so AgentSession can refresh cwd without running a hidden pwd command in the persistent shell. Added regression coverage for cd plus a failing command followed by echo $?, proving cwd sync no longer overwrites the user's last shell status. Fixes #3958
This commit is contained in:
@@ -51,6 +51,7 @@ export interface BashResult {
|
||||
outputLines: number;
|
||||
outputBytes: number;
|
||||
artifactId?: string;
|
||||
workingDir?: string;
|
||||
}
|
||||
|
||||
const shellSessions = new Map<string, Shell>();
|
||||
@@ -429,6 +430,7 @@ export async function executeBash(command: string, options?: BashExecutorOptions
|
||||
return {
|
||||
exitCode: winner.result.exitCode,
|
||||
cancelled: false,
|
||||
workingDir: winner.result.workingDir,
|
||||
...(await sink.dump()),
|
||||
};
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user