fix(session-title): harden async provider lifecycle
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
"license": "BSD-3-Clause",
|
||||
"peerDependencies": {
|
||||
"@deepseek-ai/dsh-llm": "^0.0.1",
|
||||
"@deepseek-ai/dsh-session": "^0.0.1",
|
||||
"@deepseek-ai/dsh-session-title": "^0.0.1",
|
||||
"@deepseek-ai/dsh-session-title-llm": "^0.0.1",
|
||||
"cordis": "^4.0.0-rc.7"
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import type { SessionTitleLlmConfig } from '@deepseek-ai/dsh-session-title-llm'
|
||||
|
||||
export const name = 'session-title-first-message-llm'
|
||||
export const inject = ['sessionTitle', 'llm']
|
||||
export const inject = ['sessionTitle', 'llm', 'sessions']
|
||||
|
||||
/** Required LLM policy; this plugin adds no defaults. */
|
||||
export type Config = SessionTitleLlmConfig
|
||||
@@ -28,7 +28,7 @@ export const Config: z<Config> = z.object({
|
||||
|
||||
/**
|
||||
* Register the first-message model provider.
|
||||
* @param ctx - context exposing session-title and LLM services.
|
||||
* @param ctx - context exposing session-title, LLM, and session services.
|
||||
* @param config - required route, target, byte, token, and timeout policy.
|
||||
*/
|
||||
export function apply(ctx: Context, config: Config): void {
|
||||
|
||||
@@ -40,7 +40,7 @@ describe('first-message LLM title provider', () => {
|
||||
let registered: SessionTitleProvider | undefined
|
||||
vi.spyOn(ctx.sessionTitle, 'register').mockImplementation((provider) => {
|
||||
registered = provider
|
||||
return () => undefined
|
||||
return async () => undefined
|
||||
})
|
||||
providerPlugin.apply(ctx, LLM_CONFIG)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user