Remove invalid --directory flag that broke agent spawning
The --directory flag does not exist in Claude Code CLI. It was added in
c169cfc but caused every agent spawn to exit immediately with "unknown
option", resulting in Session: None errors. The process cwd (set via
cmd.cwd()) already correctly pins agents to the worktree directory.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -226,11 +226,6 @@ impl ProjectConfig {
|
|||||||
args.push(render(sp));
|
args.push(render(sp));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Explicitly set the project directory so Claude Code doesn't
|
|
||||||
// resolve the main checkout via .git worktree indirection.
|
|
||||||
args.push("--directory".to_string());
|
|
||||||
args.push(worktree_path.to_string());
|
|
||||||
|
|
||||||
Ok((command, args, prompt))
|
Ok((command, args, prompt))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,8 +390,7 @@ max_turns = 0
|
|||||||
.render_agent_args("/tmp/wt", "42_foo", None, None)
|
.render_agent_args("/tmp/wt", "42_foo", None, None)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
assert_eq!(cmd, "claude");
|
assert_eq!(cmd, "claude");
|
||||||
assert!(args.contains(&"--directory".to_string()));
|
assert!(args.is_empty());
|
||||||
assert!(args.contains(&"/tmp/wt".to_string()));
|
|
||||||
assert!(prompt.contains("42_foo"));
|
assert!(prompt.contains("42_foo"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user