Feature: Execution environment project-level override reaches resolver
  Verifies that project_env threaded through ToolCallRouter
  is forwarded to the ExecutionEnvironmentResolver inside
  ToolRunner.execute(), where it is used at precedence level 2.

  Issue #1080: execution environment resolution does not honour
  project-level override (precedence level 2).

  @tdd_issue @tdd_issue_4248 @tdd_expected_fail
  Scenario: ToolCallRouter forwards project_env to resolver
    Given ee1080- a tool registry with a registered echo tool
    And ee1080- a tool runner and resolver spy
    And ee1080- a ToolCallRouter with project_env "container"
    When ee1080- I route a tool call through the router
    Then ee1080- the resolver should have received project_env "container"

  @tdd_issue @tdd_issue_4248 @tdd_expected_fail
  Scenario: ToolCallRouter forwards plan_env to resolver
    Given ee1080- a tool registry with a registered echo tool
    And ee1080- a tool runner and resolver spy
    And ee1080- a ToolCallRouter with plan_env "host"
    When ee1080- I route a tool call through the router
    Then ee1080- the resolver should have received plan_env "host"

  @tdd_issue @tdd_issue_4248 @tdd_expected_fail
  Scenario: ToolCallRouter forwards both plan_env and project_env
    Given ee1080- a tool registry with a registered echo tool
    And ee1080- a tool runner and resolver spy
    And ee1080- a ToolCallRouter with both plan_env "host" and project_env "container"
    When ee1080- I route a tool call through the router
    Then ee1080- the resolver should have received plan_env "host"
    And ee1080- the resolver should have received project_env "container"

  @tdd_issue @tdd_issue_4248 @tdd_expected_fail
  Scenario: ToolCallRouter without env params passes None to resolver
    Given ee1080- a tool registry with a registered echo tool
    And ee1080- a tool runner and resolver spy
    And ee1080- a ToolCallRouter without env params
    When ee1080- I route a tool call through the router
    Then ee1080- the resolver should have received plan_env "None"
    And ee1080- the resolver should have received project_env "None"
