Merge branch 'admin_telemetry_live_logs'

This commit is contained in:
tyuXX 2026-11-04 20:33:18 +00:00
commit 3549251e71
2 changed files with 6 additions and 3 deletions

View file

@ -391,7 +391,7 @@ export class LiveWatcher {
}): void {
if (!this.isWatcherActive) return;
const entry = this.buffer.find(e => e.id === params.requestId);
if (!entry) return;
if (!entry || (entry.endTime !== undefined && entry.status === 'completed')) return;
entry.endTime = Date.now();
entry.durationMs = entry.endTime - entry.startTime;
@ -426,7 +426,7 @@ export class LiveWatcher {
public cancelRequest(requestId: string): void {
if (!this.isWatcherActive) return;
const entry = this.buffer.find(e => e.id === requestId);
if (!entry) return;
if (!entry || entry.endTime !== undefined) return;
entry.endTime = Date.now();
entry.durationMs = entry.endTime - entry.startTime;

View file

@ -627,7 +627,9 @@ export class RevolverEngine {
// If we reached here, all tiers and all candidates failed
cleanupTimers();
if (onFailure) onFailure('all_tiers_exhausted');
const finalErrorMessage = lastError ? lastError.message : 'All model tiers and provider keys are exhausted or rate-limited.';
const finalErrorMessage = lastError?.cause?.message
? `${lastError.message}: ${lastError.cause.message}`
: (lastError ? lastError.message : 'All model tiers and provider keys are exhausted or rate-limited.');
const journey: RequestFallbackJourney = {
requestId,
@ -673,6 +675,7 @@ export class RevolverEngine {
}));
res.end();
} else {
res.setHeader('Cache-Control', 'no-cache, no-transform');
res.status(503).json({
error: {
message: `[Revolver Fallback Error]: ${finalErrorMessage}`,