fix(extension): acknowledgeCodeActionStep RPC discovery + v0.3.14 3-tier strategy
This commit is contained in:
@@ -569,8 +569,18 @@
|
|||||||
- **해결**: `diffReviewMetadata` 인메모리 Map 추가 (extension.ts L57). `writePendingApproval`에서 diff_review pending 생성 시 `edit_step_indices` + `modified_files`를 메모리에 캐시. `processResponseFile`에서 메모리 먼저 조회, pending 파일은 fallback
|
- **해결**: `diffReviewMetadata` 인메모리 Map 추가 (extension.ts L57). `writePendingApproval`에서 diff_review pending 생성 시 `edit_step_indices` + `modified_files`를 메모리에 캐시. `processResponseFile`에서 메모리 먼저 조회, pending 파일은 fallback
|
||||||
- **주의**: 인메모리 캐시는 Extension Reload 시 소실됨. 그러나 diff_review pending 자체가 RUNNING→IDLE 전환 시 새로 생성되므로, 리로드 후에도 새 diff_review는 정상 동작. `bridge.py write_response()` L461의 pending 삭제도 동일 문제를 유발하지만 remote 모드에서는 Collector 경로만 해당
|
- **주의**: 인메모리 캐시는 Extension Reload 시 소실됨. 그러나 diff_review pending 자체가 RUNNING→IDLE 전환 시 새로 생성되므로, 리로드 후에도 새 diff_review는 정상 동작. `bridge.py write_response()` L461의 pending 삭제도 동일 문제를 유발하지만 remote 모드에서는 Collector 경로만 해당
|
||||||
|
|
||||||
### [2026-03-16] AcknowledgeCascadeCodeEdit SUCCESS → diff review bar 미해제 — 파라미터 형식 미스매치
|
### [2026-03-16] AcknowledgeCascadeCodeEdit SUCCESS → diff review bar 미해제 — **잘못된 RPC 메서드명**
|
||||||
- **증상**: `AcknowledgeCascadeCodeEdit(session=xxx, accept=true, steps=[40])` → `SUCCESS: {}` 반환 → AG diff review bar 여전히 표시됨
|
- **증상**: `AcknowledgeCascadeCodeEdit(session=xxx, accept=true, steps=[40])` → `SUCCESS: {}` 반환 → AG diff review bar 여전히 표시됨
|
||||||
- **원인**: RPC가 unknown field를 무시하고 빈 응답(`{}`) 반환하는 구조로 추정. `stepIndices`가 AG가 기대하는 필드명이 아니거나, step index 값이 AG 내부 인덱스와 다를 수 있음. 4가지 가설: (1) `stepIndices` 대신 `steps`, (2) stepIndices 없이 전체 accept, (3) `trajectoryId` 필요, (4) step index가 0-based vs offset 차이
|
- **원인**: **RPC 메서드명 자체가 틀렸음.** AG 내부 LS 메서드는 `AcknowledgeCascadeCodeEdit`가 아닌 **`acknowledgeCodeActionStep`**(proto ID 167). AG 소스 역분석으로 확인 — `jetskiAgent/main.js`에서 `acknowledgeCodeActionStep:async K=>{e&&await e.acknowledgeCodeActionStep(ur(vKa,K))}` 발견. Accept all 버튼 클릭 체인: `fireEvent({type:"accept-all-in-file"})` → `submitCodeAcknowledgement` 커맨드 → `acknowledgeCodeActionStep` LS RPC. `AcknowledgeCascadeCodeEdit`는 proto unknown field 무시로 `{}` 반환 (에러도 아닌 no-op)
|
||||||
- **해결**: (미완료) Extension에 4가지 파라미터 형식(A/B/C/D) 실험 코드 배포. AG 재시작 후 diff_review 트리거 시 각 형식의 결과를 extension.log에서 비교하여 올바른 형식 도출
|
- **해결**: v0.3.14에서 3단계 전략으로 변경: (1) `submitCodeAcknowledgement` VS Code 커맨드 (AG UI와 동일 경로), (2) `acknowledgeCodeActionStep` rawRPC, (3) `AcknowledgeCascadeCodeEdit` 레거시 폴백
|
||||||
- **주의**: RPC SUCCESS `{}`는 "파라미터가 맞지 않아 아무것도 안 함"과 "성공적으로 처리함"을 구분 불가. 에러가 아닌 빈 응답은 proto의 unknown field 무시 동작일 수 있음
|
- **주의**: AG의 RPC는 잘못된 메서드명도 에러 없이 `{}` 반환함. proto unknown field 동작으로 인해 디버깅이 매우 어려움. **반드시 AG 소스(`jetskiAgent/main.js`, `workbench.desktop.main.js`)에서 실제 메서드명을 확인** 후 사용할 것
|
||||||
|
|
||||||
|
### [2026-03-16] AG 소스 역분석 — diff review 내부 동작 체인
|
||||||
|
- **증상**: Accept all / Reject all 버튼의 내부 동작을 Extension에서 프로그래밍 방식으로 재현해야 함
|
||||||
|
- **원인**: AG 공식 API/문서 없음. VS Code 커맨드 중 많은 것이 미등록 상태
|
||||||
|
- **해결**: AG 설치 경로의 JS 소스에서 직접 역분석. 핵심 발견:
|
||||||
|
- **LS 메서드**: `acknowledgeCodeActionStep` (proto ID 167, 메시지 타입 `vKa`/`QLc`)
|
||||||
|
- **VS Code 커맨드**: `antigravity.prioritized.submitCodeAcknowledgement` (SUBMIT_CODE_ACKNOWLEDGEMENT)
|
||||||
|
- **Accept all 체인**: UI 클릭 → `fireEvent({type:"accept-all-in-file", uri: currentFile})` → `submitCodeAcknowledgement` → `acknowledgeCodeActionStep`
|
||||||
|
- **파일 위치**: `%LOCALAPPDATA%\Programs\Antigravity\resources\app\out\jetskiAgent\main.js` (LS 메서드 정의), `vs\workbench\workbench.desktop.main.js` (UI 커맨드 + 핸들러)
|
||||||
|
- **주의**: Python `re.finditer`로 대용량 JS 검색 시 PowerShell `IndexOf`보다 안정적. minified JS에서 변수명(`vKa`, `QLc` 등)은 버전마다 변경됨
|
||||||
|
|||||||
@@ -5,3 +5,4 @@
|
|||||||
| 001 | 07:30~11:10 | 승인 상태 관리 근본 원인 분석 + v0.3.12 수정 (sawRunningAfterPending gate) + approval-flow.md 시스템 Flow 문서 + known-issues 2건 추가 | `2d9fe96` | ✅ |
|
| 001 | 07:30~11:10 | 승인 상태 관리 근본 원인 분석 + v0.3.12 수정 (sawRunningAfterPending gate) + approval-flow.md 시스템 Flow 문서 + known-issues 2건 추가 | `2d9fe96` | ✅ |
|
||||||
| 002 | 13:25~14:20 | diff_review 핸들러 2-strategy 리팩토링 + 배포 불일치 발견/수정 + pending 순서 8초 지연 + 1차 테스트 (버튼 OK, RPC 미배포→재배포) + known-issues 2건 | `f302984` | ✅ |
|
| 002 | 13:25~14:20 | diff_review 핸들러 2-strategy 리팩토링 + 배포 불일치 발견/수정 + pending 순서 8초 지연 + 1차 테스트 (버튼 OK, RPC 미배포→재배포) + known-issues 2건 | `f302984` | ✅ |
|
||||||
| 003 | 15:18~16:55 | diff_review steps=[] 근본 원인 분석 + 인메모리 캐시 (v0.3.13) + 3차 E2E (RPC SUCCESS but no-op) + 4가지 파라미터 실험 배포 | `00b9491` | 🔧 |
|
| 003 | 15:18~16:55 | diff_review steps=[] 근본 원인 분석 + 인메모리 캐시 (v0.3.13) + 3차 E2E (RPC SUCCESS but no-op) + 4가지 파라미터 실험 배포 | `00b9491` | 🔧 |
|
||||||
|
| 004 | 17:05~18:00 | AG 소스 역분석 — `AcknowledgeCascadeCodeEdit`→`acknowledgeCodeActionStep` 메서드명 오류 발견 + v0.3.14 3단계 전략 배포 + known-issues 2건 업데이트 | `08c2c86` | 🔧 |
|
||||||
|
|||||||
@@ -2626,8 +2626,10 @@ async function processResponseFile(filePath) {
|
|||||||
let diffReviewDone = false;
|
let diffReviewDone = false;
|
||||||
const targetSession = sessionId || activeSessionId;
|
const targetSession = sessionId || activeSessionId;
|
||||||
let modifiedFiles = []; // shared between Strategy 1 and 2
|
let modifiedFiles = []; // shared between Strategy 1 and 2
|
||||||
// ── Strategy 1: AcknowledgeCascadeCodeEdit RPC ──
|
// ── Strategy 1: acknowledgeCodeActionStep RPC (correct AG LS method) ──
|
||||||
// Accept/reject all pending code edits via protocol (no UI interaction needed)
|
// Discovered via AG source reverse-engineering: the internal LS method is
|
||||||
|
// `acknowledgeCodeActionStep` (proto ID 167), NOT `AcknowledgeCascadeCodeEdit`.
|
||||||
|
// Accept all button → fireEvent({type:"accept-all-in-file"}) → submitCodeAcknowledgement → acknowledgeCodeActionStep
|
||||||
if (sdk) {
|
if (sdk) {
|
||||||
try {
|
try {
|
||||||
// Get tracked step indices from in-memory cache FIRST (pending file may be deleted by Collector)
|
// Get tracked step indices from in-memory cache FIRST (pending file may be deleted by Collector)
|
||||||
@@ -2658,62 +2660,49 @@ async function processResponseFile(filePath) {
|
|||||||
if (trackedSteps.length === 0 && pendingStepIndex > 0) {
|
if (trackedSteps.length === 0 && pendingStepIndex > 0) {
|
||||||
trackedSteps.push(pendingStepIndex);
|
trackedSteps.push(pendingStepIndex);
|
||||||
}
|
}
|
||||||
logToFile(`[DIFF-REVIEW-RPC] AcknowledgeCascadeCodeEdit(session=${targetSession.substring(0, 8)}, accept=${isAccept}, steps=[${trackedSteps.join(',')}])`);
|
logToFile(`[DIFF-REVIEW-RPC] acknowledgeCodeActionStep(session=${targetSession.substring(0, 8)}, accept=${isAccept}, steps=[${trackedSteps.join(',')}])`);
|
||||||
// ── EXPERIMENT: Try multiple parameter formats to find what AG expects ──
|
// Strategy 1a: VS Code command (most reliable — same path as UI button)
|
||||||
// Format A: with stepIndices (current approach)
|
|
||||||
try {
|
try {
|
||||||
const ackA = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
await vscode.commands.executeCommand('antigravity.prioritized.submitCodeAcknowledgement');
|
||||||
cascadeId: targetSession,
|
logToFile(`[DIFF-REVIEW-RPC] ✅ submitCodeAcknowledgement command OK`);
|
||||||
accept: isAccept,
|
diffReviewDone = true;
|
||||||
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
|
||||||
});
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format A (stepIndices=[${trackedSteps.join(',')}]): ${JSON.stringify(ackA).substring(0, 300)}`);
|
|
||||||
}
|
}
|
||||||
catch (eA) {
|
catch (cmdErr) {
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format A ERROR: ${eA.message.substring(0, 200)}`);
|
logToFile(`[DIFF-REVIEW-RPC] submitCodeAcknowledgement command error: ${cmdErr.message?.substring(0, 200)}`);
|
||||||
}
|
}
|
||||||
// Format B: WITHOUT stepIndices (accept all pending)
|
// Strategy 1b: Direct LS RPC with correct method name
|
||||||
try {
|
if (!diffReviewDone) {
|
||||||
const ackB = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
try {
|
||||||
cascadeId: targetSession,
|
const ackResult = await sdk.ls.rawRPC('acknowledgeCodeActionStep', {
|
||||||
accept: isAccept,
|
cascadeId: targetSession,
|
||||||
});
|
accept: isAccept,
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format B (no stepIndices): ${JSON.stringify(ackB).substring(0, 300)}`);
|
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
||||||
|
});
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] ✅ acknowledgeCodeActionStep: ${JSON.stringify(ackResult).substring(0, 300)}`);
|
||||||
|
diffReviewDone = true;
|
||||||
|
}
|
||||||
|
catch (rpcErr1) {
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] acknowledgeCodeActionStep error: ${rpcErr1.message?.substring(0, 200)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
catch (eB) {
|
// Strategy 1c: Legacy method name (fallback)
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format B ERROR: ${eB.message.substring(0, 200)}`);
|
if (!diffReviewDone) {
|
||||||
|
try {
|
||||||
|
const ackLegacy = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
||||||
|
cascadeId: targetSession,
|
||||||
|
accept: isAccept,
|
||||||
|
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
||||||
|
});
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] ✅ AcknowledgeCascadeCodeEdit (legacy): ${JSON.stringify(ackLegacy).substring(0, 300)}`);
|
||||||
|
diffReviewDone = true;
|
||||||
|
}
|
||||||
|
catch (rpcErr2) {
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] AcknowledgeCascadeCodeEdit (legacy) error: ${rpcErr2.message?.substring(0, 200)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// Format C: with 'steps' key instead of 'stepIndices'
|
|
||||||
try {
|
|
||||||
const ackC = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
|
||||||
cascadeId: targetSession,
|
|
||||||
accept: isAccept,
|
|
||||||
steps: trackedSteps,
|
|
||||||
});
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format C (steps=[${trackedSteps.join(',')}]): ${JSON.stringify(ackC).substring(0, 300)}`);
|
|
||||||
}
|
|
||||||
catch (eC) {
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format C ERROR: ${eC.message.substring(0, 200)}`);
|
|
||||||
}
|
|
||||||
// Format D: with trajectoryId added
|
|
||||||
try {
|
|
||||||
const trajId = activeTrajectoryId || '';
|
|
||||||
const ackD = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
|
||||||
cascadeId: targetSession,
|
|
||||||
trajectoryId: trajId,
|
|
||||||
accept: isAccept,
|
|
||||||
stepIndices: trackedSteps,
|
|
||||||
});
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format D (with trajectoryId): ${JSON.stringify(ackD).substring(0, 300)}`);
|
|
||||||
}
|
|
||||||
catch (eD) {
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format D ERROR: ${eD.message.substring(0, 200)}`);
|
|
||||||
}
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] ✅ All experiments completed`);
|
|
||||||
diffReviewDone = true;
|
|
||||||
}
|
}
|
||||||
catch (rpcErr) {
|
catch (outerErr) {
|
||||||
logToFile(`[DIFF-REVIEW-RPC] ❌ ${rpcErr.message.substring(0, 200)}`);
|
logToFile(`[DIFF-REVIEW-RPC] ❌ outer error: ${outerErr.message?.substring(0, 200)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// ── Strategy 2: Open review panel + focus file + VS Code command ──
|
// ── Strategy 2: Open review panel + focus file + VS Code command ──
|
||||||
@@ -3093,16 +3082,27 @@ async function tryApprovalStrategies(approved, sessionId, stepType = '', stepInd
|
|||||||
const typeLower = stepType.toLowerCase().replace('cortex_step_type_', '');
|
const typeLower = stepType.toLowerCase().replace('cortex_step_type_', '');
|
||||||
let interactionPayload = {};
|
let interactionPayload = {};
|
||||||
if (typeLower.includes('code_edit') || typeLower.includes('write_to_file') || typeLower.includes('propose_code') || typeLower.includes('write_cascade_edit')) {
|
if (typeLower.includes('code_edit') || typeLower.includes('write_to_file') || typeLower.includes('propose_code') || typeLower.includes('write_cascade_edit')) {
|
||||||
// CODE EDIT: Uses separate AcknowledgeCascadeCodeEdit RPC
|
// CODE EDIT: Uses acknowledgeCodeActionStep RPC (correct AG LS method)
|
||||||
|
// Try VS Code command first (same path as UI Accept all button)
|
||||||
try {
|
try {
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] AcknowledgeCascadeCodeEdit(cascadeId=${sessionId.substring(0, 8)}, accept=${approved}, stepIndices=[${effectiveStepIndex}])`);
|
logToFile(`[APPROVAL-CODE-EDIT] trying submitCodeAcknowledgement command`);
|
||||||
const ackResult = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
await vscode.commands.executeCommand('antigravity.prioritized.submitCodeAcknowledgement');
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] ✅ submitCodeAcknowledgement OK`);
|
||||||
|
return `CMD:submitCodeAcknowledgement(accept=${approved})`;
|
||||||
|
}
|
||||||
|
catch {
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] submitCodeAcknowledgement not available, trying RPC`);
|
||||||
|
}
|
||||||
|
// Direct LS RPC with correct method name
|
||||||
|
try {
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] acknowledgeCodeActionStep(cascadeId=${sessionId.substring(0, 8)}, accept=${approved}, stepIndices=[${effectiveStepIndex}])`);
|
||||||
|
const ackResult = await sdk.ls.rawRPC('acknowledgeCodeActionStep', {
|
||||||
cascadeId: sessionId,
|
cascadeId: sessionId,
|
||||||
accept: approved,
|
accept: approved,
|
||||||
stepIndices: [effectiveStepIndex],
|
stepIndices: [effectiveStepIndex],
|
||||||
});
|
});
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] ✅ SUCCESS: ${JSON.stringify(ackResult).substring(0, 200)}`);
|
logToFile(`[APPROVAL-CODE-EDIT] ✅ SUCCESS: ${JSON.stringify(ackResult).substring(0, 200)}`);
|
||||||
return `RPC:AcknowledgeCascadeCodeEdit(accept=${approved})`;
|
return `RPC:acknowledgeCodeActionStep(accept=${approved})`;
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] ❌ ${e.message.substring(0, 200)}`);
|
logToFile(`[APPROVAL-CODE-EDIT] ❌ ${e.message.substring(0, 200)}`);
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -2,7 +2,7 @@
|
|||||||
"name": "gravity-bridge",
|
"name": "gravity-bridge",
|
||||||
"displayName": "Gravity Bridge",
|
"displayName": "Gravity Bridge",
|
||||||
"description": "Antigravity ↔ Discord 브리지 연동 확장",
|
"description": "Antigravity ↔ Discord 브리지 연동 확장",
|
||||||
"version": "0.3.13",
|
"version": "0.3.14",
|
||||||
"publisher": "variet",
|
"publisher": "variet",
|
||||||
"engines": {
|
"engines": {
|
||||||
"vscode": "^1.100.0"
|
"vscode": "^1.100.0"
|
||||||
|
|||||||
@@ -2597,8 +2597,10 @@ async function processResponseFile(filePath: string) {
|
|||||||
const targetSession = sessionId || activeSessionId;
|
const targetSession = sessionId || activeSessionId;
|
||||||
let modifiedFiles: string[] = []; // shared between Strategy 1 and 2
|
let modifiedFiles: string[] = []; // shared between Strategy 1 and 2
|
||||||
|
|
||||||
// ── Strategy 1: AcknowledgeCascadeCodeEdit RPC ──
|
// ── Strategy 1: acknowledgeCodeActionStep RPC (correct AG LS method) ──
|
||||||
// Accept/reject all pending code edits via protocol (no UI interaction needed)
|
// Discovered via AG source reverse-engineering: the internal LS method is
|
||||||
|
// `acknowledgeCodeActionStep` (proto ID 167), NOT `AcknowledgeCascadeCodeEdit`.
|
||||||
|
// Accept all button → fireEvent({type:"accept-all-in-file"}) → submitCodeAcknowledgement → acknowledgeCodeActionStep
|
||||||
if (sdk) {
|
if (sdk) {
|
||||||
try {
|
try {
|
||||||
// Get tracked step indices from in-memory cache FIRST (pending file may be deleted by Collector)
|
// Get tracked step indices from in-memory cache FIRST (pending file may be deleted by Collector)
|
||||||
@@ -2627,62 +2629,48 @@ async function processResponseFile(filePath: string) {
|
|||||||
trackedSteps.push(pendingStepIndex);
|
trackedSteps.push(pendingStepIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] AcknowledgeCascadeCodeEdit(session=${targetSession.substring(0, 8)}, accept=${isAccept}, steps=[${trackedSteps.join(',')}])`);
|
logToFile(`[DIFF-REVIEW-RPC] acknowledgeCodeActionStep(session=${targetSession.substring(0, 8)}, accept=${isAccept}, steps=[${trackedSteps.join(',')}])`);
|
||||||
|
|
||||||
// ── EXPERIMENT: Try multiple parameter formats to find what AG expects ──
|
// Strategy 1a: VS Code command (most reliable — same path as UI button)
|
||||||
// Format A: with stepIndices (current approach)
|
|
||||||
try {
|
try {
|
||||||
const ackA = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
await vscode.commands.executeCommand('antigravity.prioritized.submitCodeAcknowledgement');
|
||||||
cascadeId: targetSession,
|
logToFile(`[DIFF-REVIEW-RPC] ✅ submitCodeAcknowledgement command OK`);
|
||||||
accept: isAccept,
|
diffReviewDone = true;
|
||||||
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
} catch (cmdErr: any) {
|
||||||
});
|
logToFile(`[DIFF-REVIEW-RPC] submitCodeAcknowledgement command error: ${cmdErr.message?.substring(0, 200)}`);
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format A (stepIndices=[${trackedSteps.join(',')}]): ${JSON.stringify(ackA).substring(0, 300)}`);
|
|
||||||
} catch (eA: any) {
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format A ERROR: ${eA.message.substring(0, 200)}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Format B: WITHOUT stepIndices (accept all pending)
|
|
||||||
try {
|
|
||||||
const ackB = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
|
||||||
cascadeId: targetSession,
|
|
||||||
accept: isAccept,
|
|
||||||
});
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format B (no stepIndices): ${JSON.stringify(ackB).substring(0, 300)}`);
|
|
||||||
} catch (eB: any) {
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format B ERROR: ${eB.message.substring(0, 200)}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Format C: with 'steps' key instead of 'stepIndices'
|
|
||||||
try {
|
|
||||||
const ackC = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
|
||||||
cascadeId: targetSession,
|
|
||||||
accept: isAccept,
|
|
||||||
steps: trackedSteps,
|
|
||||||
});
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format C (steps=[${trackedSteps.join(',')}]): ${JSON.stringify(ackC).substring(0, 300)}`);
|
|
||||||
} catch (eC: any) {
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format C ERROR: ${eC.message.substring(0, 200)}`);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Format D: with trajectoryId added
|
// Strategy 1b: Direct LS RPC with correct method name
|
||||||
try {
|
if (!diffReviewDone) {
|
||||||
const trajId = activeTrajectoryId || '';
|
try {
|
||||||
const ackD = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
const ackResult = await sdk.ls.rawRPC('acknowledgeCodeActionStep', {
|
||||||
cascadeId: targetSession,
|
cascadeId: targetSession,
|
||||||
trajectoryId: trajId,
|
accept: isAccept,
|
||||||
accept: isAccept,
|
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
||||||
stepIndices: trackedSteps,
|
});
|
||||||
});
|
logToFile(`[DIFF-REVIEW-RPC] ✅ acknowledgeCodeActionStep: ${JSON.stringify(ackResult).substring(0, 300)}`);
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format D (with trajectoryId): ${JSON.stringify(ackD).substring(0, 300)}`);
|
diffReviewDone = true;
|
||||||
} catch (eD: any) {
|
} catch (rpcErr1: any) {
|
||||||
logToFile(`[DIFF-REVIEW-RPC] Format D ERROR: ${eD.message.substring(0, 200)}`);
|
logToFile(`[DIFF-REVIEW-RPC] acknowledgeCodeActionStep error: ${rpcErr1.message?.substring(0, 200)}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
logToFile(`[DIFF-REVIEW-RPC] ✅ All experiments completed`);
|
// Strategy 1c: Legacy method name (fallback)
|
||||||
diffReviewDone = true;
|
if (!diffReviewDone) {
|
||||||
} catch (rpcErr: any) {
|
try {
|
||||||
logToFile(`[DIFF-REVIEW-RPC] ❌ ${rpcErr.message.substring(0, 200)}`);
|
const ackLegacy = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
||||||
|
cascadeId: targetSession,
|
||||||
|
accept: isAccept,
|
||||||
|
...(trackedSteps.length > 0 ? { stepIndices: trackedSteps } : {}),
|
||||||
|
});
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] ✅ AcknowledgeCascadeCodeEdit (legacy): ${JSON.stringify(ackLegacy).substring(0, 300)}`);
|
||||||
|
diffReviewDone = true;
|
||||||
|
} catch (rpcErr2: any) {
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] AcknowledgeCascadeCodeEdit (legacy) error: ${rpcErr2.message?.substring(0, 200)}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (outerErr: any) {
|
||||||
|
logToFile(`[DIFF-REVIEW-RPC] ❌ outer error: ${outerErr.message?.substring(0, 200)}`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3050,16 +3038,26 @@ async function tryApprovalStrategies(approved: boolean, sessionId: string, stepT
|
|||||||
let interactionPayload: Record<string, any> = {};
|
let interactionPayload: Record<string, any> = {};
|
||||||
|
|
||||||
if (typeLower.includes('code_edit') || typeLower.includes('write_to_file') || typeLower.includes('propose_code') || typeLower.includes('write_cascade_edit')) {
|
if (typeLower.includes('code_edit') || typeLower.includes('write_to_file') || typeLower.includes('propose_code') || typeLower.includes('write_cascade_edit')) {
|
||||||
// CODE EDIT: Uses separate AcknowledgeCascadeCodeEdit RPC
|
// CODE EDIT: Uses acknowledgeCodeActionStep RPC (correct AG LS method)
|
||||||
|
// Try VS Code command first (same path as UI Accept all button)
|
||||||
try {
|
try {
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] AcknowledgeCascadeCodeEdit(cascadeId=${sessionId.substring(0,8)}, accept=${approved}, stepIndices=[${effectiveStepIndex}])`);
|
logToFile(`[APPROVAL-CODE-EDIT] trying submitCodeAcknowledgement command`);
|
||||||
const ackResult = await sdk.ls.rawRPC('AcknowledgeCascadeCodeEdit', {
|
await vscode.commands.executeCommand('antigravity.prioritized.submitCodeAcknowledgement');
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] ✅ submitCodeAcknowledgement OK`);
|
||||||
|
return `CMD:submitCodeAcknowledgement(accept=${approved})`;
|
||||||
|
} catch {
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] submitCodeAcknowledgement not available, trying RPC`);
|
||||||
|
}
|
||||||
|
// Direct LS RPC with correct method name
|
||||||
|
try {
|
||||||
|
logToFile(`[APPROVAL-CODE-EDIT] acknowledgeCodeActionStep(cascadeId=${sessionId.substring(0,8)}, accept=${approved}, stepIndices=[${effectiveStepIndex}])`);
|
||||||
|
const ackResult = await sdk.ls.rawRPC('acknowledgeCodeActionStep', {
|
||||||
cascadeId: sessionId,
|
cascadeId: sessionId,
|
||||||
accept: approved,
|
accept: approved,
|
||||||
stepIndices: [effectiveStepIndex],
|
stepIndices: [effectiveStepIndex],
|
||||||
});
|
});
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] ✅ SUCCESS: ${JSON.stringify(ackResult).substring(0, 200)}`);
|
logToFile(`[APPROVAL-CODE-EDIT] ✅ SUCCESS: ${JSON.stringify(ackResult).substring(0, 200)}`);
|
||||||
return `RPC:AcknowledgeCascadeCodeEdit(accept=${approved})`;
|
return `RPC:acknowledgeCodeActionStep(accept=${approved})`;
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
logToFile(`[APPROVAL-CODE-EDIT] ❌ ${e.message.substring(0, 200)}`);
|
logToFile(`[APPROVAL-CODE-EDIT] ❌ ${e.message.substring(0, 200)}`);
|
||||||
// Fallback: try HandleCascadeUserInteraction with runCommand
|
// Fallback: try HandleCascadeUserInteraction with runCommand
|
||||||
|
|||||||
5
test_diff_review.txt
Normal file
5
test_diff_review.txt
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
Gravity Control - Diff Review Test
|
||||||
|
====================================
|
||||||
|
This file was created to trigger the AG diff review bar.
|
||||||
|
Created: 2026-03-16 17:10 KST
|
||||||
|
Purpose: Testing AcknowledgeCascadeCodeEdit RPC parameter formats (A/B/C/D)
|
||||||
Reference in New Issue
Block a user