Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
4a9f643
feat(models): keep service capability detail folded in the service form
Zhangbo-cn Nov 29, 2026
62174e8
[bugfix] providers: keep each model's capability check on one line
Zhangbo-cn Nov 30, 2026
7510d13
refactor(providers): drop the unused draft check wrapper and its dead…
Zhangbo-cn Nov 30, 2026
532c527
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn Nov 30, 2026
fe1e912
ci: retrigger after a publication-lock timeout in the python lane
Zhangbo-cn Nov 30, 2026
22030fb
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn Nov 30, 2026
19f0789
Merge remote-tracking branch 'origin/main' into feat/model-capability…
Zhangbo-cn Dec 1, 2026
a17a9d6
fix(providers): fold the capability detail and keep one check entry p…
Zhangbo-cn Dec 1, 2026
9a1a14a
test(providers): target the row summary, not the card's inner summary
Zhangbo-cn Dec 1, 2026
896a191
test(providers): open the row fold before reading the capability card
Zhangbo-cn Dec 1, 2026
e7974b3
ci: retrigger the real-CLI worker after a timeout
Zhangbo-cn Dec 1, 2026
420f32f
fix(models): report the folded row outcome, duration and expiry
Zhangbo-cn Dec 5, 2026
ff7e556
fix(models): show the row outcome as a compact mark with its duration
Zhangbo-cn Dec 5, 2026
49ad4d0
chore: drop the local dependency symlink
Zhangbo-cn Dec 5, 2026
a8ea5a0
Merge remote-tracking branch 'origin/main' into pr-604
Zhangbo-cn Dec 5, 2026
ec5e395
[ci] python: list the test modules main added without a shard
Zhangbo-cn Dec 5, 2026
7889c0f
[bugfix] providers: report a failed capability check with its own dur…
Zhangbo-cn Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion scripts/ci/python_shards.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"core": [
"tests/test_a2_repros.py",
"tests/test_app_settings.py",
"tests/test_ark_availability.py",
"tests/test_ark_plan_models.py",
"tests/test_asset_names.py",
"tests/test_atlascloud.py",
Expand Down Expand Up @@ -103,6 +104,7 @@
"tests/test_self_hosted_proxy.py",
"tests/test_self_hosted_queue.py",
"tests/test_structure_reference.py",
"tests/test_trace_job_queries.py",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里插入的是旧版显式 core 列表,main 的 #700 已经把整段换成默认 core。GitHub 现在报 dirty。解决时保留 default_shard: core,Ark/trace 让默认规则收集就行;不要恢复整份 core 清单。

"tests/test_vllm_omni_h3.py",
"tests/test_vllm_omni_image.py",
"tests/test_voice_library.py",
Expand Down Expand Up @@ -136,7 +138,8 @@
"tests/test_native_runtime.py",
"tests/test_native_sessions.py",
"tests/test_pi_runtime.py",
"tests/test_skill_snapshot.py"
"tests/test_skill_snapshot.py",
"tests/test_wait_outcome.py"
],
"media": [
"tests/test_canvas_text_cli_http.py",
Expand Down
35 changes: 23 additions & 12 deletions src/canvas/DraftAvailabilityCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@ import {
} from "../backend/models.ts";
import type { ModelAvailability } from "../backend/availability.ts";
import { errorMessage } from "../backend/api.ts";
import { ModelAvailabilityCard } from "./ModelAvailabilityCard";

/** A draft check never publishes an observation into the saved model catalog. */
export function DraftAvailabilityCheck({
export function useDraftAvailability({
connection,
configId,
modelId,
Expand All @@ -27,6 +25,10 @@ export function DraftAvailabilityCheck({
observation: ModelAvailability;
} | null>(null);
const [pending, setPending] = useState<string | null>(null);
const [duration, setDuration] = useState<{
signature: string;
ms: number;
} | null>(null);
const [failure, setFailure] = useState<{
signature: string;
message: string;
Expand All @@ -39,6 +41,7 @@ export function DraftAvailabilityCheck({
}, []);
const check = async () => {
const attempt = ++serial.current;
const started = performance.now();
setPending(signature);
setFailure(null);
try {
Expand All @@ -50,27 +53,35 @@ export function DraftAvailabilityCheck({
alive.current &&
latest.current === signature &&
serial.current === attempt
)
) {
setValue({ signature, observation });
setDuration({
signature,
ms: Math.max(0, Math.round(performance.now() - started)),
});
}
} catch (error) {
if (
alive.current &&
latest.current === signature &&
serial.current === attempt
) {
setValue(null);
setDuration({
signature,
ms: Math.max(0, Math.round(performance.now() - started)),
});
setFailure({ signature, message: errorMessage(error) });
}
} finally {
if (alive.current && serial.current === attempt) setPending(null);
}
};
return (
<ModelAvailabilityCard
value={value?.signature === signature ? value.observation : null}
checking={pending === signature}
onRefresh={() => void check()}
error={failure?.signature === signature ? failure.message : undefined}
/>
);
return {
value: value?.signature === signature ? value.observation : null,
checking: pending === signature,
durationMs: duration?.signature === signature ? duration.ms : undefined,
error: failure?.signature === signature ? failure.message : undefined,
check: () => void check(),
};
}
51 changes: 31 additions & 20 deletions src/canvas/ModelAvailabilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ export function ModelAvailabilityCard({
checking = false,
title,
error,
actions = true,
}: {
value?: ModelAvailability | null;
onRefresh?: () => void;
checking?: boolean;
title?: string;
error?: string;
actions?: boolean;
}) {
const { t, locale } = useI18n();
const [tick, setTick] = useState(0);
Expand Down Expand Up @@ -55,8 +57,35 @@ export function ModelAvailabilityCard({
aria-label={t("availability.title")}
>
<div className="cw-model-availability-heading">
<strong>{title ?? t("availability.title")}</strong>
{onRefresh && (
<div className="cw-model-availability-title">
<strong>{title ?? t("availability.title")}</strong>
{current?.operations.length ? (
<span className="cw-availability-chips">
{current.operations.map((item) => {
const chip = availabilityRow(item, notice);
return (
<span
key={`${item.operation}:${item.profile}:${item.path}`}
className="cw-availability-chip"
data-availability={chip.status}
data-stale={chip.muted || undefined}
>
<span className="cw-availability-op">
{availabilityProfile(item.profile)}
</span>
<span
className="cw-availability-state"
data-availability={chip.status}
>
{chip.text}
</span>
</span>
);
})}
</span>
) : null}
</div>
{actions && onRefresh && (
<button
type="button"
className="cw-settings-button"
Expand All @@ -76,24 +105,6 @@ export function ModelAvailabilityCard({
)}
</div>
{message && <p role={error ? "alert" : "status"}>{message}</p>}
{current?.operations.length ? (
<ul>
{current.operations.map((item) => {
const row = availabilityRow(item, notice);
return (
<li
key={`${item.operation}:${item.profile}:${item.path}`}
data-stale={row.muted || undefined}
>
<span>{availabilityProfile(item.profile)}</span>
<div>
<span data-availability={row.status}>{row.text}</span>
</div>
</li>
);
})}
</ul>
) : null}
{details.length > 0 && (
<details
className="cw-model-input-details"
Expand Down
35 changes: 23 additions & 12 deletions src/canvas/ModelPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export function ModelPicker({
onTest,
results,
renderDetails,
compact = false,
}: {
modelPlaceholder: string;
available: string[];
Expand All @@ -38,6 +39,7 @@ export function ModelPicker({
onTest?: (id: string) => void;
results: Record<string, ModelTestResult>;
renderDetails?: (id: string) => ReactNode;
compact?: boolean;
}) {
const t = useT();
const manualFieldId = useId();
Expand All @@ -55,6 +57,9 @@ export function ModelPicker({
);
const allSelected =
visible.length > 0 && visible.every((id) => selected.includes(id));
const denseCount = compact && ids.length > 4;
const redundantStatus =
denseCount && loaded && !loading && !error && available.length > 0;
const fetchLabel = loadsPreset
? "models.service.loadSupportedModels"
: loaded ? "generation.picker.refresh" : "generation.picker.fetch";
Expand Down Expand Up @@ -119,9 +124,11 @@ export function ModelPicker({
</button>
</div>
</div>
<div role="status">
{status && <p className="cw-model-note">{status}</p>}
</div>
{(!compact || !redundantStatus) && (
<div role="status">
{status && <p className="cw-model-note">{status}</p>}
</div>
)}
{error && (
<p className="cw-model-feedback" role="alert">
{error}
Expand Down Expand Up @@ -186,18 +193,22 @@ export function ModelPicker({
onChange={(event) => setQuery(event.target.value)}
/>
</label>
<button
type="button"
className="cw-settings-button cw-model-filter"
aria-pressed={onlySelected}
onClick={() => setOnlySelected(!onlySelected)}
>
{t("generation.picker.onlySelected")}
</button>
{!compact && (
<button
type="button"
className="cw-settings-button cw-model-filter"
aria-pressed={onlySelected}
onClick={() => setOnlySelected(!onlySelected)}
>
{t("generation.picker.onlySelected")}
</button>
)}
</div>
<div className="cw-model-bulk">
<span>
{t("generation.picker.count", { count: visible.length })}
{denseCount && loaded && !loading && !error && available.length
? t("generation.picker.fetched", { count: available.length })
: t("generation.picker.count", { count: visible.length })}
</span>
<button
type="button"
Expand Down
128 changes: 128 additions & 0 deletions src/canvas/ModelRowDetails.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
import { useEffect, useState, type ReactNode } from "react";
import {
availabilityDelay,
availabilityReason,
currentAvailability,
type ModelAvailability,
} from "../backend/availability.ts";
import type { ModelConfigInput } from "../backend/models.ts";
import { useT, type Translate } from "../i18n/I18nProvider";
import { availabilityNotice } from "./availabilityPresentation";
import { useDraftAvailability } from "./DraftAvailabilityCheck";
import { ModelAvailabilityCard } from "./ModelAvailabilityCard";

type RowOutcome = "passed" | "unsupported" | "unknown" | "expired";

const UNSUPPORTED_REASONS = new Set([
"operation_unsupported",
"profile_unsupported",
"output_unsupported",
"route_disabled",
"operation_disabled",
]);

function rowOutcome(
value: ModelAvailability,
notice: string | null,
t: Translate,
): { kind: RowOutcome; text: string } {
if (notice === "observation_expired" || notice === "stale_declaration")
return { kind: "expired", text: t("availability.rowExpired") };
if (notice)
return {
kind: UNSUPPORTED_REASONS.has(notice) ? "unsupported" : "unknown",
text: availabilityReason(notice),
};
const states = new Set(value.operations.map((item) => item.status));
if (states.size === 1 && states.has("available"))
return { kind: "passed", text: t("availability.rowOutcome.passed") };
if (states.has("unavailable"))
return {
kind: "unsupported",
text: t("availability.rowOutcome.unsupported"),
};
return { kind: "unknown", text: t("availability.rowOutcome.unknown") };
}

const rowMark: Record<RowOutcome, string> = {
passed: "✓",
unsupported: "✕",
unknown: "?",
expired: "",
};

function elapsed(ms: number) {
return ms < 1000 ? `${ms}ms` : `${(ms / 1000).toFixed(1)}s`;
}

export function ModelRowDetails({
modelId,
connection,
configId,
children,
}: {
modelId: string;
connection: ModelConfigInput;
configId?: string;
children: ReactNode;
}) {
const t = useT();
const draft = useDraftAvailability({ connection, configId, modelId });
const [tick, setTick] = useState(0);
useEffect(() => {
const delay = draft.value ? availabilityDelay(draft.value) : null;
if (delay === null) return;
const timer = setTimeout(
() => setTick((previous) => previous + 1),
Math.max(1, delay + 1),
);
return () => clearTimeout(timer);
}, [draft.value, tick]);
const current = draft.value ? currentAvailability(draft.value) : null;
const notice = availabilityNotice(current);
const outcome = current ? rowOutcome(current, notice, t) : null;
const duration =
draft.durationMs === undefined ? "" : elapsed(draft.durationMs);
const rowLabel = outcome
? outcome.kind === "expired"
? outcome.text
: `${rowMark[outcome.kind]}${duration}`
: undefined;
const rowTitle = outcome
? `${outcome.kind === "expired" && notice ? availabilityReason(notice) : outcome.text}${duration && ` · ${duration}`}`
: undefined;
const failureLabel = draft.error
? `${t("availability.reason.query_failed")}${duration && ` · ${duration}`}`
: undefined;
const showTest = connection.kind !== "agent";
return (
<>
{showTest && (
<button
type="button"
className="cw-settings-button cw-settings-button-quiet cw-model-row-test"
disabled={draft.checking}
aria-busy={draft.checking || undefined}
aria-label={failureLabel ?? rowTitle}
title={failureLabel ?? rowTitle}
data-outcome={failureLabel ? "failed" : outcome?.kind}
onClick={draft.check}
>
{draft.checking
? t("availability.checking")
: failureLabel ?? rowLabel ?? t("availability.rowTest")}
</button>
)}
<details className="cw-model-row-details">
<summary>{t("models.service.capabilityDetails")}</summary>
<ModelAvailabilityCard
value={draft.value}
checking={draft.checking}
error={draft.error}
actions={false}
/>
{children}
</details>
</>
);
}
Loading
Loading