1574
return;
1575
}
1577
>
const chatUri = URI.parse(chat);
1578
>
1579
>
let failureStage: AgentHostTurnFailureStage = 'workingDirectory';
1580
>
try {
1581
>
// Host-owned working-directory resolution: resolve the session's working
1582
>
// directory before the agent materializes, so the agent runs in it
1583
>
// without ever knowing how it was derived. Returns the created worktree
1584
>
// for worktree sessions (created here on the first send) or the picked
1585
>
// folder for folder sessions; undefined for workspace-less sessions.
1586
>
const resolvedWorkingDirectory = await this._options.resolveWorkingDirectoryBeforeSend?.({ session: options.sessionChannel, chat, turnId, prompt: message.text });
1587
1588
const selectionUpdates: Promise<void>[] = [];