fix: focus dirty files before executing agentAcceptAllInFile command
This commit is contained in:
@@ -2148,10 +2148,29 @@ async function processResponseFile(filePath) {
|
||||
const cmd = isAccept
|
||||
? 'antigravity.prioritized.agentAcceptAllInFile'
|
||||
: 'antigravity.prioritized.agentRejectAllInFile';
|
||||
logToFile(`[RESPONSE] diff_review → executing VS Code command: ${cmd} (btnIdx=${btnIdx})`);
|
||||
logToFile(`[RESPONSE] diff_review → ${cmd} (btnIdx=${btnIdx})`);
|
||||
try {
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review command executed OK`);
|
||||
// Find dirty documents and focus each before executing
|
||||
const dirtyDocs = vscode.workspace.textDocuments.filter(d => d.isDirty);
|
||||
logToFile(`[RESPONSE] diff_review: ${dirtyDocs.length} dirty docs found`);
|
||||
if (dirtyDocs.length > 0) {
|
||||
for (const doc of dirtyDocs) {
|
||||
try {
|
||||
await vscode.window.showTextDocument(doc, { preview: false });
|
||||
await new Promise(r => setTimeout(r, 200)); // brief wait for focus
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review: ${cmd} on ${doc.fileName.split(/[\\/]/).pop()} OK`);
|
||||
}
|
||||
catch (perFileErr) {
|
||||
logToFile(`[RESPONSE] diff_review per-file error: ${perFileErr.message?.substring(0, 80)}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
// No dirty docs — try command anyway
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review: no dirty docs, command executed anyway`);
|
||||
}
|
||||
}
|
||||
catch (cmdErr) {
|
||||
logToFile(`[RESPONSE] diff_review command error: ${cmdErr.message}`);
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -2104,10 +2104,27 @@ async function processResponseFile(filePath: string) {
|
||||
const cmd = isAccept
|
||||
? 'antigravity.prioritized.agentAcceptAllInFile'
|
||||
: 'antigravity.prioritized.agentRejectAllInFile';
|
||||
logToFile(`[RESPONSE] diff_review → executing VS Code command: ${cmd} (btnIdx=${btnIdx})`);
|
||||
logToFile(`[RESPONSE] diff_review → ${cmd} (btnIdx=${btnIdx})`);
|
||||
try {
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review command executed OK`);
|
||||
// Find dirty documents and focus each before executing
|
||||
const dirtyDocs = vscode.workspace.textDocuments.filter(d => d.isDirty);
|
||||
logToFile(`[RESPONSE] diff_review: ${dirtyDocs.length} dirty docs found`);
|
||||
if (dirtyDocs.length > 0) {
|
||||
for (const doc of dirtyDocs) {
|
||||
try {
|
||||
await vscode.window.showTextDocument(doc, { preview: false });
|
||||
await new Promise(r => setTimeout(r, 200)); // brief wait for focus
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review: ${cmd} on ${doc.fileName.split(/[\\/]/).pop()} OK`);
|
||||
} catch (perFileErr: any) {
|
||||
logToFile(`[RESPONSE] diff_review per-file error: ${perFileErr.message?.substring(0, 80)}`);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
// No dirty docs — try command anyway
|
||||
await vscode.commands.executeCommand(cmd);
|
||||
logToFile(`[RESPONSE] diff_review: no dirty docs, command executed anyway`);
|
||||
}
|
||||
} catch (cmdErr: any) {
|
||||
logToFile(`[RESPONSE] diff_review command error: ${cmdErr.message}`);
|
||||
}
|
||||
|
||||
@@ -8,3 +8,4 @@
|
||||
- 3차 수정: step_type 패스스루 검증 테스트 (15:18)
|
||||
- 4차 수정: ApprovalRequest + 단일 봇 인스턴스 테스트 (15:21)
|
||||
- 5차 수정: 진단 로그 추가 — step_type 확인 (15:25)
|
||||
- 6차 수정: 기본 콜백 step_type 최종 테스트 (15:31)
|
||||
|
||||
Reference in New Issue
Block a user