fix(kanban): keep board-management commands independent from board override

This commit is contained in:
QuenVix 2026-05-18 20:14:21 -07:00 committed by Teknium
parent 8a64e1580b
commit afae2dd9ec
2 changed files with 18 additions and 9 deletions

View file

@ -692,6 +692,14 @@ def kanban_command(args: argparse.Namespace) -> int:
)
return 0
# Board-management commands operate on board metadata and the persisted
# current-board pointer itself. They must ignore the shared `--board`
# task-routing override; otherwise `/kanban --board beta boards show`
# reports beta as the current board even when the on-disk pointer is
# alpha.
if action == "boards":
return _dispatch_boards(args)
# `--board <slug>` applies to every subcommand below by way of an
# env-var pin for the duration of this call. Using HERMES_KANBAN_BOARD
# (rather than threading `board=` through 50+ kb.connect() sites)
@ -729,15 +737,6 @@ def kanban_command(args: argparse.Namespace) -> int:
os.environ["HERMES_KANBAN_BOARD"] = normed
restore_board_env = True
# Boards management doesn't touch the DB at all — dispatch early so
# fresh installs that haven't initialized any DB can still use
# `hermes kanban boards create …`.
if action == "boards":
try:
return _dispatch_boards(args)
finally:
_restore_board_env()
# Auto-initialize the DB before dispatching any subcommand. init_db
# is idempotent, so running it every invocation is cheap (one
# SELECT against sqlite_master when tables already exist) and