Auto sync connectai

This commit is contained in:
2026-05-19 19:06:06 +09:00
parent 2e2ad36ea9
commit 59e0139bbe
9 changed files with 47 additions and 17 deletions
+18 -2
View File
@@ -22,10 +22,26 @@ export async function handleChatMessage(provider: SidebarChatProvider, data: any
// 사용자가 채팅에서 `/research`, `/benchmark`, `/youtube`, `/blog` 같은
// 슬래시 명령을 보내면 Datacollect bridge(3002)로 위임. 회사 모드/일반
// chat 분기보다 먼저 잡아 LLM 토큰을 쓰지 않고 직접 처리한다.
//
// 진단 logging: "/benchmark 입력했는데 아무 답변도 안 옴" 같은 보고가
// 들어왔을 때, OutputChannel(Astra)에 단계별 trace가 남으면 어디서
// 막혔는지 (분기 진입 / view 부재 / bridge 호출 실패) 즉시 판별 가능.
if (typeof data.value === 'string') {
const { isSlashCommand, handleSlashCommand } = await import('../features/datacollect/slashRouter');
if (isSlashCommand(data.value)) {
await handleSlashCommand(data.value, provider._view?.webview);
const matched = isSlashCommand(data.value);
logInfo(`[SLASH] prompt received: ${JSON.stringify(data.value).slice(0, 100)} matched=${matched} hasView=${!!provider._view}`);
if (matched) {
if (!provider._view?.webview) {
// webview가 비활성/닫힘 상태면 chunk가 silently drop되므로
// 사용자가 아무 응답도 못 본다. notification으로 즉시 surface.
const msg = '📻 Datacollect Radio: 채팅 webview가 활성 상태가 아닙니다. Astra 사이드바를 한 번 열고 다시 시도해 주세요.';
await vscode.window.showWarningMessage(msg);
logInfo(`[SLASH] webview not available — aborting`);
return true;
}
logInfo(`[SLASH] handleSlashCommand entering`);
await handleSlashCommand(data.value, provider._view.webview);
logInfo(`[SLASH] handleSlashCommand returned`);
return true;
}
}