Files
cleveragents-core/features/actor_add_name_positional.feature
Dev User 23e9848f95 fix(cli): make actor NAME argument optional, derive from YAML config
Implement NAME argument as optional with derivation from config file when not provided.

Changes:
- actor.py: NAME argument changed from required 'str' to optional 'str | None = None'
- Added help text explaining NAME can be omitted and derived from config
- Added logic to derive name from config_blob.get('name') when name arg is None
- Raises BadParameter if neither name argument nor config 'name' field is provided
- Updated docstring signature to reflect optional NAME: 'agents actor add [--config|-c <FILE>] [<NAME>]'
- Updated examples to show config-only usage

ISSUES CLOSED: #4186
2026-05-07 20:05:33 +00:00

33 lines
1.6 KiB
Gherkin

Feature: agents actor add NAME positional argument
As a user of the CleverAgents CLI
I want to pass the actor name as a positional argument to `agents actor add`
So that the CLI matches the spec synopsis: agents actor add --config <FILE> [<NAME>]
@tdd_issue @tdd_issue_4230 @tdd_expected_fail
Scenario: actor add accepts NAME as positional argument
Given an actor CLI runner
And I have an actor JSON config file without a name field
When I run actor add with NAME positional argument and config
Then the actor add should succeed with the positional name
@tdd_issue @tdd_issue_4230 @tdd_expected_fail
Scenario: actor add NAME positional argument takes precedence over config name
Given an actor CLI runner
And I have an actor JSON config file with a different name
When I run actor add with NAME positional argument overriding config name
Then the actor add should use the positional NAME not the config name
@tdd_issue @tdd_issue_4186
Scenario: actor add without NAME positional argument uses config name
Given an actor CLI runner
And I have an actor JSON config file with name "local/config-derived-actor"
When I run actor add with config but no NAME positional argument
Then the actor add should succeed using the config name
@tdd_issue @tdd_issue_4186
Scenario: actor add without NAME and without config name field raises BadParameter
Given an actor CLI runner
And I have an actor JSON config file without a name field
When I run actor add with config but no NAME positional argument
Then the actor add should fail with a BadParameter error about missing actor name