File tree Expand file tree Collapse file tree 3 files changed +7
-2
lines changed
Expand file tree Collapse file tree 3 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ export const EXISTING_CODE_MARKER = '[[**REPLACE_WITH_EXISTING_CODE**]]'
66export const AGENT_TEMPLATES_DIR = '.agents/'
77export const AGENT_CONFIG_FILE = 'agent-config.d.ts'
88
9+ export const API_KEY_ENV_VAR = 'CODEBUFF_API_KEY'
10+
911// Enable async agents to run tool calls even when main user input is cancelled
1012export const ASYNC_AGENTS_ENABLED = true
1113
Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ import {
2525 SHOULD_ASK_CONFIG ,
2626 UserState ,
2727 ASYNC_AGENTS_ENABLED ,
28+ API_KEY_ENV_VAR ,
2829} from '@codebuff/common/constants'
2930import { AnalyticsEvent } from '@codebuff/common/constants/analytics-events'
3031import { codebuffConfigFile as CONFIG_FILE_NAME } from '@codebuff/common/json-config/constants'
@@ -1055,7 +1056,7 @@ export class Client {
10551056 sessionState : this . sessionState ,
10561057 toolResults,
10571058 fingerprintId : await this . fingerprintId ,
1058- authToken : this . user ?. authToken ,
1059+ authToken : process . env [ API_KEY_ENV_VAR ] || this . user ?. authToken ,
10591060 costMode : this . costMode ,
10601061 model : this . model ,
10611062 repoUrl : loggerContext . repoUrl ,
Original file line number Diff line number Diff line change 11import { execFileSync } from 'child_process'
22
3+ import { API_KEY_ENV_VAR } from '@codebuff/common/constants'
4+
35import { CODEBUFF_BINARY } from './constants'
46import { processStream } from './process-stream'
57
@@ -26,7 +28,7 @@ export class CodebuffClient {
2628 this . authToken =
2729 apiKey . type === 'string'
2830 ? apiKey . value
29- : process . env . CODEBUFF_API_KEY ?? ''
31+ : process . env [ API_KEY_ENV_VAR ] ?? ''
3032 this . cwd = cwd
3133 }
3234
You can’t perform that action at this time.
0 commit comments