fix: address Codex round 4 findings
Some checks failed
CI / test (push) Failing after 3s

High: Codex review now sets working directory (was missing)
Medium: harvest skip-branch check uses defaultBranch() not just "main"
Medium: dry_run reads PROMPT.md from src/ (was reading wrong path)
Low: agent prompt says "current directory" not "parent directory"
Low: queue prompt matches dispatch prompt

Finding 1 (inbox messages vs data) verified as false positive —
API returns {messages:[...]}, confirmed against live endpoint.

Co-Authored-By: Virgil <virgil@lethean.io>
This commit is contained in:
Snider 2026-03-21 16:36:26 +00:00
parent 67249fa78f
commit e4f94eaaab
4 changed files with 8 additions and 5 deletions

View file

@ -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,

View file

@ -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 {

View file

@ -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)

View file

@ -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
}