Skip to content

Commit abe7d7c

Browse files
committed
Dedup max agent step constants. Set to 25, not 12 or 40
1 parent 7648fa8 commit abe7d7c

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

common/src/constants/agents.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,4 @@ export const AGENT_NAME_TO_TYPES = Object.entries(AGENT_NAMES).reduce(
119119
{} as Record<string, string[]>,
120120
)
121121

122-
export const MAX_AGENT_STEPS_DEFAULT = 40
122+
export const MAX_AGENT_STEPS_DEFAULT = 25

common/src/json-config/constants.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import { MAX_AGENT_STEPS_DEFAULT } from '../constants/agents'
12
import { z } from 'zod/v4'
23

34
export const codebuffConfigFile = 'codebuff.json'
@@ -64,8 +65,6 @@ export const FileChangeHook = z
6465
})
6566
.describe('Defines a single file change hook.')
6667

67-
export const DEFAULT_MAX_AGENT_STEPS = 12
68-
6968
export const CodebuffConfigSchema = z
7069
.object({
7170
description: z
@@ -83,7 +82,7 @@ export const CodebuffConfigSchema = z
8382
maxAgentSteps: z
8483
.number()
8584
.optional()
86-
.default(DEFAULT_MAX_AGENT_STEPS)
85+
.default(MAX_AGENT_STEPS_DEFAULT)
8786
.describe(
8887
'Maximum number of turns agent will take before being forced to end',
8988
),

common/src/json-config/default.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
import type { CodebuffConfig } from './constants'
1+
import { MAX_AGENT_STEPS_DEFAULT } from '../constants/agents'
2+
import { type CodebuffConfig } from './constants'
23

34
export function getDefaultConfig(): CodebuffConfig {
45
return {
56
description: '',
67
startupProcesses: [],
78
fileChangeHooks: [],
8-
maxAgentSteps: 12,
9+
maxAgentSteps: MAX_AGENT_STEPS_DEFAULT,
910
baseAgent: undefined,
1011
spawnableAgents: undefined,
1112
}
1213
}
14+

npm-app/src/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -988,8 +988,10 @@ export class Client {
988988
},
989989
])
990990

991+
const codebuffConfig = loadCodebuffConfig()
992+
991993
this.sessionState.mainAgentState.stepsRemaining =
992-
loadCodebuffConfig().maxAgentSteps
994+
codebuffConfig.maxAgentSteps
993995

994996
this.sessionState.fileContext.cwd = getWorkingDirectory()
995997
this.sessionState.fileContext.agentTemplates = await loadLocalAgents({})

0 commit comments

Comments
 (0)