fix(subagent-claude-code): tighten provider evidence

This commit is contained in:
pku-xht
2026-08-05 07:32:27 +08:00
parent 80adf8c7f4
commit 6d8095825b
13 changed files with 78 additions and 14 deletions

View File

@@ -60,11 +60,17 @@ class ClaudeCodeProvider implements SubagentProvider {
) {}
start(request: ResolvedSubagentStartRequest) {
const parentCwd = request.parent.session.header.cwd
if (parentCwd === undefined) {
throw new Error(
'subagent-claude-code: no working directory for the child — delegate from a parent session that has one',
)
}
const spec: ClaudeCodeRunSpec = {
cwd: resolveChildCwd(
'subagent-claude-code',
undefined,
request.parent.session.header.cwd,
parentCwd,
),
env: this.config.env,
disposeGraceMs: this.config.disposeGraceMs,