feat(engine): introduce agent handoff tracing and data integrity validation based on Astra analysis

This commit is contained in:
g1nation
2026-05-04 13:46:15 +09:00
parent 215c5f9457
commit e7b939cd7c
5 changed files with 91 additions and 6 deletions
+10 -4
View File
@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
import { lockManager } from '../core/lock';
import { actionQueue } from '../core/queue';
import { logInfo, logError } from '../utils';
import { AgentDataValidator, PerformanceProfiler } from './diagnostics';
// ─────────────────────────────────────────────
// 1. 에이전트 인터페이스 확장 (Interface Extensibility)
@@ -451,7 +452,13 @@ export class AgentEngine {
this.checkAbort(signal);
}
return await agent.execute(input, context, signal, options);
const startTime = Date.now();
const result = await agent.execute(input, context, signal, options);
const durationMs = Date.now() - startTime;
PerformanceProfiler.logLLMLatency(agentName, durationMs, result.length);
return result;
} catch (error: any) {
lastError = error;
const { type, rule } = ErrorClassifier.classify(error);
@@ -536,8 +543,7 @@ export class AgentEngine {
}
private validateResult(data: string, step: string) {
if (!data || data.trim().length < 10) {
throw new Error(`${step} 에이전트로부터 유효한 응답을 받지 못했습니다.`);
}
// Error Recovery Matrix: Permanent 오류 발생을 방지하기 위한 선제적 핸드오프 검증
AgentDataValidator.validateHandoff(step, data);
}
}