execution-state 是一个执行态治理 + 轻量 durable execution 技能。
它专门修下面这类问题:
longtask-reporting + 子代理)一句话:
> 把“承诺 → 执行态 → 承载方式 → 推进/回报 → 收口”接成一条真的能跑的链路。
它不是通用工作流平台,也不替代 OpenClaw 现有能力;它补的是“执行纪律和状态治理”这一层。
execution-state 负责sessions_spawn / subagentslongtask-reportingcontinuity / memory_search换句话说:
execution-state 管“是不是已经进入真实执行,以及该怎么承载”longtask-reporting 管“怎么把执行过程对用户讲清楚”continuity 管“上次做到哪、为什么停、下一步是什么”当出现以下任一信号时,优先触发本技能:
包括但不限于:
这些话不是礼貌结束语;一旦说出口,默认视为进入执行态。
典型场景:
例如:
以下情况一般不需要专门切入本技能:
判断标准很简单:
> 如果任务不需要“持续推进、恢复、回报、收口”,就别把它搞复杂。
如果你只记一件事,就记这一句:说了继续做,就必须进入真实执行。
说了“继续做”,就必须真的进入执行,而不是停在语言层。
进入执行态后,至少推进到以下三者之一:
多步骤、巡检、排查、修复链路、研究任务,默认优先:
longtask-reporting不能只说“我在做”;要能指向:
先让任务收口,再考虑打磨。不要把“优化中”当成迟迟不交付的借口。
如果已经说出承诺词,且任务路径清晰、无需新的外部授权,默认进入执行态。
参考 references/complexity-and-routing.md:
longtask-reportinglongtask-reporting + 子代理一旦进入执行态:
如果已经说了继续做,但后面没有:
那就属于假执行风险高,必须立即修正。
本技能至少围绕这些状态工作:
idleexecutingblockedwaiting-userstalecompleted如果你需要更精确地判断状态流转,读:
references/state-machine.md当前版本已经不只是文档,还带了最小可用执行层:
runtime/execution-state/current.jsonruntime/execution-state/history/*.jsonruntime/execution-state/reports/*.jsonnext_check_at / last_user_report_at / auto_stateblocker / recovery_suggestion / next_action_hint / completed_atadvance_stepask_usermark_blockedrun_scriptverify_artifactspawn_subtasknext_actionaction_queuecompletedreports/ 只应作为热数据区,不应长期堆积archive/reports/YYYY-MM-DD/references/runtime-hygiene.md把整个 execution-state/ 目录放进 skills 目录即可,建议保留结构:
execution-state/
├── SKILL.md
├── references/
├── scripts/
└── hooks/
如果工作区不是当前进程目录,建议设置:
export OPENCLAW_WORKSPACE="/your/workspace/path"
如果希望自动做用户可见回报,再补:
export EXECUTION_STATE_DELIVERY_CHANNEL="<your-channel>"
export EXECUTION_STATE_DELIVERY_TARGET="<your-target-id>"
export EXECUTION_STATE_DELIVERY_ACCOUNT_ID="<your-account-id>"
export EXECUTION_STATE_AGENT_ID="main"
execution-state-dispatcher(建议每 5 分钟)execution-state-watchdog(建议每 15 分钟)安装后建议至少跑一次闭环自测:
action_queue:run_scriptverify_artifactstatus = completedverification_status = verifiedqueue_len = 0next_action_hint = ""如果你是在做发布前验收,直接跑:
node skills/execution-state/scripts/test-release-acceptance.js
当前会覆盖:
waiting-user 分支blocked -> recoverspawn_subtask如果这组回归没跑通,就别急着说“技能可发布”。
scripts/state-store.jsscripts/promise-detector.jsscripts/execution-state-cli.jsscripts/execution-dispatcher.jsscripts/fake-execution-watchdog.jsscripts/test-release-acceptance.jsreferences/release-preflight-checklist.mdnode skills/execution-state/scripts/execution-state-cli.js promise "我继续做这个问题,先去排查日志和配置"
node skills/execution-state/scripts/execution-state-cli.js start "entered execution state"
node skills/execution-state/scripts/execution-state-cli.js update "checked logs and config"
node skills/execution-state/scripts/execution-state-cli.js block "waiting for permission"
node skills/execution-state/scripts/execution-state-cli.js complete "usable version delivered"
node skills/execution-state/scripts/execution-state-cli.js status
node skills/execution-state/scripts/execution-state-cli.js watchdog 10
node skills/execution-state/scripts/execution-state-cli.js dispatch
node skills/execution-state/scripts/state-store.js plan '{"goal":"...","steps":["a","b"],"action_queue":[{"type":"run_script","message":"do a","command":"/abs/path/script.sh"}]}'
按问题读,不要一上来全读。
读:
references/complexity-and-routing.md读:
references/fake-execution.md读:
references/state-machine.mdreferences/lifecycle-acceptance.md读:
references/mvp-plan.md读:
references/publish-readiness.mdreferences/platform-publish-kit.mdreferences/installer-checklist.mdreferences/release-preflight-checklist.md读:
references/real-workflow-integration.md读:
references/evolution-principles.md读:
references/promise-to-visible-event.md读:
references/state-transition-events.md读:
references/stage-completion-event.md如果你需要 bootstrap 恢复提醒,可将:
hooks/openclaw/
复制到:
~/.openclaw/hooks/execution-state/
然后执行:
openclaw hooks enable execution-state
发布前至少确认:
run_script -> verify_artifact -> auto complete更细的发布检查见:
references/publish-readiness.md这个技能适合:
这个技能不等价于:
别把它吹过头;它的价值就在于:够轻、够准、够接地气。
> execution-state 不是让代理“显得更主动”,而是让“继续做”这句话真的对应一段可见、可恢复、可验收的执行过程。
共 3 个版本