{"record":{"id":"ab1b4e00b915812e","repo":"CherryHQ/cherry-studio","slug":"unsupported-agent-runtime-type-entry-agenttype","errorCode":null,"errorMessage":"Unsupported agent runtime type: ${entry.agentType}","messagePattern":"Unsupported agent runtime type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/main/ai/agentSession/AgentSessionRuntimeService.ts","lineNumber":1453,"sourceCode":"        ) {\n          this.applyRuntimeStateEvent(entry, { type: 'connection-disconnected' })\n        }\n      })\n      this.connectionAttempts.set(entry.sessionId, { id: attemptId, promise: connecting })\n      const connected = await connecting\n      if (connected) return true\n    }\n\n    return false\n  }\n\n  private async connect(\n    entry: AgentSessionRuntimeEntry,\n    target: AgentSessionConnectionTarget,\n    attemptId: string\n  ): Promise<boolean> {\n    const driver = runtimeDriverRegistry.getAgentSessionDriver(entry.agentType)\n    if (!driver) throw new Error(`Unsupported agent runtime type: ${entry.agentType}`)\n\n    this.hydrateResumeToken(entry)\n    if (!this.isCurrentEntry(entry)) return false\n\n    const connection = await driver.connect({\n      sessionId: entry.sessionId,\n      agentId: entry.agentId,\n      modelId: target.modelId,\n      reasoningEffort: target.reasoningEffort,\n      knowledgeBaseIds: target.knowledgeBaseIds,\n      fastMode: target.fastMode,\n      resumeToken: entry.lastResumeToken,\n      trace: this.sessionTraceContext(entry, target.modelId),\n      onSteerInjected: (inputs) => this.reserveSteerContinuation(entry, inputs)\n    })\n    if (!this.isCurrentEntry(entry) || !this.connectionTargetEquals(entry, target)) {\n      void this.closeRuntimeConnection(connection, entry.sessionId)\n      return false","sourceCodeStart":1435,"sourceCodeEnd":1471,"githubUrl":"https://github.com/CherryHQ/cherry-studio/blob/726446b54cd69ffe51a276638672f6d95ca0768c/src/main/ai/agentSession/AgentSessionRuntimeService.ts#L1435-L1471","documentation":"Thrown by AgentSessionRuntimeService.connect when no driver is registered in runtimeDriverRegistry for the entry's agentType. Drivers implement the connect/streaming protocol for a specific agent runtime (e.g. a particular agent SDK); the registry maps agentType strings to driver instances. An unregistered type means the runtime cannot establish a connection and the code fails fast rather than silently no-op'ing.","triggerScenarios":"An agent session is created with an agentType that has no driver registered — e.g. a new agent type was introduced in data without a corresponding driver, a plugin/driver failed to load or register at startup, or the agentType string is a typo/mismatch between the persisted agent and the registered driver keys.","commonSituations":"Adding a new agent runtime but forgetting to register its driver in the driver registry; a conditional/plugin that registers a driver did not load (disabled feature flag, failed import); a data migration or import created an agent with an agentType the current build does not support; version skew between the persisted agent type and the installed app version.","solutions":["Confirm a driver is registered for the agent's agentType in runtimeDriverRegistry (search for registerAgentSessionDriver / the registration call site for that type).","If the driver is plugin-gated, ensure the plugin/feature is enabled and loaded at startup.","If the agentType is stale (from an older version or a typo), migrate or recreate the agent with a supported agentType.","Add a registration for the new agentType if you intentionally introduced a new runtime."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before opening a session, confirm a driver is registered for the agentType\nconst driver = runtimeDriverRegistry.getAgentSessionDriver(agent.agentType)\nif (!driver) {\n  throw new Error(`No runtime driver for agentType '${agent.agentType}'. Register one or use a supported type.`)\n}","typeGuard":"const isRegisteredAgentType = (t: string): boolean =>\n  runtimeDriverRegistry.getAgentSessionDriver(t) != null","tryCatchPattern":null,"preventionTips":["Register every agent runtime driver in the registry at startup.","Validate persisted agents against registered driver types on load; flag stale types to the user.","If drivers are plugin-gated, fail loudly at startup when a required plugin is missing rather than at connect time.","Keep agentType strings versioned and migrate them when renaming a runtime."],"tags":["ai","agent","runtime","registry","validation"],"backgroundTag":null,"analyzedSha":"726446b54cd69ffe51a276638672f6d95ca0768c","analyzedAt":"2026-08-12T17:30:37.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}