mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-18 04:41:56 +00:00
fix(kanban): route gateway create auto-subscribe to explicit board
This commit is contained in:
parent
64145a1996
commit
f6d4f3c37d
2 changed files with 72 additions and 2 deletions
|
|
@ -8329,6 +8329,7 @@ class GatewayRunner:
|
|||
"""
|
||||
import asyncio
|
||||
import re
|
||||
import shlex
|
||||
from hermes_cli.kanban import run_slash
|
||||
|
||||
text = (event.text or "").strip()
|
||||
|
|
@ -8338,7 +8339,26 @@ class GatewayRunner:
|
|||
if text.startswith("kanban"):
|
||||
text = text[len("kanban"):].lstrip()
|
||||
|
||||
is_create = text.split(None, 1)[:1] == ["create"]
|
||||
tokens = shlex.split(text) if text else []
|
||||
requested_board = None
|
||||
action = None
|
||||
i = 0
|
||||
while i < len(tokens):
|
||||
tok = tokens[i]
|
||||
if tok == "--board":
|
||||
if i + 1 >= len(tokens):
|
||||
break
|
||||
requested_board = tokens[i + 1]
|
||||
i += 2
|
||||
continue
|
||||
if tok.startswith("--board="):
|
||||
requested_board = tok.split("=", 1)[1]
|
||||
i += 1
|
||||
continue
|
||||
action = tok
|
||||
break
|
||||
|
||||
is_create = action == "create"
|
||||
|
||||
try:
|
||||
output = await asyncio.to_thread(run_slash, text)
|
||||
|
|
@ -8365,7 +8385,7 @@ class GatewayRunner:
|
|||
if platform_str and chat_id:
|
||||
def _sub():
|
||||
from hermes_cli import kanban_db as _kb
|
||||
conn = _kb.connect()
|
||||
conn = _kb.connect(board=requested_board)
|
||||
try:
|
||||
_kb.add_notify_sub(
|
||||
conn, task_id=task_id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue