Add server-side workflows with YAML files, task freeze and lead tools
This commit is contained in:
@@ -5,13 +5,13 @@ import (
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"g.fc.run/misc/byre/internal/api"
|
||||
"g.fc.run/misc/byre/internal/claude"
|
||||
"g.fc.run/misc/byre/internal/codex"
|
||||
"g.fc.run/misc/byre/internal/mcp"
|
||||
"g.fc.run/misc/byre/internal/workflow"
|
||||
)
|
||||
|
||||
type image struct {
|
||||
@@ -30,13 +30,6 @@ type agentProcess interface {
|
||||
drive(m *Manager, l *live)
|
||||
}
|
||||
|
||||
func vendorOf(model string) api.AgentSessionVendor {
|
||||
if strings.HasPrefix(model, "gpt-") {
|
||||
return api.Codex
|
||||
}
|
||||
return api.Claude
|
||||
}
|
||||
|
||||
func initialVendorSessionID(vendor api.AgentSessionVendor, id string) string {
|
||||
if vendor == api.Codex {
|
||||
return ""
|
||||
@@ -45,8 +38,8 @@ func initialVendorSessionID(vendor api.AgentSessionVendor, id string) string {
|
||||
}
|
||||
|
||||
func checkModel(sess api.AgentSession, model string) error {
|
||||
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))
|
||||
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))
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user