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:
Yuzhiran Dev
2026-06-02 15:38:16 +08:00
parent abbf1468bc
commit 499c511140
25 changed files with 451 additions and 678 deletions
+3 -3
View File
@@ -3,7 +3,7 @@
网络搜索模块
三种模式(优先级从高到低):
1. 本地缓存(opencode webfetch 预填充
1. 本地缓存(search_cache.json
2. Bing Web Search API(设 BING_API_KEY
3. Bing 网页抓取(服务器环境常反爬拦截)
"""
@@ -92,7 +92,7 @@ def search_scrape(query: str, max_results: int = 5) -> List[Dict]:
def search_from_cache(query: str, max_results: int = 5) -> List[Dict]:
""" opencode webfetch 预填充的缓存中读取(跳过超过36小时的缓存)"""
"""本地搜索缓存中读取(跳过超过36小时的缓存)"""
if not SEARCH_CACHE_FILE.exists():
return []
try:
@@ -114,7 +114,7 @@ def search_from_cache(query: str, max_results: int = 5) -> List[Dict]:
def save_to_cache(query: str, results: List[Dict]):
"""保存搜索结果到缓存(供 opencode webfetch 填充时使用)"""
"""保存搜索结果到缓存(供填充时使用)"""
cache = {}
if SEARCH_CACHE_FILE.exists():
try: