fix(nanoclaude): PYTHONUNBUFFERED + pre-route trace prints
worker 로그 stdout 미출력 해결 + pre-route 분기 추적용 trace. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -19,6 +19,8 @@ COPY infra/ ./infra/
|
|||||||
# Ensure infra has its own dependencies (pydantic, asyncssh already in requirements)
|
# Ensure infra has its own dependencies (pydantic, asyncssh already in requirements)
|
||||||
# Python path: /app is WORKDIR, so "from infra.core..." and "from tools..." both work
|
# Python path: /app is WORKDIR, so "from infra.core..." and "from tools..." both work
|
||||||
|
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
RUN mkdir -p /app/data
|
RUN mkdir -p /app/data
|
||||||
|
|
||||||
EXPOSE 8100
|
EXPOSE 8100
|
||||||
|
|||||||
@@ -254,9 +254,11 @@ async def run(job: Job) -> None:
|
|||||||
# --- 사전 라우팅 (키워드 기반, EXAONE 스킵) ---
|
# --- 사전 라우팅 (키워드 기반, EXAONE 스킵) ---
|
||||||
pre = _pre_route(job.message)
|
pre = _pre_route(job.message)
|
||||||
classify_latency = 0
|
classify_latency = 0
|
||||||
|
print(f"[TRACE] Job {job.id} pre_route result: {pre}", flush=True)
|
||||||
|
|
||||||
if pre:
|
if pre:
|
||||||
classification = pre
|
classification = pre
|
||||||
|
print(f"[TRACE] Job {job.id} PRE-ROUTED: {pre.get('tool','')}.{pre.get('operation','')}", flush=True)
|
||||||
logger.info("Job %s pre-routed: %s.%s", job.id, pre.get("tool", ""), pre.get("operation", pre.get("action", "")))
|
logger.info("Job %s pre-routed: %s.%s", job.id, pre.get("tool", ""), pre.get("operation", pre.get("action", "")))
|
||||||
else:
|
else:
|
||||||
# --- EXAONE 분류기 호출 ---
|
# --- EXAONE 분류기 호출 ---
|
||||||
@@ -289,6 +291,7 @@ async def run(job: Job) -> None:
|
|||||||
response_text = classification.get("response", "")
|
response_text = classification.get("response", "")
|
||||||
route_prompt = classification.get("prompt", "")
|
route_prompt = classification.get("prompt", "")
|
||||||
|
|
||||||
|
print(f"[TRACE] Job {job.id} final action='{action}' classification={classification}", flush=True)
|
||||||
logger.info("Job %s classified as '%s'", job.id, action)
|
logger.info("Job %s classified as '%s'", job.id, action)
|
||||||
|
|
||||||
# 대화 기록: 사용자 메시지
|
# 대화 기록: 사용자 메시지
|
||||||
|
|||||||
Reference in New Issue
Block a user