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
+22 -5
View File
@@ -34,7 +34,21 @@ struct SettingsView: View {
Text("New tasks you start from byre run on this model.")
.foregroundStyle(Palette.muted)
.fixedSize(horizontal: false, vertical: true)
DefaultModelMenu()
ModelMenu(current: store.defaultModel, help: "Model for new tasks") { m in
try await store.api.client.updateDefaultModel(body: .json(.init(model: m))).ok.body.json
}
if let me = store.me {
heading("Review models")
Text("The first model reviews your tasks' work. The second reviews work the first model wrote.")
.foregroundStyle(Palette.muted)
.fixedSize(horizontal: false, vertical: true)
ModelMenu(current: me.reviewModel, help: "Model that reviews your tasks") { m in
try await store.api.client.updateReviewModels(body: .json(.init(reviewModel: m, secondReviewModel: me.secondReviewModel))).ok.body.json
}
ModelMenu(current: me.secondReviewModel, help: "Model that reviews work the first review model wrote") { m in
try await store.api.client.updateReviewModels(body: .json(.init(reviewModel: me.reviewModel, secondReviewModel: m))).ok.body.json
}
}
heading("This Mac's permissions")
Text("The macOS privacy grants byre's app needs for agents to see and control this Mac. Checking asks macOS for any that are missing.")
.foregroundStyle(Palette.muted)
@@ -172,7 +186,10 @@ private struct PrefsBox: View {
}
}
private struct DefaultModelMenu: View {
private struct ModelMenu: View {
let current: String
let help: String
let pick: (String) async throws -> User
@Environment(Store.self) private var store
@Environment(Overlays.self) private var overlays
@@ -182,7 +199,7 @@ private struct DefaultModelMenu: View {
Button(m) {
Task {
do {
store.me = try await store.api.client.updateDefaultModel(body: .json(.init(model: m))).ok.body.json
store.me = try await pick(m)
} catch {
overlays.showAlert(errorText(error))
}
@@ -191,7 +208,7 @@ private struct DefaultModelMenu: View {
}
} label: {
HStack(spacing: 8) {
Text(store.defaultModel)
Text(current)
Image(systemName: "chevron.up.chevron.down")
.font(.system(size: 9, weight: .semibold))
}
@@ -203,7 +220,7 @@ private struct DefaultModelMenu: View {
.buttonStyle(.plain)
.menuIndicator(.hidden)
.fixedSize()
.help("Model for new tasks")
.help(help)
.padding(.top, 8)
}
}