Match session and group names ignoring case - #112
Open
thomwolf wants to merge 5 commits into
Open
Conversation
Group and session lookups by name compared with ===: a cron pointing at "Reviewer" spawned a duplicate next to "reviewer", and group targets were only case-folded, not trimmed or unicode-normalized. Add agent-list.js with normalizeName() (trim, case-fold, NFC) applied on both the query and the stored side; use it for the cron session lookup, the spawn route's group target, and a new `?group=<name>` filter on GET /api/agents (documented in the environment skill). Covered by test/agent-list.test.mjs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NPZfnyKjzDrzq5pYt44dVk
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.
Problem
Group and session lookups by name compared with
===:candidate.name === job.agent.name, so a job pointing at "Reviewer" spawned a second session next to the existing "reviewer" instead of reusing it;POST /api/agents group=only case-folded, without trimming or unicode-normalizing;GET /api/agentshad no way to narrow the roster to one group at all.Fix
server/src/agent-list.js:normalizeName()(trim, case-fold, NFC),sameName(),findByName(),filterAgentsByGroup(). The normalization runs on both the query side and the stored side, so the rule lives in one place.groups.resolveSpawnGroup()use it.GET /api/agents?group=<name>filters the roster by group name, matched ignoring case (documented in theenvironmentskill text).Tests
server/test/agent-list.test.mjs(32 checks): case/whitespace/unicode folding, roster filter (exact, lower, upper, padded, decomposed accent, unknown → empty, ungrouped rows never match), cron lookup (exact match wins; ambiguous folded matches or duplicate exact names fail clearly; blank/undefined never match), spawn group target (NONEstill ungrouped, unknown still an error). Picked up automatically byrun-suites.mjs.Follow-up review and Space validation (2026-09-09)
Name resolution no longer silently chooses the first colliding session or group.
Ambiguity is reported before spawning or cron delivery. Updated group regressions
and isolated the cron scheduler fixture from stale scheduled jobs.
Current main (
ef08e84) is merged. Atd5bd3e1cd9a4f40a55ffbb83a3e0e16eff22f660, the agent-list, spawn-group,crons and cron-api suites passed locally and in the private testing Space
thomwolf/agent-manager.🤖 Generated with Claude Code
https://claude.ai/code/session_01NPZfnyKjzDrzq5pYt44dVk