Skip to content

Commit aef8707

Browse files
committed
add finishAgentRun to AgentRuntimeDeps
1 parent 832b4fe commit aef8707

File tree

5 files changed

+11
-3
lines changed

5 files changed

+11
-3
lines changed

backend/src/impl/agent-runtime.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { startAgentRun } from '../agent-run'
1+
import { finishAgentRun, startAgentRun } from '../agent-run'
22
import { logger } from '../util/logger'
33

44
import type { AgentRuntimeDeps } from '@codebuff/types/deps/agent-runtime'
@@ -7,4 +7,5 @@ export const backendAgentRuntimeImpl: AgentRuntimeDeps = {
77
logger,
88

99
startAgentRun,
10+
finishAgentRun,
1011
}

backend/src/run-agent-step.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,10 @@ import type {
4545
} from '@codebuff/common/types/session-state'
4646
import type { ProjectFileContext } from '@codebuff/common/util/file'
4747
import type { ParamsExcluding } from '@codebuff/types/common'
48-
import type { StartAgentRunFn } from '@codebuff/types/database'
48+
import type {
49+
FinishAgentRunFn,
50+
StartAgentRunFn,
51+
} from '@codebuff/types/database'
4952
import type { Logger } from '@codebuff/types/logger'
5053
import type { WebSocket } from 'ws'
5154

@@ -424,6 +427,7 @@ export const loopAgentSteps = async (
424427
onResponseChunk: (chunk: string | PrintModeEvent) => void
425428

426429
startAgentRun: StartAgentRunFn
430+
finishAgentRun: FinishAgentRunFn
427431
logger: Logger
428432
} & ParamsExcluding<
429433
typeof runProgrammaticStep,

common/src/testing/impl/agent-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,5 @@ export const testAgentRuntimeImpl: AgentRuntimeDeps = {
1414
startAgentRun: async () => {
1515
return 'test-agent-run-id'
1616
},
17+
finishAgentRun: async () => {},
1718
}

evals/impl/agent-runtime.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ export const evalAgentRuntimeImpl: AgentRuntimeDeps = {
44
logger: console,
55

66
startAgentRun: async () => 'test-agent-run-id',
7+
finishAgentRun: async () => {},
78
}
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import type { StartAgentRunFn } from '../database'
1+
import type { FinishAgentRunFn, StartAgentRunFn } from '../database'
22
import type { Logger } from '../logger'
33

44
export type AgentRuntimeDeps = {
55
logger: Logger
66

77
startAgentRun: StartAgentRunFn
8+
finishAgentRun: FinishAgentRunFn
89
}

0 commit comments

Comments
 (0)