chore: opencode冗余清理 + LLM任务级模型选择 + systemd服务化
- 删除 opencode_search.py / mcp_search_server.py 及所有 MCP 引用 - 移除搜索缓存定时任务(scheduled_refresh_search_cache) - 清理前后端所有 opencode/MCP 代码和注释 - LLM 提供商量换:opencode-go→nvidia(默认)+sensenova(合规审查) - llm_configs 新增 is_default 字段,API 层互斥逻辑 - 所有定时任务支持独立 LLM 模型选择(LLM_TASK_PROVIDER env) - compliance_optimizer.py 修复:import os / 解硬编码 / 关键词过滤 - Scheduler 日志修复:始终 INSERT,避免僵尸 running 行 - Systemd 服务化:Restart=always / 单 worker / Type=exec - 搜索提供商:替换 opencode→360/搜狗/微信(免 Key) - 更新 AGENTS.md / PROGRESS.md
This commit is contained in:
@@ -236,7 +236,6 @@ def _get_module_detail_data(module_id: str, db, ROOT, DATA_DIR, LOGS_DIR, today_
|
||||
import json as json_mod
|
||||
import re as re_mod
|
||||
MODULE_META = {
|
||||
"scheduled_refresh_search_cache": {"name": "🔍 搜索缓存", "description": "通过 opencode webfetch 联网搜索,刷新 8 个分类的搜索缓存,供内容采集器使用"},
|
||||
"scheduled_fetch_trends": {"name": "🔥 热点趋势", "description": "从百度、微博、知乎实时热搜 API 抓取当天热点,LLM 补充,存入 trends.json"},
|
||||
"scheduled_collect": {"name": "📡 内容采集", "description": "读取搜索缓存 + 热点趋势 + 历史表现 + AI 建议,经 LLM 分析后生成选题"},
|
||||
"scheduled_generate": {"name": "🤖 内容创作", "description": "基于选题,LLM 生成三平台文章(知乎、微信、小红书),存入 articles 表"},
|
||||
@@ -253,23 +252,7 @@ def _get_module_detail_data(module_id: str, db, ROOT, DATA_DIR, LOGS_DIR, today_
|
||||
outputs = {}
|
||||
history = []
|
||||
|
||||
if module_id == "scheduled_refresh_search_cache":
|
||||
cache_file = DATA_DIR / "search_cache.json"
|
||||
if cache_file.exists():
|
||||
try:
|
||||
cache = json_mod.loads(cache_file.read_text(encoding="utf-8"))
|
||||
meta_ = cache.pop("_metadata", {})
|
||||
for q, results in cache.items():
|
||||
inputs.setdefault("搜索词", []).append(q)
|
||||
outputs.setdefault("各分类结果", []).append({
|
||||
"query": q, "count": len(results),
|
||||
"samples": [r.get("title","")[:50] for r in results[:3]]
|
||||
})
|
||||
outputs["更新时间"] = meta_.get("updated_at", "")
|
||||
outputs["结果总数"] = sum(len(v) for v in cache.values())
|
||||
except Exception:
|
||||
pass
|
||||
# try reading queries from yaml
|
||||
# try reading queries from yaml
|
||||
try:
|
||||
import yaml
|
||||
cfg_path = ROOT / "config" / "sources.yaml"
|
||||
@@ -390,7 +373,6 @@ def _get_module_detail_data(module_id: str, db, ROOT, DATA_DIR, LOGS_DIR, today_
|
||||
|
||||
# History from log files
|
||||
log_map = {
|
||||
"scheduled_refresh_search_cache": LOGS_DIR / f"opencode_search_{today_str}.log",
|
||||
"scheduled_fetch_trends": LOGS_DIR / f"trends_{today_str}.log",
|
||||
"scheduled_collect": LOGS_DIR / f"collector_{today_str}.log",
|
||||
"scheduled_generate": LOGS_DIR / f"creator_{today_str}.log",
|
||||
|
||||
Reference in New Issue
Block a user