Skip to content

fix(kanban): explicit board= arg outranks HERMES_KANBAN_DB env override#30681

Open
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/kanban-board-override-env-var
Open

fix(kanban): explicit board= arg outranks HERMES_KANBAN_DB env override#30681
annguyenNous wants to merge 1 commit into
NousResearch:mainfrom
annguyenNous:fix/kanban-board-override-env-var

Conversation

@annguyenNous

Copy link
Copy Markdown
Contributor

Summary

kanban_db_path() and workspaces_root() unconditionally returned the HERMES_KANBAN_DB / HERMES_KANBAN_WORKSPACES_ROOT env-var override even when the caller passed an explicit board= argument.

In dispatched worker contexts where these env vars are pinned, tool calls like kanban_show(board="other") and CLI invocations like hermes kanban --board other show <id> silently resolved to the worker's own DB instead of the requested board.

Root cause

Both functions checked the env-var override before inspecting the board argument:

override = os.environ.get("HERMES_KANBAN_DB", "").strip()
if override:
    return Path(override).expanduser()  # always wins, even with board="other"
slug = _normalize_board_slug(board)

Fix

Move the env-var check inside the slug is None branch so it only fires when no explicit board was provided. Explicit board= now outranks the env override — which matches the documented intent that callers requesting a specific board get that board.

Tests

  • Updated test_env_var_db_override_still_wins — now only asserts the no-board case
  • Added test_explicit_board_overrides_env_var_db — asserts board= wins over HERMES_KANBAN_DB
  • Updated test_env_var_workspaces_override — now only asserts the no-board case
  • Added test_explicit_board_overrides_env_var_workspaces — asserts board= wins over HERMES_KANBAN_WORKSPACES_ROOT

All 58 board tests + 81 kanban tool tests pass.

Fixes #30678

…rride

kanban_db_path() and workspaces_root() unconditionally returned the
HERMES_KANBAN_DB / HERMES_KANBAN_WORKSPACES_ROOT env-var override even
when the caller passed an explicit board= argument.  In dispatched
worker contexts where these env vars are pinned, tool calls like
kanban_show(board="other") and CLI invocations like
hermes kanban --board other show <id> silently resolved to the worker's
own DB instead of the requested board.

Fix: move the env-var check inside the ``slug is None`` branch so it
only fires when no explicit board was provided.

Updated tests:
- test_env_var_db_override_still_wins: now only asserts no-board case
- test_explicit_board_overrides_env_var_db: new, asserts board= wins
- test_env_var_workspaces_override: now only asserts no-board case
- test_explicit_board_overrides_env_var_workspaces: new, asserts board= wins

Fixes NousResearch#30678
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/plugins Plugin system and bundled plugins P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

kanban board override is ignored in worker env because HERMES_KANBAN_DB outranks explicit board

3 participants