fix(kanban): normalize profile names to lowercase in assign_task#18515
Closed
liuhao1024 wants to merge 1 commit into
Closed
fix(kanban): normalize profile names to lowercase in assign_task#18515liuhao1024 wants to merge 1 commit into
liuhao1024 wants to merge 1 commit into
Conversation
The Kanban dashboard UI may pass title-cased profile names (e.g. 'Jules') to assign_task(), but the profile validation regex _PROFILE_ID_RE only accepts lowercase. When dispatch_once() later spawns a worker with hermes -p <assignee>, the CLI hits 'Invalid profile name' and the task is never claimed. Add normalize_profile_name() to profiles.py that lowercases names (preserving 'default' and None) and call it in assign_task() before storing the assignee. This ensures mixed-case inputs from the UI resolve correctly during dispatch. Closes NousResearch#18498
Contributor
|
Closing as duplicate of #18518 (now merged via salvage PR #19700). Your fix had the right idea — normalize profile names to lowercase — but only covered |
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
Normalize mixed-case profile names to lowercase in
assign_task()so the Kanban dispatcher does not hitInvalid profile nameerrors when the dashboard UI passes title-cased assignees.Root Cause
The dashboard UI may pass profile names with mixed case (e.g.
Jules,Librarian) tokanban_db.assign_task(). These are stored as-is in the DB. Later, whendispatch_once()spawns a worker viahermes -p <assignee>, the CLI'svalidate_profile_name()rejects the name because the regex_PROFILE_ID_RE = r"^[a-z0-9][a-z0-9_-]{0,63}$"only accepts lowercase.The task is never claimed, and the dispatcher error is:
Fix
normalize_profile_name()inhermes_cli/profiles.pythat lowercases names (preserving"default"andNone).assign_task()before storing the assignee in the DB.This is a one-line change in the hot path (
profile = normalize_profile_name(profile)) plus the helper function.Regression Coverage
test_assign_task_normalizes_profile_to_lowercase— core regression:"Jules"→"jules"test_assign_task_normalizes_title_case_profile—"Librarian"→"librarian"test_assign_task_preserves_already_lowercase— idempotent for lowercasetest_assign_task_preserves_default_special_case—"default"preservedtest_assign_task_normalizes_none_passthrough— unassign still worksnormalize_profile_name()covering edge casesTesting
Closes #18498