Skip to content

Commit aa03563

Browse files
committed
fix: Add special handling to human-relay providers, optimize configuration check logic
1 parent eb74f02 commit aa03563

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/shared/checkExistApiConfig.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import { SECRET_KEYS } from "./globalState"
44
export function checkExistKey(config: ApiConfiguration | undefined) {
55
if (!config) return false
66

7+
// Special case for human-relay provider which doesn't need any configuration
8+
if (config.apiProvider === "human-relay") {
9+
return true
10+
}
11+
712
// Check all secret keys from the centralized SECRET_KEYS array
813
const hasSecretKey = SECRET_KEYS.some((key) => config[key as keyof ApiConfiguration] !== undefined)
914

@@ -16,5 +21,9 @@ export function checkExistKey(config: ApiConfiguration | undefined) {
1621
config.vsCodeLmModelSelector,
1722
].some((value) => value !== undefined)
1823

24+
console.log("[checkExistKey] config:", config)
25+
console.log("[checkExistKey] hasSecretKey:", hasSecretKey)
26+
console.log("[checkExistKey] hasOtherConfig:", hasOtherConfig)
27+
1928
return hasSecretKey || hasOtherConfig
2029
}

0 commit comments

Comments
 (0)