fix(subagent-acp): repair the composition fixture for the merged depth budget

Master landed the tool-subagent depth budget while this branch was in
flight: the numeric default maxDepth now fails the mount against the
ACP provider's depthLimit: false, so the composition fixture must state
maxDepth: 'provider-managed' — the documented opt-out for a provider
whose recursion budget lives in the child harness. The fixture also
moves off the retired stdio-demo REPL onto the current app-boot driver
pattern (runLoaderSmoke + one-shot cli), and the split isDirectory
statements gain the file-not-a-directory case the single-expression
form used to cover implicitly.
This commit is contained in:
Yichen Jiang
2026-07-21 17:14:10 +08:00
parent 6fe8cfb5d1
commit c0d7ef22ec
5 changed files with 86 additions and 80 deletions
@@ -262,6 +262,20 @@ describe('cwd resolution', () => {
.rejects.toThrow('must be an absolute path')
})
it('rejects a parent session cwd that names a FILE, not a directory', async () => {
const tmp = mkdtempSync(join(tmpdir(), 'acp-file-cwd-'))
const file = join(tmp, 'a-file')
writeFileSync(file, 'x')
try {
const ctx = await setup({})
const parent = { id: 'parent', session: { header: { cwd: file } } } as unknown as Agent
await expect(ctx.subagents.start('acp', { prompt: [{ type: 'text' as const, text: 'p' }], parent, signal: new AbortController().signal }))
.rejects.toThrow('not an accessible directory')
} finally {
rmSync(tmp, { recursive: true, force: true })
}
})
it('rejects a parent session cwd that is not an accessible directory, before spawning', async () => {
const tmp = mkdtempSync(join(tmpdir(), 'acp-bad-parent-cwd-'))
const sentinel = join(tmp, 'spawned')