chore: use correct CLI_VERSION for logging

This commit is contained in:
tanzhenxin
2025-08-12 21:00:17 +08:00
parent ef1c8a4bfe
commit cfc1aebee6
9 changed files with 42 additions and 8 deletions

View File

@@ -140,14 +140,14 @@ export class QwenLogger {
return this.createRumEvent('exception', type, name, properties);
}
createRumPayload(): RumPayload {
const version = process.env.CLI_VERSION || process.version;
async createRumPayload(): Promise<RumPayload> {
const version = this.config?.getCliVersion() || 'unknown';
return {
app: {
id: RUN_APP_ID,
env: process.env.DEBUG ? 'dev' : 'prod',
version,
version: version || 'unknown',
type: 'cli',
},
user: {
@@ -190,7 +190,7 @@ export class QwenLogger {
this.isFlushInProgress = true;
const rumPayload = this.createRumPayload();
const rumPayload = await this.createRumPayload();
const flushFn = () =>
new Promise<Buffer>((resolve, reject) => {
const body = safeJsonStringify(rumPayload);