This commit is contained in:
Ian Gulliver
2026-10-20 22:15:33 -07:00
parent 627319a01f
commit 2bfa62449d
9 changed files with 45 additions and 57 deletions
+1 -2
View File
@@ -11,7 +11,6 @@ import (
"g.fc.run/ai/byre/internal/api"
"g.fc.run/ai/byre/internal/store"
"g.fc.run/ai/byre/internal/workflow"
)
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.
@@ -98,7 +97,7 @@ func (m *Manager) createLead(ctx context.Context, owner api.User, prompt, model,
}
id := newUUID()
vendor := workflow.VendorOf(model)
vendor := vendorOf(model)
sess := api.AgentSession{
Id: id,
Owner: owner.Login,
+1 -2
View File
@@ -21,7 +21,6 @@ import (
"g.fc.run/ai/byre/internal/mcp"
"g.fc.run/ai/byre/internal/store"
"g.fc.run/ai/byre/internal/terminal"
"g.fc.run/ai/byre/internal/workflow"
"tailscale.com/tsnet"
)
@@ -235,7 +234,7 @@ func (m *Manager) newSession(ctx context.Context, task api.Task, creator api.Use
}
id := newUUID()
vendor := workflow.VendorOf(model)
vendor := vendorOf(model)
sess := api.AgentSession{
Id: id,
TaskId: task.Id,
+12 -3
View File
@@ -14,7 +14,6 @@ import (
"g.fc.run/ai/byre/internal/claude"
"g.fc.run/ai/byre/internal/codex"
"g.fc.run/ai/byre/internal/mcp"
"g.fc.run/ai/byre/internal/workflow"
)
type image struct {
@@ -34,6 +33,16 @@ type agentProcess interface {
discard()
}
func vendorOf(model string) api.AgentSessionVendor {
switch {
case strings.HasPrefix(model, "gpt-"):
return api.Codex
case strings.HasPrefix(model, "gemini-"):
return api.Antigravity
}
return api.Claude
}
func initialVendorSessionID(vendor api.AgentSessionVendor, id string) string {
if vendor != api.Claude {
return ""
@@ -42,8 +51,8 @@ func initialVendorSessionID(vendor api.AgentSessionVendor, id string) string {
}
func checkModel(sess api.AgentSession, model string) error {
if workflow.VendorOf(model) != sess.Vendor {
return fmt.Errorf("%w: session %s is %s; %s is a %s model", ErrInvalid, sess.Id, sess.Vendor, model, workflow.VendorOf(model))
if vendorOf(model) != sess.Vendor {
return fmt.Errorf("%w: session %s is %s; %s is a %s model", ErrInvalid, sess.Id, sess.Vendor, model, vendorOf(model))
}
return nil
}
+1 -1
View File
@@ -292,7 +292,7 @@ func (m *Manager) advanceReviews(ctx context.Context, r api.Review) bool {
func (m *Manager) startReviewer(ctx context.Context, task api.Task, project api.Project, snap api.Snapshot, defID string, def api.WorkflowDefinition, stage string, inputs []api.Review) (err error) {
model := workflow.Get(def, stage).Model
vendor := workflow.VendorOf(model)
vendor := vendorOf(model)
reviewID := store.NewID()
recorded := false
defer func() {