diff --git a/PROGRESS.md b/PROGRESS.md index 33ac943..0fdc30a 100644 --- a/PROGRESS.md +++ b/PROGRESS.md @@ -153,6 +153,7 @@ | 合规审查修复 | 2026-05-28 | compliance_optimizer.py 移除硬编码 provider;补 import os(之前导致 NameError);关键词过滤从宽泛改为精准,避免误拦正常内容 | | 搜索提供商重构 | 2026-05-28 | 移除 opencode MCP(配额耗尽),新增 360/搜狗/微信搜索(免 Key),百度千帆日限 50→200 | | opencode 冗余代码清理 | 2026-06-02 | 删除 opencode_search.py / mcp_search_server.py / _call_mcp / 前后端所有 opencode/MCP 引用;禁用搜索缓存定时任务 | +| 任务抽屉产出记录优化 | 2026-06-03 | drawer 产出结果 tab 优先显示日志消息(last_message),过滤 None/空值;修复 tasks.py 因 opencode 清理导致的 SyntaxError;清理 DB 中旧搜索缓存的 56 条 TaskLog + 1 条 TaskConfig | ### ⏳ 待办 diff --git a/platform/backend/app/api/tasks.py b/platform/backend/app/api/tasks.py index 4322d03..6e61f7e 100644 --- a/platform/backend/app/api/tasks.py +++ b/platform/backend/app/api/tasks.py @@ -252,19 +252,7 @@ def _get_module_detail_data(module_id: str, db, ROOT, DATA_DIR, LOGS_DIR, today_ outputs = {} history = [] - # try reading queries from yaml - try: - import yaml - cfg_path = ROOT / "config" / "sources.yaml" - if cfg_path.exists(): - cfg = yaml.safe_load(cfg_path.read_text(encoding="utf-8")) - ws = cfg.get("sustainability_sources", {}).get("web_search", []) - if ws: - inputs["采集来源"] = f"config/sources.yaml ({len(ws)} 个搜索词)" - except Exception: - pass - - elif module_id == "scheduled_fetch_trends": + if module_id == "scheduled_fetch_trends": trends_file = DATA_DIR / "trends.json" if trends_file.exists(): try: diff --git a/platform/backend/app/core/scheduler.py b/platform/backend/app/core/scheduler.py index 63d2e4b..638ac4b 100644 --- a/platform/backend/app/core/scheduler.py +++ b/platform/backend/app/core/scheduler.py @@ -262,7 +262,7 @@ class TaskScheduler: logger.info("[Scheduled] Review completed for %s", created_id) _log_task("scheduled_generate", "success", log_id=log_id, message=f"创作完成" + (f", 选题 {created_id}" if created_id else ""), - result_data={"topic_id": created_id, "review_ok": review_result.get("ok") if review_result else None}, + result_data={"topic_id": created_id} if created_id else {"note": "无待生成的选题"}, started_at=started, finished_at=datetime.now(timezone.utc)) except Exception as e: _log_task("scheduled_generate", "failed", log_id=log_id, diff --git a/platform/frontend/tasks.html b/platform/frontend/tasks.html index 5f5f57c..45e5b2c 100644 --- a/platform/frontend/tasks.html +++ b/platform/frontend/tasks.html @@ -371,13 +371,18 @@ -
-
+
+ 状态消息:{{ drawerData.last_message }} +
+
+
详细数据
+
{{ key }}: - {{ val }} + {{ JSON.stringify(val) }} + {{ val }}
-
暂无产出数据
+
暂无产出数据