code-to10 goal live update: POST /tasks/{id}/goal updates a running goal loop at the next round boundary
Server writes goal + monotonic goal_version + task_goal_history in one transaction (CAS on version, approve_merge only, new-semantic goal tasks only, terminal/merged 409, same-goal noop). Worker mirror thread (30s) and breakpoint-resume claim hook write the update as a signal file next to host-state.json; host run_goal_loop applies it at round boundaries (top of round and before the declaration check, so a declaration made for the old goal in a turn during which the goal changed is voided), with an explicit old->new notice, same thread/worktree, rounds/usage/ budget/failed counters untouched. handler method accounting is a contract update: 239 total / 223 mixins / 16 in server.py. (cherry picked from commit 6841f287219d2b36cfbb8803642344b84dae4377) Reconcile-port: handler_lifecycle.py contents redirected — _update_goal_task method + _goal_update_reject/_goal_signal_status pure functions + goal_live_update import into cloud/server.py (target keeps 6-mixin split); _task_to_dict goal fields into cloud/handler_support.py; migrate columns into cloud/server.py migrate_tasks_table; test patch target handler_lifecycle→server; test_handler_split_conformance.py kept at target version, to be re-pinned for the unified line in a final commit.
This commit is contained in:
1 parent
63abb3953b
commit
9e56c1d266
6 files changed
+1110
-2
No files matched your search
@@ -154,6 +154,11 @@ def _task_to_dict(row, attachments=None, total_tokens=None):
|
||||
"verify_command": _row_get(row, "verify_command"),
|
||||
"goal_max_rounds": _row_get(row, "goal_max_rounds"),
|
||||
"goal_mode": _row_get(row, "goal_mode") or 0,
|
||||
# 运行中改 goal:goal_version 是已提交版本(服务端写库),
|
||||
# applied_goal_version 是 host 循环已应用版本(镜像回写),
|
||||
# 两者不等时说明信号在途或未到轮次边界,绝不能冒充已应用。
|
||||
"goal_version": _row_get(row, "goal_version") or 0,
|
||||
"applied_goal_version": _row_get(row, "applied_goal_version") or 0,
|
||||
"attachments": list(attachments or []),
|
||||
"resume_message": _row_get(row, "resume_message"),
|
||||
"worktree_host": _row_get(row, "worktree_host"),
|
||||
|
||||
Reference in new issue
Block a user