Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions docs/guides/model-availability.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

模型接入可以读取服务的可选能力声明。自托管连接默认自动检查,其他连接默认关闭;服务级 `capabilityAutoCheck` 可以覆盖默认值。省略该字段会保留已有设置,旧配置无需转换。共享同一 `providerId` 的模型使用相同设置和查询缓存。独立服务及旧的独立配置保留自己的归属,相同 URL 和密钥不会合并它们。自动检查只查询能力接口,不生成内容、不唤醒模型。

“检查服务能力”可以检查未保存的表单。草稿检查不会保存配置,也不会更新已保存模型的状态。显式刷新已保存模型可以检查关闭自动检查的服务。
“检查服务能力”可以检查未保存的表单。草稿检查不会保存配置,也不会更新已保存模型的状态。显式刷新已保存模型可以检查关闭自动检查的服务。文本模型的行内不显示这项检查:每行的“测试”按钮会发送一条简短消息,已经能证明模型可用,该行只保留“服务能力”的文本与图片理解开关。

在“设置 → 模型接入”选择模型类别,展开服务卡片的“服务能力”,即可查看每种操作的状态和检查时间。编辑服务时,可在高级连接设置中调整“自动检查服务能力”。输入过程中不会查询;保存后在后台检查。生成按钮和助手会说明明确不可用的原因,并保留当前输入和选择。暂停观察到期后会解除该观察产生的禁用,提交时仍执行后端检查。

Expand All @@ -32,7 +32,7 @@ Example capability card showing operation states and declared input limits:

Model connections can read an optional service capability declaration. Self-hosted connections check automatically by default; other connections require explicit enablement or a manual check. The optional service-level `capabilityAutoCheck` preference and query cache are shared by models with the same `providerId`. Independent providers and legacy standalone configuration IDs stay isolated even at the same URL with the same credential. Checks query declarations without inference or wake-up requests.

The unsaved form check uses an isolated draft identity. It saves neither configuration nor observations for saved connections. Explicit refresh can check selected saved connections even when automatic checks are disabled.
The unsaved form check uses an isolated draft identity. It saves neither configuration nor observations for saved connections. Explicit refresh can check selected saved connections even when automatic checks are disabled. Rows for text models do not show this check: their Test button sends a short message, which already proves the model answers, so the row keeps only the text and image-understanding switches under Service capabilities.

In Settings → Model connections, select a category and expand Service capabilities on a connection card to see operation states and check times. Advanced connection settings contain Automatically check service capabilities. Typing does not query the service; saving starts a background check. Generation and assistant controls explain explicit unavailability while retaining inputs and selections. Pause observations expire locally; submission still runs the backend check.

Expand Down
1 change: 1 addition & 0 deletions scripts/run-browser-suite.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const workflows = [
{ name: "minimax h3", script: "tests/browser/minimax_h3.mjs" },
{ name: "provider settings", script: "tests/browser/provider_settings.mjs" },
{ name: "new model discovery", script: "tests/browser/new_model_discovery.mjs" },
{ name: "model select all", script: "tests/browser/model_select_all.mjs" },
{ name: "Zhipu model settings feedback", script: "tests/browser/zhipu_provider.mjs" },
{ name: "capability discovery", script: "tests/browser/capability_discovery.mjs" },
{ name: "created node focus", script: "tests/browser/created_node_focus.mjs" },
Expand Down
3 changes: 3 additions & 0 deletions src/canvas/DraftAvailabilityCheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ export function DraftAvailabilityCheck({
connection,
configId,
modelId,
compact,
}: {
connection: ModelConfigInput;
configId?: string;
modelId: string;
compact?: boolean;
}) {
const signature = JSON.stringify([connection, configId, modelId]);
const latest = useRef(signature);
Expand Down Expand Up @@ -67,6 +69,7 @@ export function DraftAvailabilityCheck({
};
return (
<ModelAvailabilityCard
compact={compact}
value={value?.signature === signature ? value.observation : null}
checking={pending === signature}
onRefresh={() => void check()}
Expand Down
16 changes: 13 additions & 3 deletions src/canvas/ModelAvailabilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@ export function ModelAvailabilityCard({
checking = false,
title,
error,
compact = false,
}: {
value?: ModelAvailability | null;
onRefresh?: () => void;
checking?: boolean;
title?: string;
error?: string;
/** One line inside a model row: no card heading, chips instead of rows. */
compact?: boolean;
}) {
const { t, locale } = useI18n();
const [tick, setTick] = useState(0);
Expand All @@ -43,19 +46,26 @@ export function ModelAvailabilityCard({
const message = checking
? null
: error || (notice ? availabilityReason(notice) : null);
// A row keeps the action but not the "not checked yet" placeholder: the
// button already says what it does, and the empty line only cost space.
const showMessage = !(compact && !error && notice === "not_checked");
const details = availabilityCardDetails(current?.operations ?? []);
const commonSource =
details.length > 0 &&
details.every((detail) => detail.source === details[0].source)
? details[0].source
: null;
const messageNode = message && showMessage ? (
<p role={error ? "alert" : "status"}>{message}</p>
) : null;
return (
<section
className="cw-model-availability"
aria-label={t("availability.title")}
className={`cw-model-availability${compact ? " is-compact" : ""}`}
aria-label={title ?? t("availability.title")}
>
<div className="cw-model-availability-heading">
<strong>{title ?? t("availability.title")}</strong>
{compact && messageNode}
{onRefresh && (
<button
type="button"
Expand All @@ -75,7 +85,7 @@ export function ModelAvailabilityCard({
</button>
)}
</div>
{message && <p role={error ? "alert" : "status"}>{message}</p>}
{!compact && messageNode}
{current?.operations.length ? (
<ul>
{current.operations.map((item) => {
Expand Down
160 changes: 91 additions & 69 deletions src/canvas/ModelCapabilityCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ export function ModelCapabilityCard({
disabled,
onChange,
onValidity,
compact = false,
}: {
modelId: string;
connection: ModelConfigInput;
configId?: string;
saved?: ModelConfig;
options: ModelOptions;
disabled: boolean;
compact?: boolean;
onChange: (patch: ModelOptions) => void;
onValidity: (error: string) => void;
}) {
Expand Down Expand Up @@ -122,87 +124,107 @@ export function ModelCapabilityCard({
}
};
if (connection.kind !== "agent" && !video) return null;
const agentInputs = connection.kind === "agent" && (
<>
<div className="cw-model-modalities">
<span className="cw-model-modality-label">
{t("models.service.capabilities")}
</span>
<label>
<input type="checkbox" checked disabled />
{t("models.service.textInput")}
</label>
<label title={t("models.service.imageInputNote")}>
<input
type="checkbox"
checked={(
options.inputModalities ?? saved?.inputModalities
)?.includes("image") ?? false}
onChange={(event) =>
onChange({
inputModalities: event.target.checked
? ["text", "image"]
: ["text"],
})
}
/>
{t("models.service.imageInput")}
</label>
</div>
</>
);
const officialFacts = official && (
<div className="cw-model-capability-facts">
<span>
{t(
connection.protocol === "bigmodel_video"
? "models.service.bigmodelVideoSummary"
: connection.protocol === "kling_video"
? modelId === "kling-4.0-flash"
? "models.service.klingFlashSummary"
: "models.service.klingSummary"
: "models.service.officialSummary",
)}
</span>
{nativeCapabilities ? (
<>
<span>
{nativeCapabilities.outputs
.map((output) => output.resolution)
.join(" / ")}
</span>
<span>
{t("models.service.secondsRange", {
min: Math.min(...nativeDurations),
max: Math.max(...nativeDurations),
})}
</span>
</>
) : (
!error && <span>{t("models.service.loadingNative")}</span>
)}
<small>
{t(
connection.protocol === "bigmodel_video"
? "models.service.bigmodelVideoReferences"
: connection.protocol === "kling_video"
? "models.service.klingReferences"
: "models.service.officialReferences",
)}
</small>
</div>
);
// Inside a model row the details stay on one line: the declared facts and
// the switches, without the card padding that used to open an empty block.
if (compact && (connection.kind === "agent" || official)) {
return (
<div className="cw-model-capability-card is-compact">
<fieldset disabled={disabled || loading}>
{agentInputs || officialFacts}
{error && (
<p role="alert" className="cw-model-feedback">
{error}
</p>
)}
</fieldset>
</div>
);
}
return (
<details
className="cw-model-capability-card"
open={official ? true : undefined}
>
<summary>
{connection.kind === "agent"
? t("models.service.inputCapabilities")
? t("models.service.capabilities")
: t("models.service.referenceOutput")}
</summary>
<fieldset disabled={disabled || loading}>
{connection.kind === "agent" ? (
<>
<div className="cw-model-modalities">
<label>
<input type="checkbox" checked disabled />
{t("models.service.textInput")}
</label>
<label>
<input
type="checkbox"
checked={
(
options.inputModalities ?? saved?.inputModalities
)?.includes("image") ?? false
}
onChange={(event) =>
onChange({
inputModalities: event.target.checked
? ["text", "image"]
: ["text"],
})
}
/>
{t("models.service.imageInput")}
</label>
</div>
<p className="cw-model-note">
{t("models.service.imageInputNote")}
</p>
</>
agentInputs
) : official ? (
<div className="cw-model-capability-facts">
<span>
{t(
connection.protocol === "bigmodel_video"
? "models.service.bigmodelVideoSummary"
: connection.protocol === "kling_video"
? modelId === "kling-4.0-flash"
? "models.service.klingFlashSummary"
: "models.service.klingSummary"
: "models.service.officialSummary",
)}
</span>
{nativeCapabilities ? (
<>
<span>
{nativeCapabilities.outputs
.map((output) => output.resolution)
.join(" / ")}
</span>
<span>
{t("models.service.secondsRange", {
min: Math.min(...nativeDurations),
max: Math.max(...nativeDurations),
})}
</span>
</>
) : (
!error && <span>{t("models.service.loadingNative")}</span>
)}
<small>
{t(
connection.protocol === "bigmodel_video"
? "models.service.bigmodelVideoReferences"
: connection.protocol === "kling_video"
? "models.service.klingReferences"
: "models.service.officialReferences",
)}
</small>
</div>
officialFacts
) : (
<>
{connection.protocol === "vllm_omni" && (
Expand Down
Loading
Loading