MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / runHeadlessHyperPlanTurn

Function runHeadlessHyperPlanTurn

projects/openade-module/src/node.ts:791–906  ·  view source on GitHub ↗
({
    server,
    writer,
    agentExecutor,
    repoId,
    task,
    taskId,
    eventId,
    strategy,
    cwd,
    taskDescription,
    appendSystemPrompt,
    thinking,
    fastMode,
    runtimeId,
    activeTaskExecutions,
}: {
    server?: RuntimeServer
    writer: ReturnType<typeof createOpenADEYjsWriter>
    agentExecutor: RuntimeNodeAgentExecutor
    repoId: string
    task: OpenADETask
    taskId: string
    eventId: string
    strategy: OpenADEHyperPlanStrategy
    cwd: string
    taskDescription: string
    appendSystemPrompt?: string
    thinking?: OpenADETurnStartRequest["thinking"]
    fastMode?: boolean
    runtimeId: string
    activeTaskExecutions: Map<string, ActiveTaskExecution>
})

Source from the content-addressed store, hash-verified

789}
790
791async function runHeadlessHyperPlanTurn({
792 server,
793 writer,
794 agentExecutor,
795 repoId,
796 task,
797 taskId,
798 eventId,
799 strategy,
800 cwd,
801 taskDescription,
802 appendSystemPrompt,
803 thinking,
804 fastMode,
805 runtimeId,
806 activeTaskExecutions,
807}: {
808 server?: RuntimeServer
809 writer: ReturnType<typeof createOpenADEYjsWriter>
810 agentExecutor: RuntimeNodeAgentExecutor
811 repoId: string
812 task: OpenADETask
813 taskId: string
814 eventId: string
815 strategy: OpenADEHyperPlanStrategy
816 cwd: string
817 taskDescription: string
818 appendSystemPrompt?: string
819 thinking?: OpenADETurnStartRequest["thinking"]
820 fastMode?: boolean
821 runtimeId: string
822 activeTaskExecutions: Map<string, ActiveTaskExecution>
823}): Promise<void> {
824 const stepResults = new Map<string, string>()
825 const stepSessionIds = new Map<string, string>()
826 const mainThreadContextXml = taskReviewThreadXml(task)
827 let terminalSuccess = false
828 let finalized = false
829
830 const finalize = async (status: "completed" | "failed" | "stopped", error?: string) => {
831 if (finalized) return
832 finalized = true
833
834 if (status === "completed") {
835 await writer.completeActionEvent({ taskId, eventId, success: terminalSuccess })
836 const runtime = server?.supervisor.update(runtimeId, { status: "completed" })
837 server?.notify("runtime/completed", runtime)
838 } else if (status === "stopped") {
839 await writer.stoppedActionEvent({ taskId, eventId })
840 const runtime = server?.supervisor.update(runtimeId, { status: "stopped", error })
841 server?.notify("runtime/stopped", runtime)
842 } else {
843 await writer.errorActionEvent({ taskId, eventId })
844 const runtime = server?.supervisor.update(runtimeId, { status: "failed", error })
845 server?.notify("runtime/failed", runtime)
846 }
847
848 activeTaskExecutions.delete(taskId)

Callers 1

startHyperPlanFunction · 0.85

Calls 6

runHeadlessHyperPlanStepFunction · 0.85
taskReviewThreadXmlFunction · 0.70
finalizeFunction · 0.70
getMethod · 0.65
setMethod · 0.65

Tested by

no test coverage detected