91
92
getPreConfirmAction(ref: ILanguageModelToolConfirmationRef): ConfirmedReason | undefined {
94
>
if (!pathInfo) {
95
return undefined;
96
}
98
>
// Parse the file path to a URI
99
>
let pathUri: URI;
100
>
try {
101
>
pathUri = URI.file(pathInfo.path);
102
>
} catch {
103
return undefined;
104
}
106
>
// When a working directory is set (agents window), it is the source of truth
107
>
// for determining whether a path is workspace-internal. Only fall back to the
108
>
// workspace-level allowlist when no working directory is specified.
109
>
if (ref.workingDirectory) {
110
if (extUriBiasedIgnorePathCase.isEqualOrParent(pathUri, ref.workingDirectory)) {
111
return { type: ToolConfirmKind.UserAction };
112
}
114
const workspaceFolders = this._getWorkspaceFolders();
115
for (const folderUri of workspaceFolders) {