feat(agent): 增加 LLM 路由与诊断日志
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
from pathlib import Path
|
||||
|
||||
from review_agent.models import FileSummaryBatchAttachment
|
||||
@@ -9,6 +10,9 @@ from ..services.inventory import scan_files_to_items
|
||||
from .base import BaseSkill, SkillResult, WorkflowContext
|
||||
|
||||
|
||||
logger = logging.getLogger("review_agent.file_summary.skills.file_inventory")
|
||||
|
||||
|
||||
class FileInventorySkill(BaseSkill):
|
||||
name = "file_inventory"
|
||||
|
||||
@@ -17,5 +21,17 @@ class FileInventorySkill(BaseSkill):
|
||||
resolve_storage_path(binding.attachment.storage_path)
|
||||
for binding in FileSummaryBatchAttachment.objects.filter(batch=context.batch)
|
||||
]
|
||||
logger.info(
|
||||
"File inventory started",
|
||||
extra={
|
||||
"batch_id": context.batch.pk,
|
||||
"root_count": len(roots),
|
||||
"roots": [str(root) for root in roots],
|
||||
},
|
||||
)
|
||||
items = scan_files_to_items(batch=context.batch, roots=roots)
|
||||
logger.info(
|
||||
"File inventory finished",
|
||||
extra={"batch_id": context.batch.pk, "total_files": len(items)},
|
||||
)
|
||||
return SkillResult(success=True, data={"total_files": len(items)})
|
||||
|
||||
Reference in New Issue
Block a user