Put macOS model and effort in a menu; take_snapshot commits the branch

This commit is contained in:
Ian Gulliver
2026-10-23 15:17:27 -07:00
parent 2cfd408bc5
commit ff8d4fb4be
4 changed files with 47 additions and 42 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ const guidance = `You are running inside byre. The human reads your work in byre
- 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 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 commit with git. byre commits everything in the worktree at the end of each turn, using the turn's final message. When you need a commit mid-turn (e.g. to merge from main), call take_snapshot.
- 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.
- TODO.md at the repo root is the project's list of work for byre; its format is the read_knowledge article todo-file.`
+1 -1
View File
@@ -468,7 +468,7 @@ func (m *Manager) leadTools(l *live) []mcp.Tool {
if err != nil {
return "", err
}
return fmt.Sprintf("Snapshot of %s requested; its review shows in the task's transcript, and findings go to its agent.", task.Id), nil
return fmt.Sprintf("%s's worktree committed to its branch, and snapshot requested; its review shows in the task's transcript, and findings go to its agent.", task.Id), nil
}),
tool("discard_task",
+8 -2
View File
@@ -205,6 +205,12 @@ func (m *Manager) RequestSnapshot(ctx context.Context, taskID string) error {
if err != nil {
return err
}
unlock := m.lockTask(task.Id)
_, err = git.CommitAll(ctx, t.dir, "Work before take_snapshot", t.gitName, t.gitEmail)
unlock()
if err != nil {
return err
}
err = m.store.BeginReviewRequest(ctx, task.Id)
if err != nil {
return err
@@ -263,12 +269,12 @@ func (m *Manager) takeSnapshotTool(l *live) mcp.Tool {
if err != nil {
return "", err
}
return "Snapshot requested. If the project has a review workflow, its reviewers check it against the default branch; their findings come to you together once the workflow finishes.", nil
return "Worktree committed to the task's branch, and snapshot requested. If the project has a review workflow, its reviewers check it against the default branch; their findings come to you together once the workflow finishes.", nil
},
}
}
const takeSnapshotDescription = "Snapshot a task's worktree now: byre commits the whole worktree, uncommitted work included, as a commit on byre's own ref for the task (refs/byre/tasks/<task>/snap/<n>), on top of the branch's HEAD. The task's branch and worktree are left as they are; the branch gets its own commit at the end of the turn. If the project has a review workflow, its reviewers check all of the task's work against the default branch, using each stage's model and instructions; findings arrive together once the workflow finishes. " +
const takeSnapshotDescription = "Commit and snapshot a task's worktree now: byre commits the whole worktree, uncommitted work included, to the task's branch, and returns once that commit is made. It then snapshots that commit on byre's own ref for the task (refs/byre/tasks/<task>/snap/<n>). If the project has a review workflow, its reviewers check all of the task's work against the default branch, using each stage's model and instructions; findings arrive together once the workflow finishes. " +
"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 {