{"record":{"id":"9e0d95a27c9ab898","repo":"deepseek-ai/deepseek-harness","slug":"command-list-failed-result-error-code-resul","errorCode":null,"errorMessage":"command.list failed: ${result.error.code}: ${result.error.message}","messagePattern":"command\\.list failed: (.+?): (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/client/ui-commands/src/client/service.ts","lineNumber":141,"sourceCode":"\n  private readonly directory: CommandDirectory\n  private readonly live: LiveState = { contributions: new Map(), decorations: new Map(), popups: new Map() }\n  /** `command`-namespace translator (composer refusal notices). */\n  private readonly t: TranslateNS<'command'>\n\n  /**\n   * @param ctx - owning root context (plugin fiber; the service registers\n   * itself as `command` and follows that fiber's lifetime).\n   */\n  constructor(ctx: Context) {\n    super(ctx, 'commandUi')\n    const locale = ctx.get('locale')\n    if (locale === undefined) throw new Error('ui-commands: locale service unavailable')\n    this.t = locale.bind('command')\n    this.directory = new CommandDirectory(async (sessionId) => {\n      if (this.sessions().subagentAddress(sessionId) !== undefined) return []\n      const result = await ctx.remote.commands.list(sessionId)\n      if (!result.ok) throw new Error(`command.list failed: ${result.error.code}: ${result.error.message}`)\n      return result.value\n    })\n    const inputTriggers = ctx.get('inputTriggers')\n    if (inputTriggers === undefined) throw new Error('ui-commands: slash service unavailable')\n    ctx.effect(() => inputTriggers.registerSource({\n      trigger: '/',\n      name: 'command',\n      candidates: (session, req) => this.candidates(session, req),\n      onPick: pick => this.dispatch(pick),\n      matchSpace: (session, token) => this.matchSpace(session, token),\n      matchEnter: (session, line, signal, envelope) => this.matchEnter(session, line, signal, envelope),\n      warm: (session) => { this.directory.warm(session.sessionId) },\n    }), 'command: slash source')\n    ctx.remote.$on('commands/change', () => { this.directory.invalidateAll() })\n    // A preset switch changes which commands one session's agent resolves and\n    // registers nothing globally, so the registry-wide signal above never\n    // fires for it: repull that key alone, soft, so the old snapshot serves\n    // the menu until the new one lands.","sourceCodeStart":123,"sourceCodeEnd":159,"githubUrl":"https://github.com/deepseek-ai/deepseek-harness/blob/b150a551b8d465e31e418e1b2eaf5e79bbb7d28e/packages/client/ui-commands/src/client/service.ts#L123-L159","documentation":"The ui-commands service wires CommandDirectory's pull callback to ctx.remote.commands.list(sessionId). When that RPC resolves non-ok, the pull throws 'command.list failed: <code>: <message>'; refresh() stores it as entry.lastError, and it later resurfaces wrapped from ensureReady() (error 180) or propagates directly to anyone awaiting the refresh path. Subagent-addressed sessions skip the RPC and return an empty list.","triggerScenarios":"Any catalog pull — warm(sessionId), an explicit refresh(sessionId), the background repull after invalidateAll() (a commands-changed event), or resetConnected() on reconnect — where commands.list responds with a non-ok result: unknown session, permission denial, or a host-side handler failure.","commonSituations":"Client and host version skew (host predates the commands.list RPC or changed its request fields); session terminated server-side while the UI still shows it; reverse proxy or gateway returning an error envelope; the host plugin serving commands failed to activate.","solutions":["Read the embedded result.error.code in the thrown message to identify the host-side refusal reason","Verify client and host run matching protocol versions so commands.list exists with the same request fields","Confirm the session is live and not subagent-addressed before pulling","Reconnect and let resetConnected() repull once the transport is restored"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (sessions.subagentAddress(sessionId) !== undefined) return [] // no RPC needed\nif (!connectionHealthy()) await reconnect()","typeGuard":null,"tryCatchPattern":"try {\n  return await remote.commands.list(sessionId)\n} catch (error) {\n  reportDegradedCatalog(sessionId, error) // empty catalog plus notice, never a silent success\n  throw error\n}","preventionTips":["Pin web client and host to the same release so the commands RPC contract matches","Treat catalog failure as picker-unavailable rather than crashing the composer","Log the embedded error code — it names the host-side refusal precisely"],"tags":["rpc","slash-commands","version-skew","host"],"backgroundTag":"rpc-request-failed","analyzedSha":"b150a551b8d465e31e418e1b2eaf5e79bbb7d28e","analyzedAt":"2026-08-24T18:12:29.105Z","schemaVersion":2},"datasetVersion":"2026-08-24T22:17:12.610Z"}