-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: initialize goals without dependencies as ready #60
fix: initialize goals without dependencies as ready #60
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
WalkthroughThe pull request introduces a new functionality in the Changes
Possibly related PRs
Poem
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
packages/core/src/core/chain-of-thought.ts (1)
272-277
: Consider additional conditions for goal readiness and emit events.The code correctly initializes goals without dependencies as "ready". However, consider these improvements:
- Add a comment explaining the logic for better maintainability.
- Consider additional conditions beyond just dependencies (e.g., required resources, prerequisites).
- Emit a "goal:status_updated" event to notify listeners of the status change.
Apply this diff to implement the suggested improvements:
// Update goals with no dependencies to ready for (const goal of finalGoals) { - if (goal.dependencies && goal.dependencies.length === 0) { + // A goal is ready if it has no dependencies and meets all prerequisites + if (goal.dependencies && goal.dependencies.length === 0 && this.arePrerequisitesMet(goal)) { this.goalManager.updateGoalStatus(goal.id, "ready"); + this.emit("goal:status_updated", { + id: goal.id, + status: "ready", + reason: "No dependencies and prerequisites met" + }); } }
Goals without dependencies are now initialized as "ready" instead of "pending". Previously, all goals defaulted to "pending", even those with no dependencies.
Summary by CodeRabbit