Audit of 627319a
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user