Feature: Actor add CLI supports config-actor combined format (issue #11189)
  As a CleverAgents user
  I want `agents actor add --config` to accept the spec-compliant combined
  ``config.actor`` format so that nested config definitions work correctly.

  The combined format lets users specify all actor metadata inside a single
  ``config → actor`` block, either as a compact string (e.g. ``"aws/gpt-4"``)
  or as a nested dict with individual fields.

  Background:
    Given an actor CLI runner
    And a temporary directory for test actor configs

  # ────────────────────────────────────────────────────────────
  # Combined-Format String Actor Registration
  # ────────────────────────────────────────────────────────────

  Scenario: Register via combined-format string "provider/model"
    Given a v3 LLM actor YAML file with combined config.actor format "openai/gpt-4" and name "local/combined-string-llm"
    When I run the actor add command for "local/combined-string-llm" with the prepared config file
    Then v3actor the command should succeed
    And the actor should be registered with type "llm"

  Scenario: Fallback registration when combined-format lacks a top-level type
    Given a YAML config file with nested config format and combined string without explicit type
    When I run the actor add command for "local/nested-combined-llm" with the prepared config file
    Then v3actor the command should succeed

  # ─────────────────────────────────════════════════════════───
  # Combined-Format Nested-Dict Registration
  # ─────────────────────────────────════════════════════════───

  Scenario: Register via combined-format nested dict with type, provider and model
    Given a v3 LLM actor YAML file with nested config.actor format "anthropic/claude-haiku" and name "local/nested-dict-llm"
    When I run the actor add command for "local/nested-dict-llm" with the prepared config file
    Then v3actor the command should succeed
    And the actor should be registered with type "llm"

  # ─────────────────────────────────════════════════════════───
  # Top-level name extraction from combined format
  # ─────────────────────────────────════════════════════════───

  Scenario: Derive name from top-level 'name' field when config-actor is used
    Given a YAML config file with nested config and top-level name
    When I run the actor add command for "local/config-with-name" with the prepared config file
    Then v3actor the command should succeed

  Scenario: Reject when no name is available anywhere in combined format
    Given a YAML config file with nested config but no name anywhere
    When I run the actor add command without a name argument
    Then v3actor the command should fail
    And v3actor the error message should contain "Actor name is required"

