review errors
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"log/slog"
|
||||
"net/http"
|
||||
"os"
|
||||
"os/exec"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -115,12 +116,15 @@ func playwrightMCP(outputDir string) mcp.Stdio {
|
||||
}
|
||||
}
|
||||
|
||||
func (m *Manager) implementerVendor(ctx context.Context, taskID string) api.AgentSessionVendor {
|
||||
var vendorCommands = map[api.AgentSessionVendor]string{api.Claude: "claude", api.Codex: "codex", api.Antigravity: "agy"}
|
||||
|
||||
func (m *Manager) implementerModel(ctx context.Context, taskID string) (api.AgentSessionVendor, string) {
|
||||
sessions, err := m.store.ListSessions(ctx, taskID)
|
||||
if err != nil || len(sessions) == 0 {
|
||||
return api.Claude
|
||||
return api.Claude, reviewModels[api.Claude]
|
||||
}
|
||||
return sessions[len(sessions)-1].Vendor
|
||||
last := sessions[len(sessions)-1]
|
||||
return last.Vendor, last.Model
|
||||
}
|
||||
|
||||
func reviewVendor(implementer api.AgentSessionVendor) api.AgentSessionVendor {
|
||||
@@ -130,13 +134,22 @@ func reviewVendor(implementer api.AgentSessionVendor) api.AgentSessionVendor {
|
||||
return api.Codex
|
||||
}
|
||||
|
||||
func (m *Manager) reviewerModel(ctx context.Context, taskID string) (api.AgentSessionVendor, string) {
|
||||
implVendor, implModel := m.implementerModel(ctx, taskID)
|
||||
vendor := reviewVendor(implVendor)
|
||||
_, err := exec.LookPath(vendorCommands[vendor])
|
||||
if err != nil {
|
||||
return implVendor, implModel
|
||||
}
|
||||
return vendor, reviewModels[vendor]
|
||||
}
|
||||
|
||||
func (m *Manager) startReviewer(ctx context.Context, task api.Task, snap api.Snapshot) error {
|
||||
project, err := m.store.GetProject(ctx, task.ProjectId)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
vendor := reviewVendor(m.implementerVendor(ctx, task.Id))
|
||||
model := reviewModels[vendor]
|
||||
vendor, model := m.reviewerModel(ctx, task.Id)
|
||||
prompt, err := m.reviewPrompt(ctx, task, project, snap)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@@ -269,7 +269,7 @@ func (m *Manager) takeSnapshotTool(l *live) mcp.Tool {
|
||||
}
|
||||
}
|
||||
|
||||
const takeSnapshotDescription = "Snapshot a task's worktree now, uncommitted work included, and start a review of it: a reviewer on the other vendor reviews all of the task's work against the default branch. " +
|
||||
const takeSnapshotDescription = "Snapshot a task's worktree now, uncommitted work included, and start a review of it: a reviewer on the other vendor (or on yours, when the other isn't installed) reviews all of the task's work against the default branch. " +
|
||||
"byre already does this at the end of every turn that changes files; call this to review work mid-turn, or to retry a review that failed (it snapshots even when nothing changed since the last snapshot)."
|
||||
|
||||
func (m *Manager) dropSnapshots(repo, taskID string) error {
|
||||
|
||||
Reference in New Issue
Block a user