fix(web): agent check default model fallback; ensure browser session before desktop iframe (FIX-5)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
rootandClaude Opus 5.5 committed 2026-09-29 19:37:12 +08:00
1 parent 6aaf8c0704
commit 9244315768
4 files changed
+63 -22

No files matched your search

@@ -3,7 +3,7 @@ import { SCHEDULE_CHANGED_EVENT, type ScheduledJob } from "@umt/contracts";
import { AlertTriangle, Bot, CalendarClock, CircleCheck, Coins, LoaderCircle, Plus, XCircle } from "lucide-react";
import { type ReactNode, useEffect, useRef, useState } from "react";
import { useLocation } from "react-router";
import { usePiUpstreams } from "~/api/pi.ts";
import { usePiUpstreamModels, usePiUpstreams } from "~/api/pi.ts";
import { useScheduleBoard } from "~/api/schedules.ts";
import { EmptyState, ErrorState, LoadingState } from "~/components/console/empty-state.tsx";
import { StatTile } from "~/components/console/stat-tile.tsx";
@@ -96,7 +96,16 @@ export function PlanBoard({ highlightJob }: { highlightJob?: string }) {
const autoJobs = items.filter((j) => j.kind === "task");
const checks = items.filter((j) => j.kind === "agent_check");
const def = upstreams.data?.items.find((u) => u.isDefault);
const upstream: DefaultUpstream = def ? { name: def.name, model: def.defaultModel ?? null } : null;
// 上游没填默认模型时,运行时用模型目录的第一个(packages/agent pi/upstream.ts pickModel),这里同样取目录首个
const catalog = usePiUpstreamModels(def && !def.defaultModel ? def.id : null);
const catalogModel = catalog.data?.models[0]?.id ?? null;
const upstream: DefaultUpstream = def
? {
name: def.name,
model: def.defaultModel ?? catalogModel,
modelFromCatalog: !def.defaultModel && !!catalogModel,
}
: null;
const s = planStats(items);
const val = (n: number) => (board.isPending ? "…" : board.isError ? "—" : n);