feat: ConnectAI structural hardening and retrieval precision improvements
This commit is contained in:
@@ -97,4 +97,33 @@ export interface IHttpService {
|
||||
* HTTP POST 요청
|
||||
*/
|
||||
post(url: string, data: any, options?: any): Promise<any>;
|
||||
}
|
||||
|
||||
// ─── 공용 오류 처리 타입 (Unified Error Handling) ───
|
||||
|
||||
/**
|
||||
* 오류 유형 분류.
|
||||
*/
|
||||
export enum ErrorType {
|
||||
/** 네트워크 타임아웃, API 응답 지연 등 재시도로 복구 가능한 오류 */
|
||||
TRANSIENT = 'TRANSIENT',
|
||||
/** 프롬프트 구조 문제, 모델 명백한 실패 등 수동 개입이 필요한 오류 */
|
||||
PERMANENT = 'PERMANENT',
|
||||
/** 인증 실패 (API Key 만료 등) */
|
||||
AUTH_FAILURE = 'AUTH_FAILURE',
|
||||
/** 사용자가 의도적으로 작업을 취소한 경우 */
|
||||
ABORT = 'ABORT'
|
||||
}
|
||||
|
||||
/**
|
||||
* 오류 복구 규칙 정의.
|
||||
*/
|
||||
export interface RecoveryRule {
|
||||
type: ErrorType;
|
||||
description: string;
|
||||
maxRetries: number;
|
||||
backoffBaseMs: number;
|
||||
action: 'retry' | 'abort' | 'fail_with_message' | 'fallback';
|
||||
userMessage: string;
|
||||
fallbackDescription?: string;
|
||||
}
|
||||
Reference in New Issue
Block a user