fix(kanban): isolate board override per concurrent call#38325
Closed
worlldz wants to merge 1 commit into
Closed
Conversation
df46c6e to
90429d4
Compare
90429d4 to
e71cc2e
Compare
Contributor
|
Merged via #39074. Your commit was cherry-picked onto current On top of your CLI fix, we widened the same |
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.
Fixes #38323
hermes kanban --board <slug> ...was pinning the requested board by mutating the process-globalHERMES_KANBAN_BOARDenvironment variable for the duration of the call.That works in single-threaded use, but it is not safe when multiple kanban calls run concurrently in the same process. A second call can overwrite the board pin while the first call is still in progress, which makes writes land on the wrong board.
This patch replaces the in-process board override with a context-local override, while keeping the environment-variable path available for spawned worker processes and explicit external overrides.
It also adds a regression test that runs two concurrent
kanban --board ... createcalls in the same process and verifies that each task lands on the correct board.Validation:
uv run --extra dev pytest tests/hermes_cli/test_kanban_cli.py -q -k 'board_override_is_isolated_per_concurrent_call or run_slash_link_unlink'Result:
2 passed, 45 deselected in 2.60sLive repro on current main before fix:
{'alpha_titles': [], 'beta_titles': ['beta-task', 'alpha-task']}Live repro after fix:
{'alpha_titles': ['alpha-task'], 'beta_titles': ['beta-task']}