Review fix (ds-review-bot on #623): the ACP scenario runs at deployment strength (the automation protocol has no session-scoped switch), so the assembled-app path could not detect the delegation bypass itself. The new keyless subagent-inheritance headless scenario closes that on the semantic-checkpoint precedent: a seeded parent log carrying a real sandbox/mode: read-only switch under a workspace-write deployment default is resumed through the Loader-booted cli-demo app via a resume fixture plugin and delegates through the real subagent tool; the child's real write is denied by the real dsh-fs-sandbox fence (physical ENOENT assertion), its persisted header carries the inherited baseline, and both logs pin as expected outputs. Verified red: disabling the driver's capture makes the scenario fail on the disk assertion (the child writes under the deployment default).
26 lines
984 B
TypeScript
26 lines
984 B
TypeScript
/**
|
|
* 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,
|
|
agentOptions: { provider: 'deepseek', model: 'deepseek-v4-flash' },
|
|
})
|
|
ctx.effect(() => () => handle.dispose(), 'subagent-inheritance-agent.handle')
|
|
}
|