diff --git a/agent/open-code/index.ts b/agent/open-code/index.ts index 2ba2b72..4247e1e 100644 --- a/agent/open-code/index.ts +++ b/agent/open-code/index.ts @@ -4,7 +4,10 @@ import { planner } from "./nodes/planner"; import { interrupt } from "./nodes/interrupt"; import { executor } from "./nodes/executor"; -function handleRoutingFromExecutor(state: OpenCodeState): "executor" | "interrupt" {} +function handleRoutingFromExecutor(state: OpenCodeState): "executor" | "interrupt" { + const lastAIMessage = state.messages.findLast((m) => m.getType() === "ai"); + if (lastAIMessage) +} function handleRoutingFromInterrupt(state: OpenCodeState): "executor" | typeof END {} diff --git a/agent/open-code/types.ts b/agent/open-code/types.ts index 4b87557..a9594e3 100644 --- a/agent/open-code/types.ts +++ b/agent/open-code/types.ts @@ -5,6 +5,7 @@ export const OpenCodeAnnotation = Annotation.Root({ messages: GenerativeUIAnnotation.spec.messages, ui: GenerativeUIAnnotation.spec.ui, timestamp: GenerativeUIAnnotation.spec.timestamp, + next: Annotation<"executor" | "interrupt"> }); export type OpenCodeState = typeof OpenCodeAnnotation.State;