auto-sync: 2026-06-06 11:26:44
This commit is contained in:
@@ -158,7 +158,9 @@ async def _generate_title(description: str) -> str | None:
|
||||
base_url = "https://open.bigmodel.cn/api/paas/v4"
|
||||
api_key = ""
|
||||
model = "glm-4-flash"
|
||||
oc_cfg = Path.home() / ".openclaw" / "openclaw.json"
|
||||
oc_cfg = Path(os.environ.get(
|
||||
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
|
||||
)) / "openclaw.json"
|
||||
if oc_cfg.exists():
|
||||
with open(oc_cfg) as f:
|
||||
cfg = _json.load(f)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
import sqlite3
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
@@ -261,7 +262,10 @@ class ProjectRegistry:
|
||||
|
||||
def discover_sanguo_projects(self, scan_dir: Optional[Path] = None) -> List[str]:
|
||||
"""扫描 sanguo_projects 开发目录,自动注册正式项目"""
|
||||
scan_dir = scan_dir or Path.home() / ".openclaw" / "sanguo_projects"
|
||||
scan_dir = scan_dir or Path(os.environ.get(
|
||||
"SANGUO_PROJECTS_DIR",
|
||||
str(Path.home() / ".openclaw" / "sanguo_projects")
|
||||
))
|
||||
discovered = []
|
||||
|
||||
if not scan_dir.exists():
|
||||
|
||||
@@ -9,6 +9,7 @@ from __future__ import annotations
|
||||
import asyncio
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import uuid
|
||||
from datetime import datetime
|
||||
from pathlib import Path
|
||||
@@ -1165,7 +1166,9 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
|
||||
@staticmethod
|
||||
def _revive_session(agent_id: str) -> bool:
|
||||
"""假死复活术:修改 sessions.json status 从 running 改为 idle"""
|
||||
sessions_path = Path.home() / ".openclaw" / "agents" / agent_id / "sessions" / "sessions.json"
|
||||
sessions_path = Path(os.environ.get(
|
||||
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
|
||||
)) / "agents" / agent_id / "sessions" / "sessions.json"
|
||||
if not sessions_path.exists():
|
||||
return False
|
||||
try:
|
||||
@@ -1249,7 +1252,9 @@ curl -X POST http://{api_host}:{api_port}/api/projects/{project_id}/tasks/{task_
|
||||
替代失效的 compactionCheckpoints 检测。
|
||||
"""
|
||||
result = {"status": "unknown", "lock_pid": None, "lock_pid_alive": False, "recent_compact": False}
|
||||
sessions_path = Path.home() / ".openclaw" / "agents" / agent_id / "sessions" / "sessions.json"
|
||||
sessions_path = Path(os.environ.get(
|
||||
"OPENCLAW_HOME", str(Path.home() / ".openclaw")
|
||||
)) / "agents" / agent_id / "sessions" / "sessions.json"
|
||||
if not sessions_path.exists():
|
||||
return result
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user