Merge branch 'admin_telemetry_live_logs'
This commit is contained in:
commit
3549251e71
2 changed files with 6 additions and 3 deletions
|
|
@ -391,7 +391,7 @@ export class LiveWatcher {
|
||||||
}): void {
|
}): void {
|
||||||
if (!this.isWatcherActive) return;
|
if (!this.isWatcherActive) return;
|
||||||
const entry = this.buffer.find(e => e.id === params.requestId);
|
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.endTime = Date.now();
|
||||||
entry.durationMs = entry.endTime - entry.startTime;
|
entry.durationMs = entry.endTime - entry.startTime;
|
||||||
|
|
@ -426,7 +426,7 @@ export class LiveWatcher {
|
||||||
public cancelRequest(requestId: string): void {
|
public cancelRequest(requestId: string): void {
|
||||||
if (!this.isWatcherActive) return;
|
if (!this.isWatcherActive) return;
|
||||||
const entry = this.buffer.find(e => e.id === requestId);
|
const entry = this.buffer.find(e => e.id === requestId);
|
||||||
if (!entry) return;
|
if (!entry || entry.endTime !== undefined) return;
|
||||||
|
|
||||||
entry.endTime = Date.now();
|
entry.endTime = Date.now();
|
||||||
entry.durationMs = entry.endTime - entry.startTime;
|
entry.durationMs = entry.endTime - entry.startTime;
|
||||||
|
|
|
||||||
|
|
@ -627,7 +627,9 @@ export class RevolverEngine {
|
||||||
// If we reached here, all tiers and all candidates failed
|
// If we reached here, all tiers and all candidates failed
|
||||||
cleanupTimers();
|
cleanupTimers();
|
||||||
if (onFailure) onFailure('all_tiers_exhausted');
|
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 = {
|
const journey: RequestFallbackJourney = {
|
||||||
requestId,
|
requestId,
|
||||||
|
|
@ -673,6 +675,7 @@ export class RevolverEngine {
|
||||||
}));
|
}));
|
||||||
res.end();
|
res.end();
|
||||||
} else {
|
} else {
|
||||||
|
res.setHeader('Cache-Control', 'no-cache, no-transform');
|
||||||
res.status(503).json({
|
res.status(503).json({
|
||||||
error: {
|
error: {
|
||||||
message: `[Revolver Fallback Error]: ${finalErrorMessage}`,
|
message: `[Revolver Fallback Error]: ${finalErrorMessage}`,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue