Show turn summaries only in the transcript, not as inbox reports

This commit is contained in:
Ian Gulliver
2026-10-15 20:01:53 -07:00
parent 4ea79a0c61
commit ccd55afe13
24 changed files with 269 additions and 385 deletions
+2 -2
View File
@@ -14,8 +14,8 @@ import (
const guidance = `You are running inside byre. The human reads your work in byre's web UI, not a terminal.
- Ask every question with byre's ask_human tool, never in prose.
- End every turn with a short final message for the human: what you did, anything you departed from in the plan or instructions, risks, and what's next. byre shows it as the turn's summary in the transcript and the inbox. State every departure from the plan.
- A turn that asks a blocking question files no report; put everything the human needs in the question's context.
- End every turn with a short final message for the human: what you did, anything you departed from in the plan or instructions, risks, and what's next. byre shows it as the turn's summary at the end of the transcript. State every departure from the plan.
- A turn that asks a blocking question has no summary; put everything the human needs in the question's context.
- In that final message and in ask_human context, put long supporting detail (logs, full lists, data) in collapsed sections the human expands on demand: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
- Don't commit. byre commits everything in the worktree at the end of each turn, using the turn's final message.
- Don't push, don't switch or touch other branches, and don't run git maintenance (gc, prune, worktree prune). byre handles merging and pushing.`
-10
View File
@@ -256,16 +256,6 @@ func (m *Manager) validateAsk(ctx context.Context, l *live, args askArgs) error
return nil
}
func (m *Manager) fileSummary(l *live, text string) string {
id := store.NewID()
err := m.store.CreateInboxItem(context.Background(), m.newItem(l, id, id, api.Report, api.Fyi, false, map[string]any{"text": text}))
if err != nil {
slog.Error("file turn summary", "session", l.id, "err", err)
return ""
}
return id
}
func (m *Manager) fileError(l *live, msg string) {
id := store.NewID()
err := m.store.CreateInboxItem(context.Background(), m.newItem(l, id, id, api.SessionError, api.Blocked, true, map[string]any{"error": msg}))
+14 -10
View File
@@ -14,22 +14,22 @@ import (
)
const leadGuidance = `You are the human's lead agent in byre, shown in the left pane of byre's web UI. 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, turn reports and errors that task agents file, questions the human answered, tasks created, merged or discarded. Several may arrive in one message. Messages from the human arrive separately.
- Signals: byre sends you, as messages from byre, what happens across tasks: questions and errors that task agents file, turns they finish with their final message, questions the human answered, tasks created, merged or discarded. Several may arrive in one message. 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 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. Show them the next thing that needs them, most urgent first (blocked questions and errors, then reports, then tasks ready to merge), with one line saying what it is. If nothing needs them, show that project's project tab and make your final message NO_REPLY.
- "Your right pane is free" means the human finished what was in the right pane. Show them the next thing that needs them, most urgent first (blocked questions and errors, then finished turns, then tasks ready to merge), with one line saying what it is. If nothing needs them, show that project's project tab and make your final message NO_REPLY.
- Steering the right pane is a core part of your job, as important as what you write. The right pane shows one task, or a project with no task; point it with show (the task or project, the tabs to put first, the tab to select). By default, keep it on whatever you and the human are discussing, so they can see it while they read your reply; don't make them go looking for it. Call show in the same turn you bring something up:
- Discussing, picking or starting TODO items, or a project's tasks as a whole: the project's project tab (show with project_id when no single task of that project is involved).
- A question or report that needs the human: that task's inbox tab, with one line naming it and what you recommend.
- Discussing a task's work, what its agent did or is doing, or whether it is ready to merge: its transcript tab. A specific file in its worktree: its files tab.
- A question that needs the human: that task's inbox tab, with one line naming it and what you recommend.
- A finished turn that needs the human, discussing a task's work, what its agent did or is doing, or whether it is ready to merge: its transcript tab, which ends with the agent's final message. A specific file in its worktree: its files tab.
- The changes tab only when the human asks to see the diff; they rarely want it.
- Show, don't tell. What the right pane shows, the human reads there: never repeat, quote or paraphrase a task agent's question, choices, context or report in chat. Add only what the pane doesn't say, such as your recommendation and why, or how it connects to other work.
- Show, don't tell. What the right pane shows, the human reads there: never repeat, quote or paraphrase a task agent's question, choices, context or final message in chat. Add only what the pane doesn't say, such as your recommendation and why, or how it connects to other work.
- Don't move the pane for things that don't need the human, and don't pull it away from what they are looking at unless the new thing is more urgent. While the human is working in the right pane, show is refused unless it is on the project tab or what it shows is finished. It is also refused on the project tab right after the human starts a TODO item there, since they are likely to start more. When show is refused, say in chat what you would have shown, and carry on.
- 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, or the human already decided it. 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.
- Reports: read them and show the human only what matters: work finished and ready to merge, problems, decisions made. Stay quiet about routine progress.
- 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, read_transcript shows each review's findings, and a question shows the review of the turn that asked it. 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 and read_inbox, 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.
- Whenever you name a task in a message, link it as a Markdown link to #/task/<task_id>, for example [Fix login redirect](#/task/da7e487305e4). byre draws it in that task's colour, and clicking it shows the task in the right pane. To open a specific tab, append it: #/task/<task_id>/<tab>. When you point the human at something to review or answer in a task's inbox, link to #/task/<task_id>/inbox, never its transcript.
- Whenever you name a task in a message, link it as a Markdown link to #/task/<task_id>, for example [Fix login redirect](#/task/da7e487305e4). byre draws it in that task's colour, and clicking it shows the task in the right pane. To open a specific tab, append it: #/task/<task_id>/<tab>. When you point the human at a question to answer, link to #/task/<task_id>/inbox; at a finished turn, to #/task/<task_id>/transcript.
- Keep messages short; the human reads them in half the screen. Put long detail in collapsed sections: a line <details><summary>Title</summary>, the Markdown content, then a line </details>.
- You are long-running. Your context window is large. Call compact_self only once your context is past half its window, at a logical point (a piece of work wrapped up, a topic closed); when the turn ends, byre replaces you with a fresh session that starts from your handoff.
- Don't commit, push, or touch git branches yourself.`
@@ -260,7 +260,7 @@ func (m *Manager) leadTurnEnded(ctx context.Context, l *live, res endResult) err
func (m *Manager) Observe(ev api.Event) {
switch ev.Kind {
case "inbox.created", "inbox.updated", "task.created", "task.merged", "task.discarded":
case "inbox.created", "inbox.updated", "task.created", "task.merged", "task.discarded", "turn.ended":
default:
return
}
@@ -388,6 +388,12 @@ func (m *Manager) signalText(ctx context.Context, ev api.Event) (string, error)
case "task.discarded":
return fmt.Sprintf("%s was discarded by %s.", m.taskLabel(ctx, deref(ev.TaskId)), ev.Actor), nil
case "turn.ended":
if ev.Payload["summary"] != true {
return "", nil
}
return fmt.Sprintf("%s finished a turn:\n%s", m.taskLabel(ctx, deref(ev.TaskId)), clip(fmt.Sprint(ev.Payload["result"]), 1500)), nil
}
return "", nil
}
@@ -417,8 +423,6 @@ func (m *Manager) itemText(ctx context.Context, item api.InboxItem) string {
}
fmt.Fprintf(b, "Blocked on: %v\nThe full context is in read_inbox.", p["why_blocked"])
return b.String()
case api.Report:
return fmt.Sprintf("%s finished a turn (report %s):\n%s", label, item.Id, clip(fmt.Sprint(p["text"]), 1500))
case api.SessionError:
return fmt.Sprintf("%s hit an error (item %s): %v", label, item.Id, p["error"])
case api.RateLimited:
+2 -2
View File
@@ -82,7 +82,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
tool("answer_question",
"Respond to an open inbox item on the human's behalf. Only when the answer is clear or the human told you it. "+
"type option: options holds the chosen choices' exact text (one for pick-one; pick-any may add text). "+
"type other: free text to a question or an error. type dismiss: clears a report or an error.",
"type other: free text to a question or an error. type dismiss: clears an error.",
`{"type": "object", "properties": {
"item_id": {"type": "string"},
"type": {"type": "string", "enum": ["option", "other", "dismiss"]},
@@ -110,7 +110,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
tool("send_message",
"Send a message to a task's agent; it starts a turn. Starts the agent when the task has none. The agent must be idle: "+
"if it is mid-turn, wait for its report or interrupt it first.",
"if it is mid-turn, wait for it to finish the turn or interrupt it first.",
`{"type": "object", "properties": {
"task_id": {"type": "string"},
"text": {"type": "string"},
+1 -1
View File
@@ -756,7 +756,7 @@ func (m *Manager) turnEnded(ctx context.Context, l *live, res endResult) error {
case handoff:
payload["handoff"] = true
case finished && !compacting && !askedBlock:
payload["inbox_item_id"] = m.fileSummary(l, res.result)
payload["summary"] = true
}
err = m.emit(ctx, l, agentActor, "turn.ended", payload)
if err != nil {
-3
View File
@@ -130,9 +130,6 @@ func CheckResponse(item api.InboxItem, c api.InboxResponseCreate) (api.InboxStat
return api.Answered, nil
case api.Other:
if item.Kind == api.Report {
return bad("reports are only dismissed")
}
if text == "" {
return bad("other needs text")
}