Skip to content

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 11, 2026

Note

Description

This PR removes strict agent name validation and adds filesystem-safe filename generation. Previously, the CLI only accepted lowercase alphanumeric names with underscores (^[a-z0-9_]+$), but agents created via the AI builder can have names with uppercase letters, spaces, dashes, and other characters. This change allows any valid name while ensuring filesystem compatibility by converting names to safe slugs for file storage.

Related Issue

Companion to base44-dev/apper#3610 (server-side change)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Removed /^[a-z0-9_]+$/ regex validation from AgentConfigSchema - now allows any non-empty name (1-100 chars)
  • Added toFileSlug() function to convert agent names to filesystem-safe filenames (lowercase, alphanumeric + underscores)
  • Updated writeAgents() to use slugified filenames when writing/deleting agent config files
  • Updated comment in generateAgentConfigContent() to remove outdated naming constraint note
  • Updated test fixture to test empty name validation (the only remaining constraint)
  • Added .worktrees to .gitignore

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

Key change: Agent names can now include spaces, uppercase letters, and special characters (e.g., "My Custom Agent" or "GPT-4 Helper"), but will be stored as filesystem-safe filenames (e.g., my_custom_agent.jsonc, gpt_4_helper.jsonc). The validation now only prevents empty names and excessively long names (>100 chars).

This ensures the CLI can work seamlessly with agents created through the AI builder while maintaining filesystem compatibility across all platforms.


🤖 Generated by Claude | 2026-02-11 23:17 UTC

The `^[a-z0-9_]+$` regex constraint was too restrictive — agents created
via the AI builder can have names with uppercase, dashes, etc. This
aligns the CLI with the apper-side change (base44-dev/apper#3610) so
pull works for all existing agents.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Feb 11, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.31-pr.231.44bfbb1

Prefer not to change any import paths? Install using npm alias so your code still imports base44:

npm i "base44@npm:@base44-preview/cli@0.0.31-pr.231.44bfbb1"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.31-pr.231.44bfbb1"
  }
}

Preview published to npm registry — try new features instantly!

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@claude
Copy link

claude bot commented Feb 11, 2026

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

Agent names are no longer restricted to [a-z0-9_], so we need to
slugify them when creating/deleting local files on pull. The name
inside the JSON remains the source of truth.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.

1 participant