Skip to content

Commit e2ef098

Browse files
committed
do not load config files into context
1 parent c7ce1a4 commit e2ef098

File tree

1 file changed

+5
-24
lines changed

1 file changed

+5
-24
lines changed

npm-app/src/project-files.ts

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ import { promisify } from 'util'
66
import { Worker } from 'worker_threads'
77

88
import { getFileTokenScores } from '@codebuff/code-map'
9+
import {
10+
codebuffConfigFile,
11+
codebuffConfigFileBackup,
12+
} from '@codebuff/common/json-config/constants'
913
import {
1014
AGENT_TEMPLATES_DIR,
1115
FILE_READ_STATUS,
1216
toOptionalFile,
1317
} from '@codebuff/common/old-constants'
14-
import {
15-
codebuffConfigFile,
16-
codebuffConfigFileBackup,
17-
} from '@codebuff/common/json-config/constants'
1818
import {
1919
flattenTree,
2020
getProjectFileTree,
@@ -292,8 +292,6 @@ export const getProjectFileContext = async (
292292
const userKnowledgeFilesWithScrapedContent =
293293
await addScrapedContentToFiles(userKnowledgeFiles)
294294

295-
const shellConfigFiles = loadShellConfigFiles()
296-
297295
const { tokenScores, tokenCallers } = await getFileTokenScores(
298296
projectRoot,
299297
allFilePaths,
@@ -312,7 +310,7 @@ export const getProjectFileContext = async (
312310
agentTemplates: await loadLocalAgents({ verbose: false }),
313311
customToolDefinitions: {},
314312
codebuffConfig,
315-
shellConfigFiles,
313+
shellConfigFiles: {},
316314
systemInfo: getSystemInfo(),
317315
userKnowledgeFiles: userKnowledgeFilesWithScrapedContent,
318316
gitChanges,
@@ -623,23 +621,6 @@ export function setFiles(files: Record<string, string>) {
623621
}
624622
}
625623

626-
const loadShellConfigFiles = () => {
627-
const homeDir = os.homedir()
628-
const configFiles = [
629-
path.join(homeDir, '.bashrc'),
630-
path.join(homeDir, '.bash_profile'),
631-
path.join(homeDir, '.bash_login'),
632-
path.join(homeDir, '.profile'),
633-
path.join(homeDir, '.zshrc'),
634-
path.join(homeDir, '.kshrc'),
635-
]
636-
const files = getFilesAbsolutePath(configFiles, { silent: true })
637-
return filterObject(files, (value) => value !== null) as Record<
638-
string,
639-
string
640-
>
641-
}
642-
643624
/*
644625
function getExportedTokensForFiles(
645626
filePaths: string[]

0 commit comments

Comments
 (0)