Skip to content

Lowercase agent names as you type in the register dialog - #324

Merged
abeldantas merged 5 commits into
mainfrom
feat/lowercase-agent-name
Sep 4, 2026
Merged

Lowercase agent names as you type in the register dialog#324
abeldantas merged 5 commits into
mainfrom
feat/lowercase-agent-name

Conversation

@abeldantas

@abeldantas abeldantas commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Auto-lowercases agent names on input in both the gateway's RegisterAgentDialog and the Console's New Agent dialog (configure-agent-panel).
  • Uses ASCII-only lowercasing (replace A-Z) rather than full Unicode toLowerCase(), since agent names are ASCII-only per the backend validator.

The Console dialog was the original surface that motivated this — uppercase names were accepted as typed but rejected on submit. The gateway dialog was a sibling surface with the same gap.

Test plan

  • Type an uppercase name in either dialog — it lowercases as you type, no cursor jump.
  • Gateway typecheck clean (npx tsc --noEmit).

Instead of rejecting uppercase characters after submission,
the register-agent dialog now lowercases the name as the user
types, matching the server's requirement silently.
Copilot AI lite review requested due to automatic review settings August 31, 2026 16:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the Switch Gateway “Register Agent” dialog to normalize agent names to lowercase at input time, improving UX by preventing uppercase characters from being submitted and rejected later.

Changes:

  • Lowercase the agent name as the user types in the registration dialog.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread gateway/src/pages/agents/RegisterAgentDialog.tsx Outdated
Full Unicode toLowerCase() can change string length for some
characters (e.g. dotted İ → "i̇") and cause input glitches.
Agent names are ASCII-only per the backend validator, so only
downcase A-Z.
The Console's add-agent modal was the original surface where uppercase
names caused validation friction. Apply the same ASCII-only lowercasing
as the gateway's RegisterAgentDialog so both dialogs behave the same.
@abeldantas abeldantas changed the title feat(gateway): auto-lowercase agent name on input Lowercase agent names as you type in the register dialog Aug 31, 2026
…name

# Conflicts:
#	console/apps/switch-console-desktop/src/renderer/features/locations/components/add-agent-modal/configure-agent-panel.tsx
@abeldantas
abeldantas merged commit 6e0a495 into main Sep 4, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants