UAT: LLMStrategizeActor ignores plan.strategy_actor — resolves actor name from action YAML instead of the plan's configured actor #3982

Open
opened 2026-04-06 08:16:01 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/llm-strategize-actor-resolution
  • Commit Message: fix(llm-actors): resolve strategy actor from plan.strategy_actor, not action YAML
  • Milestone: None (Backlog)
  • Parent Epic: #397

Backlog note: This issue was discovered during UAT of the Estimation and Planning Intelligence feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment.


Bug Report

Feature Area: Estimation and Planning Intelligence — Strategize Phase LLM Integration
Severity: Medium — --strategy-actor CLI override is silently ignored during LLM strategize
Found by: UAT tester (code-level analysis)


Background and Context

The spec defines that agents plan use accepts a --strategy-actor ACTOR flag to override the action's default strategy actor for a specific plan invocation. The Plan domain model stores strategy_actor: str | None to capture this override.

The spec states:

"The strategy actor produces the initial decision tree — strategy choices, invariant enforcement records, resource selections, child plan blueprints"

Current Behavior

In LLMStrategizeActor.execute() (src/cleveragents/application/services/llm_actors.py, lines ~96-105), the actor name is resolved from the action YAML, not from the plan's strategy_actor field:

# Resolve actor name from plan → action
plan = self._lifecycle.get_plan(plan_id)
action = self._lifecycle.get_action(plan.action_name)
actor_name = action.strategy_actor or "openai/gpt-4"  # <-- reads from action, not plan

This means:

  1. When a user runs agents plan use my-action my-project --strategy-actor anthropic/claude-3.5-sonnet, the plan.strategy_actor is set to "anthropic/claude-3.5-sonnet"
  2. But LLMStrategizeActor ignores plan.strategy_actor and reads action.strategy_actor instead
  3. The plan always uses the action's default strategy actor, never the plan-level override

The same issue exists in LLMExecuteActor.execute() for the execution actor.

Expected Behavior (per spec)

The resolution order should follow the spec's precedence chain: plan > action > default:

# Correct resolution: plan.strategy_actor takes precedence over action.strategy_actor
actor_name = plan.strategy_actor or action.strategy_actor or "openai/gpt-4"

Code Location

  • File: src/cleveragents/application/services/llm_actors.py
  • LLMStrategizeActor.execute(): Lines ~96-105 — reads action.strategy_actor
  • LLMExecuteActor.execute(): Lines ~230-239 — reads action.execution_actor

Steps to Reproduce

  1. Create an action with strategy_actor: openai/gpt-4
  2. Use the action with an override: agents plan use my-action my-project --strategy-actor anthropic/claude-3.5-sonnet
  3. Execute the plan: agents plan execute <PLAN_ID>
  4. Observe: The plan uses openai/gpt-4 (from action), not anthropic/claude-3.5-sonnet (from plan override)

Subtasks

  • Fix LLMStrategizeActor.execute() to use plan.strategy_actor or action.strategy_actor or default
  • Fix LLMExecuteActor.execute() to use plan.execution_actor or action.execution_actor or default
  • Add unit tests (Behave feature file) verifying plan-level actor override takes precedence
  • Verify existing tests still pass

Definition of Done

  • LLMStrategizeActor uses plan.strategy_actor when set, falling back to action.strategy_actor
  • LLMExecuteActor uses plan.execution_actor when set, falling back to action.execution_actor
  • --strategy-actor CLI override is correctly honored during LLM strategize execution
  • All existing tests pass
  • New tests cover the plan-level actor override path
  • PR merged and issue closed

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/llm-strategize-actor-resolution` - **Commit Message**: `fix(llm-actors): resolve strategy actor from plan.strategy_actor, not action YAML` - **Milestone**: None (Backlog) - **Parent Epic**: #397 > **Backlog note:** This issue was discovered during UAT of the Estimation and Planning Intelligence feature area. It does not block milestone completion and has been placed in the backlog for human review and future milestone assignment. --- ## Bug Report **Feature Area:** Estimation and Planning Intelligence — Strategize Phase LLM Integration **Severity:** Medium — `--strategy-actor` CLI override is silently ignored during LLM strategize **Found by:** UAT tester (code-level analysis) --- ## Background and Context The spec defines that `agents plan use` accepts a `--strategy-actor ACTOR` flag to override the action's default strategy actor for a specific plan invocation. The `Plan` domain model stores `strategy_actor: str | None` to capture this override. The spec states: > "The strategy actor produces the initial decision tree — strategy choices, invariant enforcement records, resource selections, child plan blueprints" ## Current Behavior In `LLMStrategizeActor.execute()` (`src/cleveragents/application/services/llm_actors.py`, lines ~96-105), the actor name is resolved from the **action YAML**, not from the **plan's `strategy_actor` field**: ```python # Resolve actor name from plan → action plan = self._lifecycle.get_plan(plan_id) action = self._lifecycle.get_action(plan.action_name) actor_name = action.strategy_actor or "openai/gpt-4" # <-- reads from action, not plan ``` This means: 1. When a user runs `agents plan use my-action my-project --strategy-actor anthropic/claude-3.5-sonnet`, the `plan.strategy_actor` is set to `"anthropic/claude-3.5-sonnet"` 2. But `LLMStrategizeActor` ignores `plan.strategy_actor` and reads `action.strategy_actor` instead 3. The plan always uses the action's default strategy actor, never the plan-level override The same issue exists in `LLMExecuteActor.execute()` for the execution actor. ## Expected Behavior (per spec) The resolution order should follow the spec's precedence chain: **plan > action > default**: ```python # Correct resolution: plan.strategy_actor takes precedence over action.strategy_actor actor_name = plan.strategy_actor or action.strategy_actor or "openai/gpt-4" ``` ## Code Location - **File**: `src/cleveragents/application/services/llm_actors.py` - **`LLMStrategizeActor.execute()`**: Lines ~96-105 — reads `action.strategy_actor` - **`LLMExecuteActor.execute()`**: Lines ~230-239 — reads `action.execution_actor` ## Steps to Reproduce 1. Create an action with `strategy_actor: openai/gpt-4` 2. Use the action with an override: `agents plan use my-action my-project --strategy-actor anthropic/claude-3.5-sonnet` 3. Execute the plan: `agents plan execute <PLAN_ID>` 4. Observe: The plan uses `openai/gpt-4` (from action), not `anthropic/claude-3.5-sonnet` (from plan override) ## Subtasks - [ ] Fix `LLMStrategizeActor.execute()` to use `plan.strategy_actor or action.strategy_actor or default` - [ ] Fix `LLMExecuteActor.execute()` to use `plan.execution_actor or action.execution_actor or default` - [ ] Add unit tests (Behave feature file) verifying plan-level actor override takes precedence - [ ] Verify existing tests still pass ## Definition of Done - `LLMStrategizeActor` uses `plan.strategy_actor` when set, falling back to `action.strategy_actor` - `LLMExecuteActor` uses `plan.execution_actor` when set, falling back to `action.execution_actor` - `--strategy-actor` CLI override is correctly honored during LLM strategize execution - All existing tests pass - New tests cover the plan-level actor override path - PR merged and issue closed --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
HAL9000 added this to the v3.5.0 milestone 2026-04-09 03:12:24 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#3982
No description provided.