Feature: Agent can self-schedule workflow #217
Merged
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.
closes #189
The goal of this PR was to introduce the first step in agent-driven scheduling of tasks. With this update, an agent has the option to
selfSchedule
which will return a next suggested prompt and how long to wait until running the workflow again. This system is an improvement over the interval driven current approach, but will need to be upgraded to be able to take other actions while waiting. This will likely be implemented with a message queue system of some sort, to be determined.Key Changes:
Workflow Node and Prompt Updates:
Replaced
workflowSummaryNode
withfinishWorkflowNode
in the orchestration workflow. This includes changes insrc/agents/workflows/orchestrator/nodes.ts
,src/agents/workflows/orchestrator/orchestratorWorkflow.ts
, andsrc/agents/workflows/orchestrator/prompts.ts
. [1] [2] [3] [4] [5]Added
finishWorkflowNode
implementation insrc/agents/workflows/orchestrator/nodes/finishWorkflowNode.ts
, which includes logic for parsing the finished workflow and logging errors.Created a new prompt for finishing workflows in
src/agents/workflows/orchestrator/nodes/finishWorkflowPrompt.ts
, including detailed instructions for summarizing the workflow and handling self-scheduling.Type and Configuration Updates:
Updated the
OrchestratorConfig
andOrchestratorState
types to includefinishWorkflowPrompt
andfinishedWorkflow
respectively insrc/agents/workflows/orchestrator/types.ts
. [1] [2]Modified the
createPrompts
function to support the newfinishWorkflowPrompt
and added aselfSchedule
option insrc/agents/workflows/orchestrator/prompts.ts
.Cleanup and Removal:
workflowSummaryNode
and its associated prompt from the codebase, including deletions insrc/agents/workflows/orchestrator/nodes/workflowSummaryNode.ts
andsrc/agents/workflows/orchestrator/nodes/workflowSummaryPrompt.ts
. [1] [2]These changes collectively enhance the workflow orchestration system by introducing a more detailed and flexible node for finishing workflows, along with corresponding prompt updates and type adjustments.