retry stream capacity errors in gateway

This commit is contained in:
2026-06-29 20:54:25 +08:00
parent ab0572baf6
commit 1d7016bf65
3 changed files with 371 additions and 117 deletions
+16 -7
View File
@@ -39,6 +39,8 @@ type Metrics = {
cached_tokens?: number;
};
observed_reasoning_counts?: Record<string, number>;
observed_reasoning_counts_total_keys?: number;
observed_reasoning_counts_omitted?: number;
};
type StatusPayload = {
@@ -222,7 +224,7 @@ const api = {
restore: "/__codex_retry_gateway/api/restore",
};
const REQUEST_PAGE_SIZE = 40;
const REQUEST_PAGE_SIZE = 20;
const LOG_PAGE_SIZE = 200;
const zhNumberFormatter = new Intl.NumberFormat("zh-CN");
@@ -666,7 +668,7 @@ export default function App() {
}, [page, requestQuery, requestFilter, latestLogSeq, requestLimit]);
useEffect(() => {
if (page === "overview" || page === "rules") {
if (page === "overview" || page === "rules" || page === "requests") {
return;
}
loadPageData(page, { incrementalLogs: false }).catch((error) => {
@@ -997,11 +999,18 @@ export default function App() {
{reasoningChips.length === 0 ? (
<span className="chip"> reasoning </span>
) : (
reasoningChips.map(([reasoning, count]) => (
<span className="chip" key={reasoning}>
reasoning {reasoning}: {count}
</span>
))
<>
{reasoningChips.map(([reasoning, count]) => (
<span className="chip" key={reasoning}>
reasoning {reasoning}: {count}
</span>
))}
{(metrics.observed_reasoning_counts_omitted || 0) > 0 ? (
<span className="chip">
{metrics.observed_reasoning_counts_omitted}
</span>
) : null}
</>
)}
</div>
</Card>