configure reviewer

This commit is contained in:
Ian Gulliver
2026-10-18 22:56:33 -07:00
parent 380e533ef4
commit 374ccf8b5e
10 changed files with 394 additions and 291 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ const leadGuidance = `You are the human's lead agent in byre, shown in the left
- Questions from task agents: answer one yourself with answer_question only when the answer is clear, for example the agent's recommendation is plainly right given what the human has said, the human already decided it, or one of your notes settles it outright. Otherwise show it to the human with your recommendation and wait. When the human tells you an answer, give it with answer_question. Say which questions you answered and how, naming the note by its id when one decided it.
- Notes: you learn how the human works and keep it with remember, forget and list_notes. byre adds every note to your instructions at the start of each lead session, so they outlast compaction; the human can read and delete them in the Settings tab. Write a note when the human shows a priority, a preference or the reasoning behind a choice that will recur: an answer that departs from the agent's recommendation (the answered signal shows both), a correction or overrule of you or a task agent, or a statement of how they want things done. Record the choice and the why, in their terms, general enough to apply to the next case and specific enough to act on, for example "Prefers replacing a state label over adding a tag beside it: keeps the picker uncluttered." File each note under the project it is about with project_id when it concerns that project's code, UI, docs or process, and with no project_id only when it holds for how the human works everywhere; apply a project's notes only to that project's tasks. Task agents start with their creator's every-project notes and their project's, and suggest new ones with suggest_note, which reaches you as a signal: save a suggestion only when it holds and your notes don't already cover it, choosing its project yourself, and otherwise drop it; neither needs a word to the human. Don't note one-off facts about a single task, and don't duplicate: update an existing note with remember and its id instead. When the human contradicts a note, update it or forget it. Before recommending anything, check your notes, and when one shaped the recommendation, cite its id.
- Finished turns: read them and show the human only what matters: work finished and ready to merge, problems, decisions made. Stay quiet about routine progress.
- Reviews: after each new snapshot of a task, a reviewer agent from the other vendor reviews the change. The results are on the task's reviews tab, and read_transcript shows each review's findings. They are for the human to look at when they want; mention one only when its findings matter to what the human is deciding.
- Reviews: after each new snapshot of a task, a reviewer agent reviews the change, on the human's review model, or their second review model when the review model wrote the work. The results are on the task's reviews tab, and read_transcript shows each review's findings. They are for the human to look at when they want; mention one only when its findings matter to what the human is deciding.
- Dig into context with list_tasks, read_transcript, read_inbox and read_status (vendor rate limits and agent health), and with your own Read, Grep and Bash on a task's worktree path (from list_tasks). Don't edit files in task worktrees; ask the task's agent with send_message.
- You can create tasks, start TODO items, message, interrupt and compact task agents, and merge or discard tasks. Merge pushes to the default branch and Discard destroys work: do either only when the human asks for it.
- Projects: when the human asks you to add a project, create it with create_project from its name and the path of its git repository on this machine.
+17 -28
View File
@@ -8,7 +8,6 @@ import (
"log/slog"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
@@ -17,12 +16,11 @@ import (
"g.fc.run/ai/byre/internal/git"
"g.fc.run/ai/byre/internal/mcp"
"g.fc.run/ai/byre/internal/store"
"g.fc.run/ai/byre/internal/workflow"
)
const maxReviewFiles = 200
var reviewModels = map[api.AgentSessionVendor]string{api.Claude: "claude-opus-5-5", api.Codex: "gpt-6.1-sol"}
var severities = []string{"critical", "high", "medium", "low", "info"}
const reviewGuidance = `You are a reviewer running inside byre. Another agent is doing a task; you review all of its work so far, and a human may read your review in byre's app.
@@ -116,32 +114,19 @@ func playwrightMCP(outputDir string) mcp.Stdio {
}
}
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, reviewModels[api.Claude]
}
last := sessions[len(sessions)-1]
return last.Vendor, last.Model
}
func reviewVendor(implementer api.AgentSessionVendor) api.AgentSessionVendor {
if implementer == api.Codex {
return api.Claude
}
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])
func (m *Manager) reviewerModel(ctx context.Context, task api.Task) (string, error) {
creator, err := m.store.GetUser(ctx, task.CreatedBy)
if err != nil {
return implVendor, implModel
return "", err
}
return vendor, reviewModels[vendor]
sessions, err := m.store.ListSessions(ctx, task.Id)
if err != nil {
return "", err
}
if len(sessions) > 0 && sessions[len(sessions)-1].Model == creator.ReviewModel {
return creator.SecondReviewModel, nil
}
return creator.ReviewModel, nil
}
func (m *Manager) startReviewer(ctx context.Context, task api.Task, snap api.Snapshot) error {
@@ -149,7 +134,11 @@ func (m *Manager) startReviewer(ctx context.Context, task api.Task, snap api.Sna
if err != nil {
return err
}
vendor, model := m.reviewerModel(ctx, task.Id)
model, err := m.reviewerModel(ctx, task)
if err != nil {
return err
}
vendor := workflow.VendorOf(model)
prompt, err := m.reviewPrompt(ctx, task, project, snap)
if err != nil {
return err