fix(kanban): explicit board= arg outranks HERMES_KANBAN_DB env override#30681
Open
annguyenNous wants to merge 1 commit into
Open
fix(kanban): explicit board= arg outranks HERMES_KANBAN_DB env override#30681annguyenNous wants to merge 1 commit into
annguyenNous wants to merge 1 commit into
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kanban_db_path()andworkspaces_root()unconditionally returned theHERMES_KANBAN_DB/HERMES_KANBAN_WORKSPACES_ROOTenv-var override even when the caller passed an explicitboard=argument.In dispatched worker contexts where these env vars are pinned, tool calls like
kanban_show(board="other")and CLI invocations likehermes 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
boardargument:Fix
Move the env-var check inside the
slug is Nonebranch so it only fires when no explicit board was provided. Explicitboard=now outranks the env override — which matches the documented intent that callers requesting a specific board get that board.Tests
test_env_var_db_override_still_wins— now only asserts the no-board casetest_explicit_board_overrides_env_var_db— assertsboard=wins overHERMES_KANBAN_DBtest_env_var_workspaces_override— now only asserts the no-board casetest_explicit_board_overrides_env_var_workspaces— assertsboard=wins overHERMES_KANBAN_WORKSPACES_ROOTAll 58 board tests + 81 kanban tool tests pass.
Fixes #30678