MCPcopy
hub / github.com/cft0808/edict / cmd_block

Function cmd_block

scripts/kanban_update.py:489–503  ·  view source on GitHub ↗

标记阻塞(原子操作)

(task_id, reason)

Source from the content-addressed store, hash-verified

487
488
489def cmd_block(task_id, reason):
490 """标记阻塞(原子操作)"""
491 def modifier(tasks):
492 t = find_task(tasks, task_id)
493 if not t:
494 log.error(f'任务 {task_id} 不存在')
495 return tasks
496 t['state'] = 'Blocked'
497 t['block'] = reason
498 t['updatedAt'] = now_iso()
499 return tasks
500 atomic_json_update(TASKS_FILE, modifier, [])
501 _trigger_refresh()
502 log.warning(f'⚠️ {task_id} 已阻塞: {reason}')
503 _append_audit(task_id, _infer_agent_id_from_runtime(), 'block', None, 'Blocked', reason)
504
505
506def cmd_confirm(task_id, action, reason=''):

Callers 1

kanban_update.pyFile · 0.70

Calls 4

atomic_json_updateFunction · 0.90
_append_auditFunction · 0.85
_trigger_refreshFunction · 0.70

Tested by

no test coverage detected