Fix wording, docs and style inconsistencies per audit of 0139564
This commit is contained in:
@@ -107,7 +107,7 @@ func (m *Manager) auditError(ctx context.Context, task api.Task, msg string) {
|
||||
|
||||
func auditBrief(branch, commit string) string {
|
||||
return fmt.Sprintf("Audit of %s at %s. This isn't a review of a change: check the whole codebase as it stands against the project's standards and expectations, and fix what falls short. "+
|
||||
"byre runs this task in the background: the human doesn't see it until you ask a question, call ready_for_merge or hit an error. "+
|
||||
"byre runs this task in the background: the human doesn't see it until you ask a question, call ready_for_merge, hit an error or rate limit, or call suggest_discard in a workflow without auto_discard. "+
|
||||
"Finish your stage with finish_stage as usual, even when you found nothing. Once your stage has finished and its review has come back, byre asks whether the task is ready to merge; "+
|
||||
"if nothing needed changing, answer with suggest_discard.", branch, commit)
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"crypto/rand"
|
||||
"encoding/base64"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/url"
|
||||
"os"
|
||||
@@ -399,7 +400,7 @@ type showPageArgs struct {
|
||||
|
||||
func (m *Manager) showPage(ctx context.Context, l *live, args showPageArgs) (string, error) {
|
||||
if (args.Path == "") == (args.URL == "") {
|
||||
return "", fmt.Errorf("show_page takes path or url, not both or neither")
|
||||
return "", errors.New("show_page takes path or url, not both or neither")
|
||||
}
|
||||
if args.Path != "" {
|
||||
return m.show(ctx, l, clientOpenArgs{Client: args.Client, Path: args.Path}, api.OpenPage)
|
||||
|
||||
@@ -3,6 +3,7 @@ package agents
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
@@ -239,7 +240,7 @@ func codexToolResult(item codex.ThreadItem) (any, bool, error) {
|
||||
}
|
||||
mime, data, ok := strings.Cut(strings.TrimPrefix(c.ImageURL, "data:"), ";base64,")
|
||||
if !ok {
|
||||
return nil, false, fmt.Errorf("dynamic tool image is not a base64 data url")
|
||||
return nil, false, errors.New("dynamic tool image is not a base64 data url")
|
||||
}
|
||||
blocks = append(blocks, imageBlock(mime, data))
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package agents
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
@@ -77,7 +78,7 @@ func (m *Manager) CheckPermissions(ctx context.Context) ([]api.Permission, error
|
||||
cmd.Stderr = &stderr
|
||||
out, err := cmd.Output()
|
||||
if ctx.Err() == context.DeadlineExceeded {
|
||||
return nil, fmt.Errorf("byre-hands check didn't finish within 2 minutes; answer macOS's prompts on the Mac byre runs on and check again")
|
||||
return nil, errors.New("byre-hands check didn't finish within 2 minutes; answer macOS's prompts on the Mac byre runs on and check again")
|
||||
}
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("byre-hands check: %w: %s", err, strings.TrimSpace(stderr.String()))
|
||||
|
||||
@@ -3,6 +3,7 @@ package agents
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
@@ -37,7 +38,7 @@ func (m *Manager) generateImageTool(l *live) mcp.Tool {
|
||||
|
||||
func (m *Manager) generateImage(ctx context.Context, l *live, prompt string) (string, error) {
|
||||
if strings.TrimSpace(prompt) == "" {
|
||||
return "", fmt.Errorf("generate_image needs a prompt")
|
||||
return "", errors.New("generate_image needs a prompt")
|
||||
}
|
||||
|
||||
media := MediaDir(l.dir)
|
||||
@@ -68,7 +69,7 @@ func (m *Manager) generateImage(ctx context.Context, l *live, prompt string) (st
|
||||
return "", fmt.Errorf("no image after %s", mcp.Timeout(ctx))
|
||||
case ev, ok := <-s.Events():
|
||||
if !ok {
|
||||
return "", fmt.Errorf("codex exited before the image was made")
|
||||
return "", errors.New("codex exited before the image was made")
|
||||
}
|
||||
switch ev.Method {
|
||||
case codex.MethodItemCompleted:
|
||||
@@ -94,7 +95,7 @@ func (m *Manager) generateImage(ctx context.Context, l *live, prompt string) (st
|
||||
return "", fmt.Errorf("codex: %s", n.Turn.Error.Message)
|
||||
}
|
||||
if saved == "" {
|
||||
return "", fmt.Errorf("codex finished without making an image")
|
||||
return "", errors.New("codex finished without making an image")
|
||||
}
|
||||
path, err := copyToMedia(media, saved)
|
||||
if err != nil {
|
||||
|
||||
@@ -346,7 +346,7 @@ func (m *Manager) Deliver(ctx context.Context, sessionID string) error {
|
||||
return nil
|
||||
}
|
||||
if err != nil {
|
||||
slog.Error("deliver failed", "session", sessionID, "err", err, "responses", ids)
|
||||
slog.Error("deliver inbox responses", "session", sessionID, "err", err, "responses", ids)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ client-exec calls byre's API at `http://127.0.0.1:8270`. When `HTTP_PROXY` (or `
|
||||
|
||||
## Screen lock
|
||||
|
||||
`byre screen` prints `unlocked`, `locked` or `no-session` (no GUI login for this user) for the Mac it runs on, and exits 0. Check the server Mac with `byre screen` and the client with:
|
||||
`byre screen` prints `unlocked`, `locked` or `no-session` (no GUI login for this user) for the Mac it runs on, and exits 0. Check the Mac byre runs on with `byre screen` and the client with:
|
||||
|
||||
```
|
||||
byre client-exec -- /Applications/Byre.app/Contents/Helpers/byre screen
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
)
|
||||
|
||||
const leadGuidance = `You are the human's lead agent in byre, shown in the left pane of byre's app. The human talks to you there, and you coordinate every task agent on their behalf. You don't do task work yourself: task agents work in their own worktrees, and you read, direct and report on them.
|
||||
- Signals: byre sends you, as messages from byre, what happens across tasks: questions that task agents ask, errors and rate limits their sessions hit, turns they finish with their final message, a task's agent saying the task is ready to merge (with its overview of the whole task, which byre asks for once the review of its latest work has finished and its turn has ended) or suggesting the human discard it (with its reasoning), questions the human answered, tasks created, reviews started and finished, a merge held behind another task's or set to start after the review (and that canceled or dropped), starting to merge, merged or discarded, and every change of a task's state, as "<task> state: <before> → <now>." listed first among what happened at the same moment. State changes, reviews starting, and tasks the human created or started merging never wake you on their own; they arrive only alongside another signal. A task merged or discarded always wakes you, whoever closed it. The states are running, idle, finished (a workflow stage's task once its finish_stage has taken), review_pending, reviewing, asking (it has an open question), ready_to_merge and discard_suggested (the agent's ready_for_merge or suggest_discard still stands), merge_held (its Merge waits for another merge in the project), merge_after_review (its Merge waits for the running review), merging, pushing (byre is pushing the merge's squash commit), discarding, merged, discarded and no_agent (it has no live agent). A finished turn arrives with its state change: review_pending when byre is about to review the turn's work, reviewing while the review runs; neither is done, since the review can still find problems, so don't treat a task's work as finished until its state goes to idle or finished. Several may arrive in one message, followed by the current task list (as list_tasks gives it) and what your right pane shows, so you rarely need to call list_tasks after a signal. The human doesn't see signals. Messages from the human arrive separately.
|
||||
- Signals: byre sends you, as messages from byre, what happens across tasks: questions that task agents ask, errors and rate limits their sessions hit, turns they finish with their final message, a task's agent saying the task is ready to merge (with its overview of the whole task, which byre asks for once the review of its latest work has finished and its turn has ended) or suggesting the human discard it (with its reasoning), questions the human answered, tasks created, reviews started and finished, a merge held behind another task's or set to start after the review (and that canceled or dropped), starting to merge, merged or discarded, and every change of a task's state, as "<task> state: <before> → <now>." listed first among what happened at the same moment. State changes, reviews starting, and tasks the human created or started merging never wake you on their own; they arrive only alongside another signal. A task merged or discarded always wakes you, whoever closed it. The states are running, idle, finished (a workflow stage's task once its finish_stage has taken, or a workflow run's task once the run finished), review_pending, reviewing, asking (it has an open question), ready_to_merge and discard_suggested (the agent's ready_for_merge or suggest_discard still stands), merge_held (its Merge waits for another merge in the project), merge_after_review (its Merge waits for the running review), merging, pushing (byre is pushing the merge's squash commit), discarding, merged, discarded and no_agent (it has no live agent). A finished turn arrives with its state change: review_pending when byre is about to review the turn's work, reviewing while the review runs; neither is done, since the review can still find problems, so don't treat a task's work as finished until its state goes to idle or finished. Several may arrive in one message, followed by the current task list (as list_tasks gives it) and what your right pane shows, so you rarely need to call list_tasks after a signal. The human doesn't see signals. Messages from the human arrive separately.
|
||||
- Don't respond to what the human just did. A signal about their own action (a question they answered, a task they created, merged, started merging or discarded) tells them nothing new: don't report, confirm or comment on it. Act on it only if it changes what you are doing, and then end the turn with one short line at most. When a batch of signals needs nothing from you to the human, make your final message exactly NO_REPLY and nothing else; byre folds that turn away so the human doesn't see it.
|
||||
- "Your right pane is free" means the human finished what was in the right pane. When it says the human has watched an agent work for 10 seconds, byre sends it only while another task has something waiting on them, so something does. Show them the next thing that needs them, most urgent first (questions, then errors in the task's transcript, then finished turns, then tasks ready to merge or suggested for discarding), with one line saying what it is. If nothing needs them, show that project with no task, then post a short status: one line per active task (what it's doing or waiting on), then up to three TODO items you'd start next (from list_tasks), each with a one-line reason. Write each item as a link to #/todo/<project_id>/<title, URL-encoded with parentheses as %28 and %29>, for example [Fix login redirect](#/todo/prj3f2a9C1b7dQ/Fix%20login%20redirect): byre draws it with a Start button the human can click, and once the task exists, its state. Start one with start_todo only when the human picks it. If that says nothing new since your last status, make your final message NO_REPLY.
|
||||
- Whenever you suggest new work that isn't in TODO.md (a task you think is worth doing, an improvement to byre or to your own role), write it as a link to #/suggest/<project_id>/<title>/<brief>, both URL-encoded with parentheses as %28 and %29, for example [Lead tool for admin status](#/suggest/prj3f2a9C1b7dQ/Lead%20tool%20for%20admin%20status/Add%20a%20lead%20tool%20that%20reads%20%2Fapi%2Fadmin%2Fstatus%20...). The brief is the new task agent's whole first message, so make it a complete brief, as for create_task. byre draws the link with two buttons: Start creates the task with that title and brief at once, without you, and Discuss sends you a message asking to talk the suggestion over. Once an active task has that title, it shows the task's state instead. Don't ask whether to start a suggestion; the buttons do that.
|
||||
|
||||
@@ -879,7 +879,7 @@ func (m *Manager) workflowTools(l *live) []mcp.Tool {
|
||||
|
||||
leadTool(m, l, "set_audit_workflow",
|
||||
"Set the audit workflow (any saved workflow) that byre runs in the background on a project's default branch: one run at a time, started whenever the branch's newest commit hasn't had one, to check the whole codebase against its standards rather than one change. "+
|
||||
"An audit's tasks stay out of list_tasks and your signals until one asks a question, calls ready_for_merge, hits an error, or suggests discarding in a workflow without auto_discard. An empty workflow turns audits off. Only when the human asks.",
|
||||
"An audit's tasks stay out of list_tasks and your signals until one asks a question, calls ready_for_merge, hits an error or rate limit, or suggests discarding in a workflow without auto_discard. An empty workflow turns audits off. Only when the human asks.",
|
||||
`{"type": "object", "properties": {
|
||||
"project_id": {"type": "string"},
|
||||
"workflow": {"type": "string"}
|
||||
|
||||
Reference in New Issue
Block a user