diff --git a/pkg/agentic/dispatch.go b/pkg/agentic/dispatch.go index 1a0783c..fd96521 100644 --- a/pkg/agentic/dispatch.go +++ b/pkg/agentic/dispatch.go @@ -246,11 +246,11 @@ func (s *PrepSubsystem) dispatch(ctx context.Context, req *mcp.CallToolRequest, srcDir := filepath.Join(wsDir, "src") // The prompt is just: read PROMPT.md and do the work - prompt := "Read PROMPT.md for instructions. All context files (CLAUDE.md, TODO.md, CONTEXT.md, CONSUMERS.md, RECENT.md) are in the parent directory. Work in this directory." + prompt := "Read PROMPT.md for instructions. All context files (CLAUDE.md, TODO.md, CONTEXT.md, CONSUMERS.md, RECENT.md) are in the current directory. Work in this directory." if input.DryRun { // Read PROMPT.md for the dry run output - promptContent, _ := coreio.Local.Read(filepath.Join(wsDir, "PROMPT.md")) + promptContent, _ := coreio.Local.Read(filepath.Join(srcDir, "PROMPT.md")) return nil, DispatchOutput{ Success: true, Agent: input.Agent, diff --git a/pkg/agentic/queue.go b/pkg/agentic/queue.go index b88d88c..c990024 100644 --- a/pkg/agentic/queue.go +++ b/pkg/agentic/queue.go @@ -190,7 +190,7 @@ func (s *PrepSubsystem) drainQueue() { } srcDir := filepath.Join(wsDir, "src") - prompt := "Read PROMPT.md for instructions. All context files (CLAUDE.md, TODO.md, CONTEXT.md, CONSUMERS.md, RECENT.md) are in the parent directory. Work in this directory." + prompt := "Read PROMPT.md for instructions. All context files (CLAUDE.md, TODO.md, CONTEXT.md, CONSUMERS.md, RECENT.md) are in the current directory. Work in this directory." pid, _, err := s.spawnAgent(st.Agent, prompt, wsDir, srcDir) if err != nil { diff --git a/pkg/agentic/review_queue.go b/pkg/agentic/review_queue.go index 576bae9..013abc5 100644 --- a/pkg/agentic/review_queue.go +++ b/pkg/agentic/review_queue.go @@ -312,7 +312,9 @@ func parseRetryAfter(message string) time.Duration { func (s *PrepSubsystem) buildReviewCommand(ctx context.Context, repoDir, reviewer string) *exec.Cmd { switch reviewer { case "codex": - return exec.CommandContext(ctx, "codex", "review", "--base", "github/main") + cmd := exec.CommandContext(ctx, "codex", "review", "--base", "github/main") + cmd.Dir = repoDir + return cmd default: // coderabbit return exec.CommandContext(ctx, "coderabbit", "review", "--plain", "--base", "github/main", "--config", "CLAUDE.md", "--cwd", repoDir) diff --git a/pkg/monitor/harvest.go b/pkg/monitor/harvest.go index 2ab5dd7..df04e8b 100644 --- a/pkg/monitor/harvest.go +++ b/pkg/monitor/harvest.go @@ -110,7 +110,8 @@ func (m *Subsystem) harvestWorkspace(wsDir string) *harvestResult { if branch == "" { branch = detectBranch(srcDir) } - if branch == "" || branch == "main" { + base := defaultBranch(srcDir) + if branch == "" || branch == base { return nil }