refactor: unify errand worktree paths to use agent-workdirs/<alias>/
Errands now create worktrees via ProcessManager.createWorktreesForProjects() into agent-workdirs/<alias>/<project.name>/ instead of repos/<project>/.cw-worktrees/<errandId>. This makes getAgentWorkdir + resolveAgentCwd work correctly for all agent types. Key changes: - Extract createWorktreesForProjects() from createProjectWorktrees() in ProcessManager - Add resolveAgentCwd() to ProcessManager (probes for .cw/output in subdirs) - Add projectId to SpawnAgentOptions for single-project agents (errands) - Skip auto-cleanup for errand agents (worktrees persist for merge/abandon) - Errand router uses agentManager.delete() for cleanup instead of SimpleGitWorktreeManager - Remove cwd parameter from sendUserMessage (resolves via worktreeId) - Add pruneProjectRepos() to CleanupManager for errand worktree refs
This commit is contained in:
@@ -534,7 +534,7 @@ export class MockAgentManager implements AgentManager {
|
||||
* Deliver a user message to a running errand agent.
|
||||
* Mock implementation: no-op (simulates message delivery without actual process interaction).
|
||||
*/
|
||||
async sendUserMessage(agentId: string, _message: string, _cwd?: string): Promise<void> {
|
||||
async sendUserMessage(agentId: string, _message: string): Promise<void> {
|
||||
const record = this.agents.get(agentId);
|
||||
if (!record) {
|
||||
throw new Error(`Agent '${agentId}' not found`);
|
||||
|
||||
Reference in New Issue
Block a user