fix(plan-lifecycle): record prompt_definition as root decision during Strategize #9195
@@ -0,0 +1,15 @@
|
||||
Feature: Plan Lifecycle Decision Root Type
|
||||
As a developer
|
||||
I want to ensure that the root decision recorded during start_strategize is prompt_definition
|
||||
So that the decision tree has the correct root node type
|
||||
|
||||
Background:
|
||||
Given I have a plan lifecycle service with decision service
|
||||
|
||||
Scenario: start_strategize records prompt_definition as root decision
|
||||
Given an action "local/test-action" with description "Test action description"
|
||||
And a plan created from "local/test-action"
|
||||
When I start strategize on the plan
|
||||
Then the root decision should be recorded with type "prompt_definition"
|
||||
And the root decision question should be "What is the plan prompt?"
|
||||
And the root decision chosen_option should contain the plan description
|
||||
@@ -1387,11 +1387,14 @@ class PlanLifecycleService:
|
||||
self._commit_plan(plan)
|
||||
self._logger.info("Strategize started", plan_id=plan_id)
|
||||
|
||||
# Record the root decision: prompt_definition
|
||||
# This represents the plan's prompt/description and is the
|
||||
# root of the decision tree
|
||||
self._try_record_decision(
|
||||
plan_id=plan_id,
|
||||
decision_type="strategy_choice",
|
||||
question="Which strategy should the plan follow?",
|
||||
chosen_option=f"Begin strategize phase for plan {plan_id}",
|
||||
decision_type="prompt_definition",
|
||||
question="What is the plan prompt?",
|
||||
chosen_option=plan.description or plan.action_name or plan_id,
|
||||
)
|
||||
|
||||
return plan
|
||||
|
||||
Reference in New Issue
Block a user