Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion launch.pyw
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,14 @@ def idle_monitor():
last_reply = get_last_reply_time()
if now - last_reply > 1800:
print('[Idle Monitor] Detected idle state, injecting task...')
inject("[AUTO]🤖 用户已经离开超过30分钟,作为自主智能体,请阅读自动化sop,执行自动任务。")
import importlib.util
spec = importlib.util.spec_from_file_location('autonomous', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'reflect', 'autonomous.py'))
mod = importlib.util.module_from_spec(spec); spec.loader.exec_module(mod)
try:
task = mod.check()
except Exception:
task = "[AUTO]用户已离开超过30分钟,作为自主智能体,请阅读 autonomous_operation_sop.md,执行自动任务"
inject(task)
last_trigger_time = now
except Exception as e:
print(f'[Idle Monitor] Error: {e}')
Expand Down
2 changes: 1 addition & 1 deletion reflect/autonomous.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
ONCE = False

def check():
return "[AUTO]🤖 用户已经离开超过30分钟,作为自主智能体,请阅读自动化sop,执行自动任务"
return "[AUTO]用户已离开超过30分钟,作为自主智能体,请阅读 autonomous_operation_sop.md,执行自动任务"