File tree Expand file tree Collapse file tree 5 files changed +15
-6
lines changed
Expand file tree Collapse file tree 5 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1- import { finishAgentRun , startAgentRun } from '../agent-run'
1+ import { addAgentStep , finishAgentRun , startAgentRun } from '../agent-run'
22import { logger } from '../util/logger'
33
44import type { AgentRuntimeDeps } from '@codebuff/types/deps/agent-runtime'
@@ -8,4 +8,5 @@ export const backendAgentRuntimeImpl: AgentRuntimeDeps = {
88
99 startAgentRun,
1010 finishAgentRun,
11+ addAgentStep,
1112}
Original file line number Diff line number Diff line change @@ -7,7 +7,6 @@ import { buildArray } from '@codebuff/common/util/array'
77import { getErrorObject } from '@codebuff/common/util/error'
88import { cloneDeep } from 'lodash'
99
10- import { addAgentStep , finishAgentRun } from './agent-run'
1110import { checkLiveUserInput } from './live-user-inputs'
1211import { getMCPToolData } from './mcp/util'
1312import { getAgentStreamFromTemplate } from './prompt-agent-stream'
@@ -46,6 +45,7 @@ import type {
4645import type { ProjectFileContext } from '@codebuff/common/util/file'
4746import type { ParamsExcluding } from '@codebuff/types/common'
4847import type {
48+ AddAgentStepFn ,
4949 FinishAgentRunFn ,
5050 StartAgentRunFn ,
5151} from '@codebuff/types/database'
@@ -428,6 +428,7 @@ export const loopAgentSteps = async (
428428
429429 startAgentRun : StartAgentRunFn
430430 finishAgentRun : FinishAgentRunFn
431+ addAgentStep : AddAgentStepFn
431432 logger : Logger
432433 } & ParamsExcluding <
433434 typeof runProgrammaticStep ,
@@ -460,6 +461,8 @@ export const loopAgentSteps = async (
460461 clearUserPromptMessagesAfterResponse = true ,
461462 parentSystemPrompt,
462463 startAgentRun,
464+ finishAgentRun,
465+ addAgentStep,
463466 logger,
464467 } = params
465468
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ export const testLogger: Logger = {
1111export const testAgentRuntimeImpl : AgentRuntimeDeps = {
1212 logger : testLogger ,
1313
14- startAgentRun : async ( ) => {
15- return 'test-agent-run-id'
16- } ,
14+ startAgentRun : async ( ) => 'test-agent-run-id' ,
1715 finishAgentRun : async ( ) => { } ,
16+ addAgentStep : async ( ) => 'test-agent-step-id' ,
1817}
Original file line number Diff line number Diff line change @@ -5,4 +5,5 @@ export const evalAgentRuntimeImpl: AgentRuntimeDeps = {
55
66 startAgentRun : async ( ) => 'test-agent-run-id' ,
77 finishAgentRun : async ( ) => { } ,
8+ addAgentStep : async ( ) => 'test-agent-step-id' ,
89}
Original file line number Diff line number Diff line change 1- import type { FinishAgentRunFn , StartAgentRunFn } from '../database'
1+ import type {
2+ AddAgentStepFn ,
3+ FinishAgentRunFn ,
4+ StartAgentRunFn ,
5+ } from '../database'
26import type { Logger } from '../logger'
37
48export type AgentRuntimeDeps = {
59 logger : Logger
610
711 startAgentRun : StartAgentRunFn
812 finishAgentRun : FinishAgentRunFn
13+ addAgentStep : AddAgentStepFn
914}
You can’t perform that action at this time.
0 commit comments