Skip to content

fix(kanban): normalize profile names to lowercase in assign_task#18515

Closed
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/issue-18498-kanban-profile-case
Closed

fix(kanban): normalize profile names to lowercase in assign_task#18515
liuhao1024 wants to merge 1 commit into
NousResearch:mainfrom
liuhao1024:fix/issue-18498-kanban-profile-case

Conversation

@liuhao1024

Copy link
Copy Markdown
Contributor

Summary

Normalize mixed-case profile names to lowercase in assign_task() so the Kanban dispatcher does not hit Invalid profile name errors when the dashboard UI passes title-cased assignees.

Root Cause

The dashboard UI may pass profile names with mixed case (e.g. Jules, Librarian) to kanban_db.assign_task(). These are stored as-is in the DB. Later, when dispatch_once() spawns a worker via hermes -p <assignee>, the CLI's validate_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:

Invalid profile name 'Jules'. Must match [a-z0-9][a-z0-9_-]{0,63}

Fix

  • Add normalize_profile_name() in hermes_cli/profiles.py that lowercases names (preserving "default" and None).
  • Call it in 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 lowercase
  • test_assign_task_preserves_default_special_case"default" preserved
  • test_assign_task_normalizes_none_passthrough — unassign still works
  • 8 unit tests for normalize_profile_name() covering edge cases

Testing

scripts/run_tests.sh tests/hermes_cli/test_profiles.py tests/hermes_cli/test_kanban_db.py
# 143 passed

Closes #18498

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
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/cli CLI entry point, hermes_cli/, setup wizard labels May 1, 2026
@liuhao1024 liuhao1024 closed this May 1, 2026
@liuhao1024 liuhao1024 reopened this May 2, 2026
@teknium1

teknium1 commented May 4, 2026

Copy link
Copy Markdown
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 assign_task, leaving the more common create_task ingress path (dashboard POST body) still storing mixed-case verbatim. #18518 covered every ingress site (create_task, list_tasks, assign_task, _default_spawn, plus all the profile lifecycle functions in profiles.py), which closed the bug end-to-end. Thanks for the quick submission — this one just happened to be scoped slightly narrower than the bug required.

@teknium1 teknium1 closed this May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Kanban dispatcher fails to claim tasks assigned to "jules" due to case sensitivity in profile validation

3 participants