Skip to content

Commit

Permalink
Merge pull request #60 from z-korp/fix/cot-goals-init
Browse files Browse the repository at this point in the history
fix: initialize goals without dependencies as ready
  • Loading branch information
ponderingdemocritus authored Jan 28, 2025
2 parents 0bc8420 + a8f482b commit 82d31fa
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/core/src/core/chain-of-thought.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ export class ChainOfThought extends EventEmitter {
.map((id) => this.goalManager.getGoalById(id))
.filter((g): g is Goal => !!g);

// Update goals with no dependencies to ready
for (const goal of finalGoals) {
if (goal.dependencies && goal.dependencies.length === 0) {
this.goalManager.updateGoalStatus(goal.id, "ready");
}
}

// Add a planning step
this.recordReasoningStep(
`Strategy planned for objective: ${objective}`,
Expand Down

0 comments on commit 82d31fa

Please sign in to comment.