feat(kanban): add initial-status for human-ops cards

Salvages #27526 by @shunsuke-hikiyama. Adds an --initial-status flag
(running|blocked, default running) to 'kanban create', threaded through
kanban_db.create_task() and the kanban_create tool schema. 'blocked'
parks the task directly in the blocked column for R3 human-ops review,
skipping the brief running-to-blocked transition.

Dropped the unrelated 'add' alias, WIFEXITED Windows compat, and
slash-handler error formatting changes that were bundled in the
original PR — those should ship as their own focused changes if still
wanted.
This commit is contained in:
shunsuke-hikiyama
2026-05-18 20:43:56 -07:00
committed by Teknium
parent e8ce7b83fa
commit fb96208892
3 changed files with 40 additions and 8 deletions

View File

@@ -632,6 +632,7 @@ def _handle_create(args: dict, **kw) -> str:
return tool_error(bool_error)
idempotency_key = args.get("idempotency_key")
max_runtime_seconds = args.get("max_runtime_seconds")
initial_status = args.get("initial_status") or "running"
skills = args.get("skills")
if isinstance(skills, str):
# Accept a single skill name as a string for convenience.
@@ -666,6 +667,7 @@ def _handle_create(args: dict, **kw) -> str:
if max_runtime_seconds is not None else None
),
skills=skills,
initial_status=str(initial_status),
created_by=os.environ.get("HERMES_PROFILE") or "worker",
)
new_task = kb.get_task(conn, new_tid)
@@ -1077,6 +1079,16 @@ KANBAN_CREATE_SCHEMA = {
"task with outcome='timed_out'."
),
},
"initial_status": {
"type": "string",
"enum": ["running", "blocked"],
"description": (
"Initial card status. Use 'blocked' for tasks that "
"require immediate human ops (R3 gate) to skip the "
"brief running-to-blocked transition. Defaults to "
"'running', which preserves the usual dispatch path."
),
},
"skills": {
"type": "array",
"items": {"type": "string"},