-
Notifications
You must be signed in to change notification settings - Fork 35
[Work] 建立 Autopilot runtime 与 action lane executor #642
Copy link
Copy link
Open
Labels
area:codexCodex protocol translation and wrapper integrationCodex protocol translation and wrapper integrationarea:daemonDaemon server, admin API, and runtime controlDaemon server, admin API, and runtime controlarea:feishuFeishu/Lark integration, gateway, projector, or previewFeishu/Lark integration, gateway, projector, or previewarea:runtimeRuntime manager, process lifecycle, and persisted stateRuntime manager, process lifecycle, and persisted statearea:wrapperWrapper process, proxy handling, and child launch flowWrapper process, proxy handling, and child launch flowenhancementNew feature or requestNew feature or requeststatus:blockedBlocked by an external dependency, upstream change, or awaited decisionBlocked by an external dependency, upstream change, or awaited decision
Description
Metadata
Metadata
Assignees
Labels
area:codexCodex protocol translation and wrapper integrationCodex protocol translation and wrapper integrationarea:daemonDaemon server, admin API, and runtime controlDaemon server, admin API, and runtime controlarea:feishuFeishu/Lark integration, gateway, projector, or previewFeishu/Lark integration, gateway, projector, or previewarea:runtimeRuntime manager, process lifecycle, and persisted stateRuntime manager, process lifecycle, and persisted statearea:wrapperWrapper process, proxy handling, and child launch flowWrapper process, proxy handling, and child launch flowenhancementNew feature or requestNew feature or requeststatus:blockedBlocked by an external dependency, upstream change, or awaited decisionBlocked by an external dependency, upstream change, or awaited decision
父 issue
背景
Autopilot V1 的 runtime 已在母单里明确收敛为双路径:
turn_terminal -> source materialize -> one model reasoning -> skip | one primary actionschedule_tick -> direct dispatch compiled action -> launch turn / send message但当前代码库里还没有一层统一的 event-driven automation runtime。现有相关能力分别散落在三条老骨架里:
autocontinueinternal/core/orchestrator/service_autocontinue.goautowhipinternal/core/orchestrator/service_autowhip.go/croninternal/app/daemon/app_cron_scheduler.go、app_cron_launch.go、app_cron_runtime.go与此同时,母单已经明确了 runtime 的关键边界:
turn_terminalschedule_ticksame_thread_promptnew_thread_promptfeishu_messageturn_terminal必须只对:生效
schedule_tick不能依赖某个当前活跃窗口,而必须走 frozen runner contract 直接 dispatch因此,这张子单的职责是:把现有三套老骨架收口成一套真正消费 compiled entries 的 runtime 与 lane executor。
目标
Autopilotruntime:turn_terminalturn_terminal按 entry 的 source 列表 materialize 事件上下文turn_terminal做 one-off decisionschedule_tickschedule_tick直接 dispatch compiled actions,不额外再起一轮 Autopilot reasonersame_thread_promptnew_thread_promptfeishu_messageschedule_tick执行模型:非目标
Autopilot.mdcompile prompt 或 validator。/cron、autocontinue、autowhip的切流或兼容收尾。bind to my view混进 V1 runtime。范围
turn_terminalhook 与 frontstage gatingschedule_tickscheduler integrationturn_terminalone-off runtime decision envelopeschedule_tickdirect dispatcherfeishu_message完成标准
turn_terminal只会在当前 frontstage mainline turn 命中时触发,不会误打到:schedule_tick能按 frozen runner contract 直接launch_turn或投递消息,即使当前 surface 已 detach,且不会再额外跑一轮 runtime 推理。same_thread_prompt能复用当前 thread 继续补发,而不偷走 thread selection 或破坏前台 queue 语义。new_thread_prompt不污染当前前台 Claude child,会统一走 hidden helper / hidden headless run。feishu_message能直接发text/simple_card到:turn_terminalruntime 输出只允许:skip依赖
下游依赖
/cron、autocontinue、autowhip切流。相关文档
docs/draft/autopilot-workspace-automation-design.mddocs/implemented/cron-bitable-scheduler-design.mddocs/draft/upstream-retryable-turn-autocontinue-design.mddocs/general/remote-surface-state-machine.md涉及文件
internal/core/orchestrator/service_remote_turn_outcome.gointernal/core/orchestrator/service_autocontinue.gointernal/core/orchestrator/service_autowhip.gointernal/core/orchestrator/service_queue.gointernal/core/orchestrator/service_queue_binding.gointernal/core/orchestrator/service_temporary_session.gointernal/core/orchestrator/service_helpers_threads.gointernal/app/daemon/app_cron_scheduler.gointernal/app/daemon/app_cron_launch.gointernal/app/daemon/app_cron_runtime.gointernal/app/daemon/app_thread_history.gointernal/app/daemon/workspace_surface_context.gointernal/adapter/feishu/projector.gointernal/adapter/feishu/controller_gateway.go已确认事实
service_remote_turn_outcome.go已经有稳定的 terminal cause 分类:completeduser_interruptedautocontinue_eligible_failurestartup_failednonretryable_failuretransport_lostservice_autocontinue.go已经证明:service_autowhip.go已经证明:app_cron_runtime.go已经证明:prompt.send(start_ephemeral + internal_helper)schedule_tick -> launch_turn的 substrateapp_thread_history.go+claudesessionstore.HandleLocalCommand(...)已经证明:workspace_surface_context.go已经提供 workspace -> surface/chat 绑定线索。feishu/projector.go/controller_gateway.go已经能直接执行:OperationSendTextOperationSendCard建议范围
turn_terminalgating 和 source materialization contract 定死。schedule_tick统一挂到 cron-style hidden direct-dispatch run 骨架。执行决策
turn_terminalreasoner、schedule_tickdirect dispatcher 与 lane executor。当前阶段
当前执行点
#638母单收敛出 event/source/lane 闭包。turn_terminalgating 与 source materializer 开始。schedule_tickdirect dispatcher 与 lane executor。恢复步骤
internal/core/orchestrator/service_remote_turn_outcome.gointernal/core/orchestrator/service_autocontinue.gointernal/core/orchestrator/service_autowhip.gointernal/app/daemon/app_cron_runtime.gointernal/app/daemon/app_thread_history.gointernal/adapter/feishu/projector.go实现参考
turn_terminal是 one-off reasoner,schedule_tick是 direct dispatcher,不要把两者混成一个会持续等待结果的二级 agent。turn_terminal只看当前 frontstage mainline;review/detour/helper 需要 fail-closed。new_thread_promptV1 一律走 hidden helper / hidden headless,不直接借当前前台 Claude child 开旁路线程。feishu_messageV1 只支持text与simple_card,不要扩成任意 card DSL。检查参考
go test ./internal/core/orchestrator ./internal/app/daemon ./internal/adapter/feishudocs/general/remote-surface-state-machine.md是否需要同步更新收尾参考
#638母单。docs/draft/autopilot-workspace-automation-design.md。