fix(intelligent-eval): worker trigger message must demand immediate execution
All checks were successful
CI / test (push) Successful in 3m47s
All checks were successful
CI / test (push) Successful in 3m47s
openclaw agent has no cron state; a bare 'agenteval-intelligent-worker' message made the worker skill decide then 'wait for the next tick', deadlocking (task assigned, session never created). The trigger message now demands '立即完成当前任务,不要等待下一节拍' and, when all sessions are done, delegates to agenteval-intelligent-analyst. Verified end-to-end on t480: 1h-window eval went executing -> session (2 real turns) -> close -> report -> completed, fully agent-driven, no external IM channel.
This commit is contained in:
parent
775b070bab
commit
8e65e2e7b0
@ -60,12 +60,20 @@ async def _trigger_intelligent_worker() -> bool:
|
||||
import subprocess
|
||||
|
||||
_logger = logging.getLogger("agenteval")
|
||||
# 触发指令必须带"立即执行"语义:`openclaw agent` 无 cron state,若只发
|
||||
# skill 名,agent 会按 worker skill 的"跨节拍"设计决策后等下一拍而死锁。
|
||||
# 明确要求"立即完成当前任务"后,agent 会在本次触发内完成会话/分析。
|
||||
worker_msg = (
|
||||
"执行 agenteval-intelligent-worker skill,立即完成当前任务,不要等待下一节拍:"
|
||||
"若需执行会话则立即创建会话并开始对话;若所有会话已完成则调用 "
|
||||
"agenteval-intelligent-analyst skill 完成分析并生成报告。"
|
||||
)
|
||||
try:
|
||||
proc = await asyncio.to_thread(
|
||||
subprocess.run,
|
||||
[
|
||||
"docker", "exec", "openclaw-eval", "openclaw", "agent",
|
||||
"--agent", "main", "-m", "agenteval-intelligent-worker", "--json",
|
||||
"--agent", "main", "-m", worker_msg, "--json",
|
||||
],
|
||||
capture_output=True,
|
||||
text=True,
|
||||
|
||||
@ -78,3 +78,33 @@ def test_trigger_worker_calls_docker_exec(monkeypatch):
|
||||
assert "docker" in joined and "openclaw" in joined
|
||||
assert "agenteval-intelligent-worker" in joined
|
||||
assert "--agent" in joined and "main" in joined
|
||||
|
||||
|
||||
def test_trigger_worker_msg_has_execute_semantics(monkeypatch):
|
||||
"""The trigger message must instruct immediate execution (no cron state).
|
||||
|
||||
`openclaw agent` has no cron state; a bare skill name makes the worker
|
||||
skill "decide then wait for the next tick", deadlocking. The message must
|
||||
say "立即完成当前任务 / 不要等待下一节拍".
|
||||
"""
|
||||
import asyncio
|
||||
import subprocess
|
||||
from unittest.mock import MagicMock
|
||||
|
||||
import agenteval.web.app as app_mod
|
||||
|
||||
calls: list = []
|
||||
monkeypatch.setattr(app_mod, "_has_pending_task", lambda: True)
|
||||
|
||||
def fake_run(cmd, **kwargs):
|
||||
calls.append(cmd)
|
||||
return MagicMock(returncode=0, stderr="")
|
||||
|
||||
monkeypatch.setattr(subprocess, "run", fake_run)
|
||||
|
||||
asyncio.run(app_mod._trigger_intelligent_worker())
|
||||
joined = " ".join(calls[0])
|
||||
assert "不要等待下一节拍" in joined
|
||||
assert "立即完成当前任务" in joined
|
||||
assert "agenteval-intelligent-worker" in joined
|
||||
assert "agenteval-intelligent-analyst" in joined
|
||||
|
||||
Loading…
Reference in New Issue
Block a user