2026-07-27 12:54:54 +08:00
|
|
|
/**
|
|
|
|
|
* Loader fixture that resumes the seeded read-only parent before CLI dispatch.
|
|
|
|
|
* @module subagent-inheritance-agent
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import type { Context } from 'cordis'
|
|
|
|
|
import type { SessionId } from '@deepseek-ai/dsh-session'
|
|
|
|
|
|
|
|
|
|
/** Fixture plugin name. */
|
|
|
|
|
export const name = 'subagent-inheritance-agent'
|
|
|
|
|
/** Services that must exist before the fixture resumes its agent. */
|
|
|
|
|
export const inject = ['agents', 'agentLoop', 'sessionPersistence']
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Resume the seeded session and bind its exact handle to this fixture's lifetime.
|
|
|
|
|
* @param ctx - settled agent and persistence services from the Loader tree.
|
|
|
|
|
* @returns after the resumed agent is published.
|
|
|
|
|
*/
|
|
|
|
|
export async function apply(ctx: Context): Promise<void> {
|
|
|
|
|
const handle = await ctx.agents.resume({
|
|
|
|
|
resumeSessionId: 'subagent-inheritance-parent' as SessionId,
|
2026-07-29 16:36:07 +08:00
|
|
|
agentOptions: { provider: 'deepseek-official', model: 'deepseek-v4-flash' },
|
2026-07-27 12:54:54 +08:00
|
|
|
})
|
|
|
|
|
ctx.effect(() => () => handle.dispose(), 'subagent-inheritance-agent.handle')
|
|
|
|
|
}
|