mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-19 10:43:08 +00:00
refactor: Improve all git operations, add stash support, add improved pull request flow, add worktree file copy options, address code review comments, add cherry pick options
This commit is contained in:
@@ -171,7 +171,11 @@ export class ZaiUsageService {
|
||||
*/
|
||||
getApiHost(): string {
|
||||
// Priority: 1. Instance host, 2. Z_AI_API_HOST env, 3. Default
|
||||
return process.env.Z_AI_API_HOST ? `https://${process.env.Z_AI_API_HOST}` : this.apiHost;
|
||||
if (process.env.Z_AI_API_HOST) {
|
||||
const envHost = process.env.Z_AI_API_HOST.trim();
|
||||
return envHost.startsWith('http') ? envHost : `https://${envHost}`;
|
||||
}
|
||||
return this.apiHost;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -242,8 +246,7 @@ export class ZaiUsageService {
|
||||
}
|
||||
|
||||
const quotaUrl =
|
||||
process.env.Z_AI_QUOTA_URL ||
|
||||
`${process.env.Z_AI_API_HOST ? `https://${process.env.Z_AI_API_HOST}` : 'https://api.z.ai'}/api/monitor/usage/quota/limit`;
|
||||
process.env.Z_AI_QUOTA_URL || `${this.getApiHost()}/api/monitor/usage/quota/limit`;
|
||||
|
||||
logger.info(`[verify] Testing API key against: ${quotaUrl}`);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user