Skip to content

Commit f48e2e7

Browse files
committed
Load local agent templates once
1 parent 78c5237 commit f48e2e7

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

npm-app/src/cli.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export class CLI {
177177
public rl!: readline.Interface
178178

179179
private constructor(
180-
readyPromise: Promise<[ProjectFileContext, void]>,
180+
readyPromise: Promise<[ProjectFileContext, void, void]>,
181181
{ git, costMode, model, agent, params, print, trace }: CliOptions,
182182
) {
183183
this.git = git
@@ -206,13 +206,12 @@ export class CLI {
206206
})
207207

208208
this.readyPromise = Promise.all([
209-
readyPromise.then(([fileContext]) => {
209+
readyPromise.then(([fileContext, ,]) => {
210210
const client = Client.getInstance()
211211
client.initSessionState(fileContext)
212212
return client.warmContextCache()
213213
}),
214214
Client.getInstance().connect(),
215-
getLocalAgentInfo(), // Initialize agent cache
216215
])
217216

218217
this.setPrompt()
@@ -264,7 +263,7 @@ export class CLI {
264263
}
265264

266265
public static initialize(
267-
readyPromise: Promise<[ProjectFileContext, void]>,
266+
readyPromise: Promise<[ProjectFileContext, void, void]>,
268267
options: CliOptions,
269268
): void {
270269
if (CLI.instance) {

npm-app/src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,14 @@ async function codebuff({
5656
const readyPromise = Promise.all([
5757
initFileContextPromise,
5858
processCleanupPromise,
59+
60+
loadLocalAgents({ verbose: true }).then(() =>
61+
displayLoadedAgents(codebuffConfig),
62+
),
5963
])
6064

65+
const codebuffConfig = loadCodebuffConfig()
66+
6167
// Initialize the CLI singleton
6268
CLI.initialize(readyPromise, {
6369
git,
@@ -68,10 +74,6 @@ async function codebuff({
6874
print,
6975
trace,
7076
})
71-
const codebuffConfig = loadCodebuffConfig()
72-
await loadLocalAgents({ verbose: true }).then(() =>
73-
displayLoadedAgents(codebuffConfig),
74-
)
7577
const cli = CLI.getInstance()
7678

7779
await cli.printInitialPrompt({ initialInput, runInitFlow })

npm-app/src/project-files.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,6 @@ export const getProjectFileContext = async (
313313
projectRoot,
314314
allFilePaths,
315315
)
316-
await loadLocalAgents({ verbose: false })
317316

318317
// Load codebuff configuration
319318
const codebuffConfig = loadCodebuffConfig()

0 commit comments

Comments
 (0)