Repository navigation
Replies: 1 comment
|
Still reproducible on current 0.2.1-rc.1 added a per-model reasoning-level editor ( The patch offers the levels for any row the loaded catalog does not describe, and only for those:
Verification on
(Related: #843 β the rc.1 editor covers hand-declared routes; this is the shipped-route half.) Patch (applies to 687f282)diff --git a/packages/client/ui-settings-models/src/client/ModelListEditor.tsx b/packages/client/ui-settings-models/src/client/ModelListEditor.tsx
index c80f638f7c2..065e98bd012 100644
--- a/packages/client/ui-settings-models/src/client/ModelListEditor.tsx
+++ b/packages/client/ui-settings-models/src/client/ModelListEditor.tsx
@@ -368,7 +368,12 @@ export function ModelListEditor(props: ModelListEditorProps): ReactNode {
inputField="input"
inputFallback={inputDefaults.get(textOf(model, 'id')) ?? props.defaultInput}
inputLoading={catalogProvider !== undefined && catalog === undefined}
- reasoningLevels={props.reasoningLevels}
+ // A row whose id the installed catalog lacks has nothing to inherit
+ // reasoning from, on a shipped route as much as on a hand-declared one.
+ reasoningLevels={catalogProvider === undefined
+ || (catalog !== undefined && !catalog.some(entry => entry.id === textOf(model, 'id')))
+ ? props.reasoningLevels
+ : undefined}
expanded={expanded.has(index)}
disabled={disabled}
t={t}
diff --git a/packages/client/ui-settings-models/src/client/ProviderEditor.tsx b/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
index 262f8c9d555..b9c8a967bfb 100644
--- a/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
+++ b/packages/client/ui-settings-models/src/client/ProviderEditor.tsx
@@ -224,14 +224,15 @@ export function ProviderEditor(props: ProviderEditorProps): ReactNode {
// The model list is validated by the same per-row checker for both families,
// so a bad row is named by its position rather than by a blanket message.
- // Only a hand-declared pi-ai route's rows edit reasoning levels β the one
- // model list with no installed catalog behind it β so only there are the
- // levels read and the declarations checked.
+ // A pi-ai row edits reasoning levels when no installed catalog entry supplies
+ // them: every row of a hand-declared route, and a shipped route's row whose
+ // id its catalog does not list (the list editor tells those apart). Only a
+ // hand-declared route has its declarations checked here.
const reasoningLevels = useMemo(
- () => layout === 'pi-ai' && props.declared === true ? reasoningLevelChoices(namespace, schema) : [],
- [layout, props.declared, namespace, schema],
+ () => layout === 'pi-ai' ? reasoningLevelChoices(namespace, schema) : [],
+ [layout, namespace, schema],
)
- const editsReasoning = reasoningLevels.length > 0
+ const editsReasoning = props.declared === true && reasoningLevels.length > 0
const validateModels = (value: unknown): DeepSeekModelsValidationFailure | ReasoningEffortsFailure | undefined =>
validateDeepSeekModels(value) ?? (editsReasoning ? validateReasoningEfforts(value) : undefined)
const modelFailure = validateModels(schema.getPath(draft, ['models']))
diff --git a/packages/client/ui-settings-models/tests/model-list-catalog.client.spec.tsx b/packages/client/ui-settings-models/tests/model-list-catalog.client.spec.tsx
index 1e40a70f1ef..8ddba7ddbf2 100644
--- a/packages/client/ui-settings-models/tests/model-list-catalog.client.spec.tsx
+++ b/packages/client/ui-settings-models/tests/model-list-catalog.client.spec.tsx
@@ -17,6 +17,30 @@ function operations(discoverModels: ModelsOperations['discoverModels']): ModelsO
}
}
+it('offers reasoning levels for a model the shipped routeβs catalog lacks, and only for it', async () => {
+ const onChange = vi.fn()
+ render(<ModelListEditor
+ models={[{ id: 'deepseek-v4-pro' }, { id: 'DeepSeek-V4.1-Flash' }]} onChange={onChange} catalogProvider="deepseek"
+ reasoningLevels={['off', 'low', 'medium', 'high']}
+ probe={{ settingsNs: 'llm-pi-ai', provider: 'deepseek' }} disabled={false} t={key => en[key]} onBusyChange={() => {}}
+ operations={operations(() => Promise.resolve({ kind: 'found', models: [{ id: 'deepseek-v4-pro' }] }))}
+ />)
+ fireEvent.click(screen.getByRole('button', { name: `${en.modelAdvanced} 1` }))
+ fireEvent.click(screen.getByRole('button', { name: `${en.modelAdvanced} 2` }))
+ await screen.findByRole('group', { name: `${en.modelReasoning} 2` })
+ expect(screen.queryByRole('group', { name: `${en.modelReasoning} 1` })).toBeNull()
+})
+
+it('withholds reasoning levels on a shipped route until its catalog answers', () => {
+ render(<ModelListEditor
+ models={[{ id: 'unlisted' }]} onChange={vi.fn()} catalogProvider="deepseek" reasoningLevels={['off', 'high']}
+ probe={{ settingsNs: 'llm-pi-ai', provider: 'deepseek' }} disabled={false} t={key => en[key]} onBusyChange={() => {}}
+ operations={operations(() => new Promise<ModelDiscoveryOutcome>(() => {}))}
+ />)
+ fireEvent.click(screen.getByRole('button', { name: `${en.modelAdvanced} 1` }))
+ expect(screen.queryByRole('group', { name: `${en.modelReasoning} 1` })).toBeNull()
+})
+
it('ignores a late catalog response after the provider changes', async () => {
const oldCatalog = Promise.withResolvers<ModelDiscoveryOutcome>()
const newCatalog = Promise.withResolvers<ModelDiscoveryOutcome>() |
Uh oh!
There was an error while loading. Please reload this page.
Title: Settings β Models: hand-added models get no Effort picker (
reasoningEffortsnot settable in the UI), and "Fetch available models" never consults the live endpoint for known providersEnvironment
@deepseek-ai/dsh@0.1.1-rc.2(installed vianpx), web GUISteps to reproduce
stealth/*model. At0.1.1-rc.2the bundled catalog (@earendil-works/pi-ai@0.82.1,dist/providers/data/openrouter.json) has 276 OpenRouter models while the live/api/v1/modelslists 421+, includingstealth/ox-alpha.reasoning.mandatory = true).Observed behavior / root cause
A hand-added entry has no installed-catalog twin, so
resolveModelReasoning()in@deepseek-ai/dsh-llm-pi-airesolves it as{ reasoning: false }unless the entry declaresreasoningEfforts.The Models page deliberately offers no effort field β its source comments explain that effort is a per-model capability and a per-provider control would be wrong. Agreed β but that argues for a per-model field, which is exactly what's missing.
The only workaround is hand-editing
~/.dsh/settings.yaml:After adding that block the Effort menu renders Low/High/Max correctly. The schema rules (allowed keys, omitted β unsupported, only
off:may be empty) exist only in source docstrings, not user-facing docs.Separately, "Fetch available models" cannot help:
discoverModels()returnscatalogModels(provider)whenever the provider ships a catalog, so for known providers it re-lists the same bundled entries and never hits the network. Live listing only happens for custom providers where the user typed a base URL.Requests
reasoningEffortsas a per-model field in the Settings β Models editor (the models grid already edits id/name/contextWindow/maxTokens).{baseURL}/modelswhen the user explicitly asks to fetch β so models newer than the package build can be discovered from the GUI. The live-fetch code path already exists and parses OpenAI-style{ data: [...] }responses fine.Happy to split into separate issues if you prefer. A community writeup of the full workaround lives here: https://github.com/Ali0600/dsh-openrouter-models.
All reactions