feat: Implement Plan-and-Reflect Autonomous Loop#91
Open
Gdub662 wants to merge 1 commit intobytebot-ai:mainfrom
Open
feat: Implement Plan-and-Reflect Autonomous Loop#91Gdub662 wants to merge 1 commit intobytebot-ai:mainfrom
Gdub662 wants to merge 1 commit intobytebot-ai:mainfrom
Conversation
This commit introduces a significant architectural enhancement to the Bytebot agent, moving it from a purely reactive model to a proactive, plan-driven autonomous system.
The core changes include:
1. **PlannerService**: A new service that uses an LLM to break down high-level user requests into a concrete, step-by-step plan.
2. **ReflectorService**: A new service that evaluates the outcome of each executed step. It determines if a step was successful, failed, or needs to be retried, enabling self-correction.
3. **Plan-and-Execute Loop**: The `AgentProcessor` has been refactored to orchestrate the new autonomous loop. It now generates a plan, executes it step-by-step, and reflects on each outcome to decide the next action.
4. **Database Schema**: The `Task` model in the Prisma schema has been updated to store the `plan` and the current `planStep`, making the agent's state more robust and resumable.
5. **Testing**:
* The Jest configuration has been fixed to work correctly in the monorepo environment.
* A new unit test for the `PlannerService` has been added, which uncovered and led to a fix for a bug in handling empty LLM responses.
This new architecture provides a strong foundation for future autonomous capabilities, such as more advanced planning, memory, and self-optimization.
sewerynek1
reviewed
Sep 5, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a significant architectural enhancement to the Bytebot agent, moving it from a purely reactive model to a proactive, plan-driven autonomous system.
The core changes include:
PlannerService: A new service that uses an LLM to break down high-level user requests into a concrete, step-by-step plan.
ReflectorService: A new service that evaluates the outcome of each executed step. It determines if a step was successful, failed, or needs to be retried, enabling self-correction.
Plan-and-Execute Loop: The
AgentProcessorhas been refactored to orchestrate the new autonomous loop. It now generates a plan, executes it step-by-step, and reflects on each outcome to decide the next action.Database Schema: The
Taskmodel in the Prisma schema has been updated to store theplanand the currentplanStep, making the agent's state more robust and resumable.Testing:
PlannerServicehas been added, which uncovered and led to a fix for a bug in handling empty LLM responses.This new architecture provides a strong foundation for future autonomous capabilities, such as more advanced planning, memory, and self-optimization.