fix: address code review issues and cleanup QA reports
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Code review fixes: - Add error logging to LlmProviderAdminController.testProvider catch block - Use atomic increment operations in TokenBudgetService.updateUsage to prevent race conditions - Update test expectations for atomic increment pattern Cleanup: - Remove obsolete QA automation reports All 1169 tests passing. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
HttpStatus,
|
||||
NotFoundException,
|
||||
BadRequestException,
|
||||
Logger,
|
||||
} from "@nestjs/common";
|
||||
import type { InputJsonValue } from "@prisma/client/runtime/library";
|
||||
import { PrismaService } from "../prisma/prisma.service";
|
||||
@@ -43,6 +44,8 @@ import { CreateLlmProviderDto, UpdateLlmProviderDto, LlmProviderResponseDto } fr
|
||||
*/
|
||||
@Controller("llm/admin")
|
||||
export class LlmProviderAdminController {
|
||||
private readonly logger = new Logger(LlmProviderAdminController.name);
|
||||
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly llmManager: LlmManagerService
|
||||
@@ -245,8 +248,11 @@ export class LlmProviderAdminController {
|
||||
return {
|
||||
healthy: health.healthy,
|
||||
};
|
||||
} catch {
|
||||
} catch (error: unknown) {
|
||||
// Provider not loaded in manager (might be disabled)
|
||||
const errorMessage = error instanceof Error ? error.message : String(error);
|
||||
this.logger.warn(`Failed to test provider ${id}: ${errorMessage}`);
|
||||
|
||||
return {
|
||||
healthy: false,
|
||||
error: "Provider not loaded in manager. Try reloading providers.",
|
||||
|
||||
Reference in New Issue
Block a user