[BUG] agents plan use leaves plan in strategize/queued — Strategize phase never auto-starts #9188

Open
opened 2026-04-14 09:48:28 +00:00 by hurui200320 · 2 comments
Member

Metadata

  • Branch: fix/plan-use-strategize-never-auto-starts
  • Commit Message: fix(plan): auto-start Strategize phase after agents plan use instead of leaving plan in queued state
  • Milestone: v3.2.0
  • Parent Epic: TBD — requires manual linking

Description

Background

agents plan use is the entry point for the four-phase plan lifecycle (Action → Strategize → Execute → Apply). Per the spec (agents plan use section): "Apply an action to one or more projects and start the Strategize phase." The Strategize phase is intended to be a read-only, inspectable phase where the system builds a decision tree before any execution begins — this separation is a core design guarantee.

Current Behavior

After running:

agents plan use <action> <project> --automation-profile trusted

the plan is created but its processing_state is permanently queued. The Strategize phase never starts automatically. The CLI output itself confirms this:

Plan is now in Strategize phase (queued). Run 'agents plan execute <id>' when ready.

Polling agents plan status <PLAN_ID> repeatedly confirms the state stays strategize/queued indefinitely — it never transitions to running or completed on its own.

Additional observation: Running agents plan execute <PLAN_ID> drives both the Strategize phase AND the Execute phase in a single call — both phases complete within that one command. This indicates either the phase model has been collapsed, or the async worker responsible for auto-starting Strategize is not running.

Actual flow observed:

  1. agents plan use ... → plan created, state: strategize/queued (no auto-start)
  2. agents plan status <ID>phase: strategize, state: queued (indefinitely)
  3. agents plan tree <ID> → "No decisions found"
  4. agents plan execute <ID> → drives both Strategize and Execute, then execute/complete

Reproduction steps:

  1. agents resource add git-checkout local/rune-project --path /workspace/rune
  2. agents project create --resource local/rune-project local/rune-encoder
  3. agents action create --config /workspace/build-rune-encoder.yaml
  4. agents plan use local/build-rune-encoder local/rune-encoder --automation-profile trusted
  5. Wait 60+ seconds, then agents plan status <PLAN_ID> → state remains strategize/queued
  6. agents plan tree <PLAN_ID> → "No decisions found"

Expected Behavior

Per spec §agents plan use: "Apply an action to one or more projects and start the Strategize phase."

The Strategize phase should begin automatically after plan use, with agents plan status showing phase: strategize, state: running (and eventually completed) without any additional commands. Only then should agents plan execute be needed to advance to the Execute phase.

Expected flow per spec:

  1. agents plan use ... → plan created, Strategize starts automatically
  2. agents plan status <ID>phase: strategize, state: running or completed
  3. agents plan tree <ID> → decision tree populated
  4. agents plan execute <ID> → Execute phase starts

Acceptance Criteria

  • After agents plan use, the plan's Strategize phase starts automatically (state transitions from queuedrunningcompleted without any additional commands)
  • agents plan status <ID> shows phase: strategize, state: running (or completed) after plan use completes
  • agents plan tree <ID> returns a populated decision tree after Strategize completes
  • agents plan execute <ID> only drives the Execute phase (not Strategize), consistent with the four-phase model
  • The CLI output of agents plan use does not instruct the user to run agents plan execute to start Strategize

Supporting Information

  • Related issue (distinct bug): #5426 — covers plans stuck in Strategize/PROCESSING being invisible to auto-discovery; that is a filtering bug, not the Strategize auto-start failure described here.
  • Spec reference: docs/specification.md §agents plan use"Apply an action to one or more projects and start the Strategize phase."

Subtasks

  • Identify root cause: determine whether the async worker for Strategize auto-start is missing, disabled, or the phase model has been collapsed in plan use implementation
  • Restore or implement the Strategize auto-start trigger in the plan use command handler / service layer
  • Ensure agents plan execute only drives the Execute phase (not Strategize) after the fix
  • Update CLI output of agents plan use to reflect correct next-step messaging (remove instruction to run plan execute to start Strategize)
  • Tests: add/update BDD scenarios covering the plan use → Strategize auto-start → plan tree populated flow
  • Tests: add/update unit tests for the Strategize auto-start trigger
  • Run nox (all default sessions), fix any errors
  • Verify coverage >= 97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.
## Metadata - **Branch**: `fix/plan-use-strategize-never-auto-starts` - **Commit Message**: `fix(plan): auto-start Strategize phase after agents plan use instead of leaving plan in queued state` - **Milestone**: v3.2.0 - **Parent Epic**: TBD — requires manual linking ## Description ### Background `agents plan use` is the entry point for the four-phase plan lifecycle (Action → Strategize → Execute → Apply). Per the spec (`agents plan use` section): *"Apply an action to one or more projects and start the Strategize phase."* The Strategize phase is intended to be a read-only, inspectable phase where the system builds a decision tree before any execution begins — this separation is a core design guarantee. ### Current Behavior After running: ``` agents plan use <action> <project> --automation-profile trusted ``` the plan is created but its `processing_state` is permanently `queued`. The Strategize phase never starts automatically. The CLI output itself confirms this: ``` Plan is now in Strategize phase (queued). Run 'agents plan execute <id>' when ready. ``` Polling `agents plan status <PLAN_ID>` repeatedly confirms the state stays `strategize/queued` indefinitely — it never transitions to `running` or `completed` on its own. **Additional observation:** Running `agents plan execute <PLAN_ID>` drives **both** the Strategize phase AND the Execute phase in a single call — both phases complete within that one command. This indicates either the phase model has been collapsed, or the async worker responsible for auto-starting Strategize is not running. **Actual flow observed:** 1. `agents plan use ...` → plan created, state: `strategize/queued` (no auto-start) 2. `agents plan status <ID>` → `phase: strategize, state: queued` (indefinitely) 3. `agents plan tree <ID>` → "No decisions found" 4. `agents plan execute <ID>` → drives **both** Strategize and Execute, then `execute/complete` **Reproduction steps:** 1. `agents resource add git-checkout local/rune-project --path /workspace/rune` 2. `agents project create --resource local/rune-project local/rune-encoder` 3. `agents action create --config /workspace/build-rune-encoder.yaml` 4. `agents plan use local/build-rune-encoder local/rune-encoder --automation-profile trusted` 5. Wait 60+ seconds, then `agents plan status <PLAN_ID>` → state remains `strategize/queued` 6. `agents plan tree <PLAN_ID>` → "No decisions found" ### Expected Behavior Per spec §`agents plan use`: *"Apply an action to one or more projects and start the Strategize phase."* The Strategize phase should begin automatically after `plan use`, with `agents plan status` showing `phase: strategize, state: running` (and eventually `completed`) without any additional commands. Only then should `agents plan execute` be needed to advance to the Execute phase. **Expected flow per spec:** 1. `agents plan use ...` → plan created, Strategize starts automatically 2. `agents plan status <ID>` → `phase: strategize, state: running` or `completed` 3. `agents plan tree <ID>` → decision tree populated 4. `agents plan execute <ID>` → Execute phase starts ### Acceptance Criteria - [ ] After `agents plan use`, the plan's Strategize phase starts automatically (state transitions from `queued` → `running` → `completed` without any additional commands) - [ ] `agents plan status <ID>` shows `phase: strategize, state: running` (or `completed`) after `plan use` completes - [ ] `agents plan tree <ID>` returns a populated decision tree after Strategize completes - [ ] `agents plan execute <ID>` only drives the Execute phase (not Strategize), consistent with the four-phase model - [ ] The CLI output of `agents plan use` does not instruct the user to run `agents plan execute` to start Strategize ### Supporting Information - **Related issue (distinct bug):** #5426 — covers plans stuck in `Strategize/PROCESSING` being invisible to auto-discovery; that is a filtering bug, not the Strategize auto-start failure described here. - **Spec reference:** `docs/specification.md` §`agents plan use` — *"Apply an action to one or more projects and start the Strategize phase."* ## Subtasks - [ ] Identify root cause: determine whether the async worker for Strategize auto-start is missing, disabled, or the phase model has been collapsed in `plan use` implementation - [ ] Restore or implement the Strategize auto-start trigger in the `plan use` command handler / service layer - [ ] Ensure `agents plan execute` only drives the Execute phase (not Strategize) after the fix - [ ] Update CLI output of `agents plan use` to reflect correct next-step messaging (remove instruction to run `plan execute` to start Strategize) - [ ] Tests: add/update BDD scenarios covering the `plan use` → Strategize auto-start → `plan tree` populated flow - [ ] Tests: add/update unit tests for the Strategize auto-start trigger - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >= 97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%.
hurui200320 added this to the v3.2.0 milestone 2026-04-14 09:48:48 +00:00
Owner

@hurui200320 Thank you for this bug report.

Acknowledgment — Issue #9188

This issue has been received. The reported behavior — agents plan use leaving the plan in strategize/queued state without auto-starting the Strategize phase — has been logged.

Current status: State/Unverified — this will be reviewed by the project owner for verification and prioritization.

Next steps: The project owner will verify this issue. Given the Priority/High label, this should be addressed promptly once verified.


Automated by CleverAgents Bot
Supervisor: Human Liaison | Agent: human-liaison-pool-supervisor
Worker: [AUTO-HUMAN-7]

@hurui200320 Thank you for this bug report. **Acknowledgment — Issue #9188** This issue has been received. The reported behavior — `agents plan use` leaving the plan in strategize/queued state without auto-starting the Strategize phase — has been logged. **Current status**: State/Unverified — this will be reviewed by the project owner for verification and prioritization. **Next steps**: The project owner will verify this issue. Given the Priority/High label, this should be addressed promptly once verified. --- **Automated by CleverAgents Bot** Supervisor: Human Liaison | Agent: human-liaison-pool-supervisor Worker: [AUTO-HUMAN-7]
Owner

Triage: Verified [AUTO-OWNR-1]

This is a critical bug in the core plan lifecycle. Per the spec, agents plan use should start the Strategize phase automatically — the current behavior leaves plans permanently in strategize/queued state, breaking the four-phase lifecycle model. The additional observation that agents plan execute drives both Strategize and Execute phases in a single call confirms the async worker for Strategize auto-start is missing or disabled.

Assigning to v3.2.0 as this is a core plan lifecycle bug that must be resolved for M3's decision tree and invariant features to function correctly. Priority is High — this breaks the intended workflow.

MoSCoW: Must Have — the four-phase plan lifecycle is a core architectural guarantee. The milestone cannot be considered complete without this working correctly.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Triage: Verified** [AUTO-OWNR-1] This is a critical bug in the core plan lifecycle. Per the spec, `agents plan use` should start the Strategize phase automatically — the current behavior leaves plans permanently in `strategize/queued` state, breaking the four-phase lifecycle model. The additional observation that `agents plan execute` drives both Strategize and Execute phases in a single call confirms the async worker for Strategize auto-start is missing or disabled. Assigning to **v3.2.0** as this is a core plan lifecycle bug that must be resolved for M3's decision tree and invariant features to function correctly. Priority is **High** — this breaks the intended workflow. MoSCoW: **Must Have** — the four-phase plan lifecycle is a core architectural guarantee. The milestone cannot be considered complete without this working correctly. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#9188
No description provided.