Files
temp/features/actor_list_empty.feature
T
Brent E. Edwards 73d5552467 fix(actor): handle empty actor list without validation error
ActorRegistry._actor_name() built names via f"{provider}/{model}", which
produced names with multiple slashes when providers included models
containing "/" (e.g. OpenRouter's "anthropic/claude-sonnet-4-20250514").
The resulting name violated the spec pattern ^[a-z0-9_-]+/[a-z0-9_-]+$
and triggered a ValidationError during actor upsert.

Now sanitises both provider and model components by replacing "/" with "-"
and lowercasing, so multi-slash provider models no longer break actor
listing.

Includes 6 Behave BDD regression scenarios (covering zero-provider,
multi-slash, consecutive-slash, leading-slash, and name-validation
cases), Robot Framework integration smoke tests, and ASV benchmarks.

ISSUES CLOSED: #592
2026-03-10 23:11:22 +00:00

55 lines
2.8 KiB
Gherkin

# Regression tests for bug #592: actor list must not raise a validation error.
Feature: Actor list on a fresh project shows no actors
As a developer using the agents CLI
I want "agents actor list" on a fresh project with no actors
So that I see a clean "no actors" message instead of a validation error
# Scenarios 1-2 test CLI rendering of an empty actor list using a
# fully-mocked registry. They verify the user-facing output, NOT the
# buggy code path (which is exercised by Scenario 3 and the edge-case
# scenarios below).
@tdd_bug @tdd_bug_592
Scenario: Actor list with no configured providers shows no actors message
Given the actor registry has no configured providers for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty output should contain "No actors"
And the actor-list-empty exit code should be 0
@tdd_bug @tdd_bug_592
Scenario: Actor list does not raise a validation error
Given the actor registry has no configured providers for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty output should not contain "VALIDATION_FAILED"
And the actor-list-empty output should not contain "must include exactly one"
And the actor-list-empty exit code should be 0
@tdd_bug @tdd_bug_592
Scenario: Actor list with a multi-slash model provider does not error
Given the actor registry has a provider with a multi-slash model for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty exit code should be 0
And the actor-list-empty output should not contain "VALIDATION_FAILED"
@tdd_bug @tdd_bug_592
Scenario: Actor list handles model name with consecutive slashes
Given the actor registry has a provider with model "a//b/c" for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty exit code should be 0
And the actor-list-empty output should not contain "VALIDATION_FAILED"
@tdd_bug @tdd_bug_592
Scenario: Actor list handles model name with leading slash
Given the actor registry has a provider with model "/leading-slash" for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty exit code should be 0
And the actor-list-empty output should not contain "VALIDATION_FAILED"
@tdd_bug @tdd_bug_592
Scenario: Listed actor name is a valid single-slash namespace/identifier
Given the actor registry has a provider with a multi-slash model for actor-list-empty
When I run actor list via the actor-list-empty CLI
Then the actor-list-empty exit code should be 0
And the upserted actor-list-empty actor name should contain exactly one slash
And the upserted actor-list-empty actor name should be "openrouter/anthropic-claude-sonnet-4-20250514"