diff --git a/src/gateway/chat/handle-chat.ts b/src/gateway/chat/handle-chat.ts index 72fcf86..90350a2 100644 --- a/src/gateway/chat/handle-chat.ts +++ b/src/gateway/chat/handle-chat.ts @@ -864,7 +864,12 @@ async function handleChat( // Only resolve image markdown for user messages — assistant messages with // /api/files/ image references must stay as plain text so Ollama (which // rejects image_url content parts on assistant turns) doesn't error. - const content = role === 'user' ? resolveImageContent(msg.content, workspacePath) : msg.content; + // 라이브 카메라 프레임(alt가 "📷"로 시작)은 매 턴 붙어 오므로, 과거 턴의 것까지 전부 다시 모델에 + // 실으면 세션이 길수록 비전 입력이 선형으로 쌓인다. 이전 프레임은 이미 답변에 반영됐으니 텍스트로 접는다. + const foldedContent = role === 'user' && typeof msg.content === 'string' + ? msg.content.replace(/!\[📷[^\]]*\]\([^)]*\)/g, '[이전 카메라 프레임 생략]') + : msg.content; + const content = role === 'user' ? resolveImageContent(foldedContent, workspacePath) : msg.content; messages.push({ role, content }); } messages.push({ role: 'user', content: resolveImageContent(message, workspacePath) }); diff --git a/web-ui/css/workshop-app.css b/web-ui/css/workshop-app.css index 9a04ae9..83fb870 100644 --- a/web-ui/css/workshop-app.css +++ b/web-ui/css/workshop-app.css @@ -291,3 +291,11 @@ body{background:var(--bg);color:var(--text);font-family:system-ui,sans-serif;dis /* 지연 로딩 모듈을 받는 동안 탭 패널을 흐리게 하고 클릭을 막는다 */ .rb-pane.rb-loading{opacity:.45;pointer-events:none;transition:opacity .15s;} +/* 라이브 카메라 패널 */ +.rb-attach-btn.on{border-color:#ef4444;color:#ef4444;} +.rb-cam-panel{display:flex;align-items:center;gap:10px;padding:8px 10px;border-top:1px solid var(--line);flex-wrap:wrap;} +.rb-cam-panel video{height:96px;max-width:48%;border-radius:8px;background:#000;object-fit:cover;} +.rb-cam-ctl{display:flex;flex-direction:column;gap:6px;font-size:11px;color:var(--muted);} +.rb-cam-ctl label{display:flex;align-items:center;gap:6px;cursor:pointer;} +.rb-cam-btns{display:flex;gap:6px;flex-wrap:wrap;} +.rb-msg .rb-cam-shot{display:block;max-width:140px;border-radius:6px;margin-bottom:4px;} diff --git a/web-ui/html/index.html b/web-ui/html/index.html index 644de2b..8e1b37f 100644 --- a/web-ui/html/index.html +++ b/web-ui/html/index.html @@ -424,6 +424,18 @@
+ +