fix(mobile): read the model catalog shape the Harness actually serves - #311
Merged
yaojin3616 merged 1 commit intoSep 5, 2026
Merged
Conversation
The mobile session-settings page read modelCatalog.current and
modelCatalog.routable, but session/modelCatalog has always served
{ default, routableProviders, groups, failures }:
- modelCatalog.current is undefined, so no option matched and the
select displayed the first catalog entry instead of the running model
- modelCatalog.routable is undefined, so the model and effort selects
were permanently disabled
Read default as the current selection (falling back to current for
older builds), derive the routable flag from routableProviders, keep
the error fallback in the real shape, and update both fields after a
successful selection.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Two bugs in the mobile session-settings panel (Model selector), both caused by the page reading a field shape
session/modelCatalogdoes not serve:syncSettingsControlscomputesmodel.disabled = settingsBusy || !modelCatalog?.routable, but the catalog has noroutablefield — it servesroutableProviders: string[].!undefinedis alwaystrue, so the select can never be enabled.renderSessionSettingsreadsmodelCatalog.current, but the catalog servesdefault: { provider, model, reasoningEffort? }.currentisundefined, so no<option>matches and the select falls back to rendering the first catalog entry instead of the model the desktop is actually running.Verified against the host contract (
@deepseek-ai/dsh-api-session-controllertypert schema):and against a live Harness:
GET session/modelCatalogreturns exactly that shape (default= the selection actually in use,routableProvidersnon-empty).Fix
In
lan-mobile-pages.ts, read the real shape with a fallback for older builds:modelCatalog.current ?? modelCatalog.default ?? {}(modelCatalog.routableProviders?.length ?? 0) > 0 || modelCatalog.routable === truedefault+routableProviders: [])session.selectModel, bothcurrentanddefaultare updatedTest
node --checkon the extracted page script: syntax OK.default) correctly.Note
session/modelCatalogtakes no session argument, sodefaultis the host-wide last/default selection, not a per-session override. Mobile can only display that value; per-session display would need a host API addition (out of scope here).