Error log, retry notice, a waiting counter that keeps counting
- generation_errors: every failed attempt (model, attempt, outcome, duration); admin Hibanapló page and GET /v1/admin/errors; kept 90 days - The waiting page counts from when the text was asked for (requested_at), not from the page load, so a reload no longer restarts it - It says when an attempt failed and is retried, and when a failed text's unit was given back; admins see the error Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -4,13 +4,31 @@ import { useEffect, useState } from "react";
|
||||
|
||||
import { ZodiacWheel } from "./ZodiacWheel";
|
||||
|
||||
/** Slowly turning wheel with the elapsed time, while the LLM writes. */
|
||||
export function AnalysisLoading({ title, text, compact = false }: { title?: string; text: string; compact?: boolean }) {
|
||||
const [seconds, setSeconds] = useState(0);
|
||||
/**
|
||||
* Slowly turning wheel with the elapsed time, while the LLM writes. The time
|
||||
* counts from `since` (when the text was asked for), so it does not start
|
||||
* again from zero after a reload; without it, from when the wheel appeared.
|
||||
*/
|
||||
export function AnalysisLoading({
|
||||
title,
|
||||
text,
|
||||
compact = false,
|
||||
since,
|
||||
}: {
|
||||
title?: string;
|
||||
text: string;
|
||||
compact?: boolean;
|
||||
since?: string;
|
||||
}) {
|
||||
const [start] = useState(() => {
|
||||
const t = since ? Date.parse(since) : NaN;
|
||||
return Number.isNaN(t) ? Date.now() : Math.min(t, Date.now());
|
||||
});
|
||||
const [seconds, setSeconds] = useState(() => Math.floor((Date.now() - start) / 1000));
|
||||
useEffect(() => {
|
||||
const t = setInterval(() => setSeconds((s) => s + 1), 1000);
|
||||
const t = setInterval(() => setSeconds(Math.floor((Date.now() - start) / 1000)), 1000);
|
||||
return () => clearInterval(t);
|
||||
}, []);
|
||||
}, [start]);
|
||||
const elapsed = `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, "0")}`;
|
||||
|
||||
return (
|
||||
@@ -21,7 +39,7 @@ export function AnalysisLoading({ title, text, compact = false }: { title?: stri
|
||||
<p className="muted" role="status">
|
||||
{text}
|
||||
</p>
|
||||
<p className="hint" aria-hidden="true">
|
||||
<p className="hint" aria-hidden="true" suppressHydrationWarning>
|
||||
{elapsed}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user