


























@@ -78,8 +78,6 @@ export type DiscordModelPickerModelViewParams = {
7878currentModel?: string;
7979pendingModel?: string;
8080pendingModelIndex?: number;
81-currentRuntime?: string;
82-pendingRuntime?: string;
8381quickModels?: string[];
8482layout?: DiscordModelPickerLayout;
8583};
@@ -166,37 +164,6 @@ function createModelSelect(params: {
166164return new DiscordModelPickerSelect();
167165}
168166169-function getRuntimeChoices(params: {
170-data: ModelsProviderData;
171-provider: string;
172-}): Array<{ id: string; label: string; description?: string }> {
173-return (
174-params.data.runtimeChoicesByProvider?.get(normalizeProviderId(params.provider)) ?? [
175-{
176-id: "pi",
177-label: "OpenClaw Pi Default",
178-description: "Use the built-in OpenClaw Pi runtime.",
179-},
180-]
181-);
182-}
183-184-function resolveSelectedRuntime(params: {
185-data: ModelsProviderData;
186-provider: string;
187-currentRuntime?: string;
188-pendingRuntime?: string;
189-}): string {
190-const choices = getRuntimeChoices({ data: params.data, provider: params.provider });
191-const allowed = new Set(choices.map((choice) => choice.id));
192-const pending = params.pendingRuntime?.trim();
193-if (pending && allowed.has(pending)) {
194-return pending;
195-}
196-const current = params.currentRuntime?.trim();
197-return current && allowed.has(current) ? current : "pi";
198-}
199-200167function buildRenderedShell(
201168params: DiscordModelPickerRenderShellParams,
202169): DiscordModelPickerRenderedView {
@@ -276,8 +243,6 @@ function buildModelRows(params: {
276243currentModel?: string;
277244pendingModel?: string;
278245pendingModelIndex?: number;
279-currentRuntime?: string;
280-pendingRuntime?: string;
281246quickModels?: string[];
282247}): { rows: DiscordModelPickerRow[]; buttonRow: Row<Button> } {
283248const parsedCurrentModel = parseCurrentModelRef(params.currentModel);
@@ -314,56 +279,6 @@ function buildModelRows(params: {
314279]),
315280);
316281317-const runtimeChoices = getRuntimeChoices({
318-data: params.data,
319-provider: params.modelPage.provider,
320-});
321-const selectedRuntime = resolveSelectedRuntime({
322-data: params.data,
323-provider: params.modelPage.provider,
324-currentRuntime: params.currentRuntime,
325-pendingRuntime: params.pendingRuntime,
326-});
327-const normalizedCurrentRuntime = params.currentRuntime?.trim();
328-const shouldCarryRuntime =
329-runtimeChoices.length > 1 ||
330-(Boolean(normalizedCurrentRuntime) &&
331-normalizedCurrentRuntime !== "auto" &&
332-normalizedCurrentRuntime !== "pi" &&
333-normalizedCurrentRuntime !== "default");
334-const stateRuntime = shouldCarryRuntime ? selectedRuntime : undefined;
335-if (runtimeChoices.length > 1) {
336-rows.push(
337-new Row([
338-createModelSelect({
339-customId: buildDiscordModelPickerCustomId({
340-command: params.command,
341-action: "runtime",
342-view: "models",
343-provider: params.modelPage.provider,
344-runtime: selectedRuntime,
345-page: params.modelPage.page,
346-providerPage: providerPage.page,
347-modelIndex: params.pendingModelIndex,
348-userId: params.userId,
349-}),
350-options: runtimeChoices.map((choice) => {
351-const option: APISelectMenuOption = {
352-label: choice.label,
353-value: choice.id,
354-default: choice.id === selectedRuntime,
355-};
356-if (choice.description) {
357-option.description = choice.description;
358-}
359-return option;
360-}),
361-placeholder: "Select runtime",
362-}),
363-]),
364-);
365-}
366-367282const selectedModelRef = parsedPendingModel ?? parsedCurrentModel;
368283const modelOptions: APISelectMenuOption[] = params.modelPage.items.map((model) => ({
369284label: model,
@@ -381,7 +296,6 @@ function buildModelRows(params: {
381296action: "model",
382297view: "models",
383298provider: params.modelPage.provider,
384-runtime: stateRuntime,
385299page: params.modelPage.page,
386300providerPage: providerPage.page,
387301userId: params.userId,
@@ -413,7 +327,6 @@ function buildModelRows(params: {
413327action: "cancel",
414328view: "models",
415329provider: params.modelPage.provider,
416-runtime: stateRuntime,
417330page: params.modelPage.page,
418331providerPage: providerPage.page,
419332userId: params.userId,
@@ -428,7 +341,6 @@ function buildModelRows(params: {
428341action: "reset",
429342view: "models",
430343provider: params.modelPage.provider,
431-runtime: stateRuntime,
432344page: params.modelPage.page,
433345providerPage: providerPage.page,
434346userId: params.userId,
@@ -446,7 +358,6 @@ function buildModelRows(params: {
446358action: "recents",
447359view: "recents",
448360provider: params.modelPage.provider,
449-runtime: stateRuntime,
450361page: params.modelPage.page,
451362providerPage: providerPage.page,
452363userId: params.userId,
@@ -465,7 +376,6 @@ function buildModelRows(params: {
465376action: "submit",
466377view: "models",
467378provider: params.modelPage.provider,
468-runtime: stateRuntime,
469379page: params.modelPage.page,
470380providerPage: providerPage.page,
471381modelIndex: params.pendingModelIndex,
@@ -549,19 +459,12 @@ export function renderDiscordModelPickerModelsView(
549459currentModel: params.currentModel,
550460pendingModel: params.pendingModel,
551461pendingModelIndex: params.pendingModelIndex,
552-currentRuntime: params.currentRuntime,
553-pendingRuntime: params.pendingRuntime,
554462quickModels: params.quickModels,
555463});
556464557465const defaultModel = `${params.data.resolvedDefault.provider}/${params.data.resolvedDefault.model}`;
558466const pendingLine = params.pendingModel
559- ? `Selected: ${params.pendingModel} · runtime ${resolveSelectedRuntime({
560- data: params.data,
561- provider: modelPage.provider,
562- currentRuntime: params.currentRuntime,
563- pendingRuntime: params.pendingRuntime,
564- })} (press Submit)`
467+ ? `Selected: ${params.pendingModel} (press Submit)`
565468 : "Select a model, then press Submit.";
566469567470return buildRenderedShell({
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。