{"record":{"id":"2d1b48c78aa2d1bf","repo":"deepseek-ai/deepseek-harness","slug":"this-provider-s-catalog-failed-to-load-pick-a-mo","errorCode":null,"errorMessage":"this provider's catalog failed to load — pick a model from a loaded group","messagePattern":"this provider's catalog failed to load — pick a model from a loaded group","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"packages/client/ui-model-selection/src/client/index.ts","lineNumber":145,"sourceCode":"      name: 'model',\n      description: t('command.description'),\n      available: session => sessions.subagentAddress(session.sessionId) === undefined,\n      ui: {\n        kind: 'popupSelect',\n        options: async (session) => {\n          if (sessions.subagentAddress(session.sessionId) !== undefined) {\n            throw new Error('model selection is unavailable for addressed subagent sessions')\n          }\n          return optionsOf(await models.directoryFor(session.sessionId).load(), t)\n        },\n        onSelect: async (option, session) => {\n          if (sessions.subagentAddress(session.sessionId) !== undefined) {\n            throw new Error('model selection is unavailable for addressed subagent sessions')\n          }\n          const directory = models.directoryFor(session.sessionId)\n          const selection = selectionOf(directory.store.getSnapshot(), option.id)\n          if (selection === undefined) {\n            throw new Error('this provider\\'s catalog failed to load — pick a model from a loaded group')\n          }\n          await directory.select(selection)\n        },\n      },\n    }), 'ui-model-selection: /model contribution')\n  })\n\n  // Entry 2: the composer's named model seat over the SAME directory.\n  ctx.inject(['slots', 'modelDirectories'], (scope: ClientContext) => {\n    const models = scope.modelDirectories\n    const sessions = scope.sessions\n    scope.slots.inject('conversation.input.model', () => scope.slots.register({\n      name: 'conversation.input.model',\n      locale: NS,\n      inject: (sessionId): ModelSelectInjected => {\n        const directory = models.directoryFor(sessionId)\n        const available = sessions.subagentAddress(sessionId) === undefined\n        return {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/ui-model-selection/src/client/index.ts#L127-L163","documentation":"The /model command contribution maps an option id to a selection via selectionOf over the directory store snapshot. When the provider's catalog never loaded (load failed or groups still empty), no group contains the option, selectionOf returns undefined, and apply throws this user-facing guidance message telling the user to pick from a loaded group.","triggerScenarios":"Running /model with an option id (or applying a saved option) while directory.store holds no loaded groups — status 'error' or an empty group list. Addressed subagent sessions are refused earlier by their own check; this error is strictly the unloaded-catalog case.","commonSituations":"Typing a remembered model id while the provider catalog is down; applying an option captured before a provider switch; racing the first catalog load on mount.","solutions":["Trigger a catalog load/refresh and wait for a ready status before selecting","Pick from the loaded groups in the picker instead of a remembered id","If load keeps failing, fix the host-side provider first (see the session.models failure)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const snap = directory.store.getSnapshot()\nif (snap.groups.length === 0 || snap.status === 'error') {\n  await directory.load()\n}\nconst selection = selectionOf(directory.store.getSnapshot(), option.id)\nif (selection === undefined) return unavailableNotice()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never carry model ids across provider switches without re-validating them against a loaded catalog","Wait for directory status ready before enabling /model application"],"tags":["models","catalog","ui","slash-commands"],"backgroundTag":"catalog-not-loaded","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}