mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-20 08:47:44 +00:00
chore(compiler): Enable strict property access TS compiler flag. (#6255)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -87,11 +87,11 @@ export interface LogRequest {
|
||||
* methods might have in their runtimes.
|
||||
*/
|
||||
function determineSurface(): string {
|
||||
if (process.env.SURFACE) {
|
||||
return process.env.SURFACE;
|
||||
} else if (process.env.GITHUB_SHA) {
|
||||
if (process.env['SURFACE']) {
|
||||
return process.env['SURFACE'];
|
||||
} else if (process.env['GITHUB_SHA']) {
|
||||
return 'GitHub';
|
||||
} else if (process.env.TERM_PROGRAM === 'vscode') {
|
||||
} else if (process.env['TERM_PROGRAM'] === 'vscode') {
|
||||
return detectIde() || DetectedIde.VSCode;
|
||||
} else {
|
||||
return 'SURFACE_NOT_SET';
|
||||
|
||||
@@ -98,7 +98,7 @@ export function logUserPrompt(config: Config, event: UserPromptEvent): void {
|
||||
};
|
||||
|
||||
if (shouldLogUserPrompts(config)) {
|
||||
attributes.prompt = event.prompt;
|
||||
attributes['prompt'] = event.prompt;
|
||||
}
|
||||
|
||||
const logger = logs.getLogger(SERVICE_NAME);
|
||||
@@ -247,7 +247,7 @@ export function logApiResponse(config: Config, event: ApiResponseEvent): void {
|
||||
'event.timestamp': new Date().toISOString(),
|
||||
};
|
||||
if (event.response_text) {
|
||||
attributes.response_text = event.response_text;
|
||||
attributes['response_text'] = event.response_text;
|
||||
}
|
||||
if (event.error) {
|
||||
attributes['error.message'] = event.error;
|
||||
|
||||
@@ -197,14 +197,14 @@ export function recordFileOperationMetric(
|
||||
...getCommonAttributes(config),
|
||||
operation,
|
||||
};
|
||||
if (lines !== undefined) attributes.lines = lines;
|
||||
if (mimetype !== undefined) attributes.mimetype = mimetype;
|
||||
if (extension !== undefined) attributes.extension = extension;
|
||||
if (lines !== undefined) attributes['lines'] = lines;
|
||||
if (mimetype !== undefined) attributes['mimetype'] = mimetype;
|
||||
if (extension !== undefined) attributes['extension'] = extension;
|
||||
if (diffStat !== undefined) {
|
||||
attributes.ai_added_lines = diffStat.ai_added_lines;
|
||||
attributes.ai_removed_lines = diffStat.ai_removed_lines;
|
||||
attributes.user_added_lines = diffStat.user_added_lines;
|
||||
attributes.user_removed_lines = diffStat.user_removed_lines;
|
||||
attributes['ai_added_lines'] = diffStat.ai_added_lines;
|
||||
attributes['ai_removed_lines'] = diffStat.ai_removed_lines;
|
||||
attributes['user_added_lines'] = diffStat.user_added_lines;
|
||||
attributes['user_removed_lines'] = diffStat.user_removed_lines;
|
||||
}
|
||||
fileOperationCounter.add(1, attributes);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user