mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-26 06:01:49 +00:00
fix(kanban): parse triage flag explicitly
This commit is contained in:
parent
26bf45f8c5
commit
50d281495e
2 changed files with 49 additions and 1 deletions
|
|
@ -482,6 +482,52 @@ def test_create_rejects_non_list_parents(worker_env):
|
||||||
assert json.loads(out).get("error")
|
assert json.loads(out).get("error")
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_parses_triage_string_false(worker_env):
|
||||||
|
from tools import kanban_tools as kt
|
||||||
|
from hermes_cli import kanban_db as kb
|
||||||
|
out = kt._handle_create({
|
||||||
|
"title": "not triage",
|
||||||
|
"assignee": "peer",
|
||||||
|
"triage": "false",
|
||||||
|
})
|
||||||
|
d = json.loads(out)
|
||||||
|
assert d["ok"] is True
|
||||||
|
conn = kb.connect()
|
||||||
|
try:
|
||||||
|
task = kb.get_task(conn, d["task_id"])
|
||||||
|
assert task.status == "ready"
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_parses_triage_string_true(worker_env):
|
||||||
|
from tools import kanban_tools as kt
|
||||||
|
from hermes_cli import kanban_db as kb
|
||||||
|
out = kt._handle_create({
|
||||||
|
"title": "needs triage",
|
||||||
|
"assignee": "peer",
|
||||||
|
"triage": "true",
|
||||||
|
})
|
||||||
|
d = json.loads(out)
|
||||||
|
assert d["ok"] is True
|
||||||
|
conn = kb.connect()
|
||||||
|
try:
|
||||||
|
task = kb.get_task(conn, d["task_id"])
|
||||||
|
assert task.status == "triage"
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
|
def test_create_rejects_bad_triage(worker_env):
|
||||||
|
from tools import kanban_tools as kt
|
||||||
|
out = kt._handle_create({
|
||||||
|
"title": "bad triage",
|
||||||
|
"assignee": "peer",
|
||||||
|
"triage": "sometimes",
|
||||||
|
})
|
||||||
|
assert "triage must be" in json.loads(out).get("error", "")
|
||||||
|
|
||||||
|
|
||||||
def test_create_accepts_string_parent(worker_env):
|
def test_create_accepts_string_parent(worker_env):
|
||||||
"""Convenience: a single parent id as string is coerced to [id]."""
|
"""Convenience: a single parent id as string is coerced to [id]."""
|
||||||
from tools import kanban_tools as kt
|
from tools import kanban_tools as kt
|
||||||
|
|
|
||||||
|
|
@ -509,7 +509,9 @@ def _handle_create(args: dict, **kw) -> str:
|
||||||
priority = args.get("priority")
|
priority = args.get("priority")
|
||||||
workspace_kind = args.get("workspace_kind") or "scratch"
|
workspace_kind = args.get("workspace_kind") or "scratch"
|
||||||
workspace_path = args.get("workspace_path")
|
workspace_path = args.get("workspace_path")
|
||||||
triage = bool(args.get("triage"))
|
triage, bool_error = _parse_bool_arg(args, "triage")
|
||||||
|
if bool_error:
|
||||||
|
return tool_error(bool_error)
|
||||||
idempotency_key = args.get("idempotency_key")
|
idempotency_key = args.get("idempotency_key")
|
||||||
max_runtime_seconds = args.get("max_runtime_seconds")
|
max_runtime_seconds = args.get("max_runtime_seconds")
|
||||||
skills = args.get("skills")
|
skills = args.get("skills")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue