Switch to prefixed IDs and tell agents which Mac a message came from
This commit is contained in:
@@ -2,6 +2,7 @@ package agents
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"fmt"
|
||||
"log/slog"
|
||||
"os"
|
||||
@@ -43,11 +44,15 @@ func vendorOf(model string) api.AgentSessionVendor {
|
||||
return api.Claude
|
||||
}
|
||||
|
||||
func initialVendorSessionID(vendor api.AgentSessionVendor, id string) string {
|
||||
func initialVendorSessionID(vendor api.AgentSessionVendor) string {
|
||||
if vendor != api.Claude {
|
||||
return ""
|
||||
}
|
||||
return id
|
||||
b := make([]byte, 16)
|
||||
rand.Read(b)
|
||||
b[6] = b[6]&0x0f | 0x40
|
||||
b[8] = b[8]&0x3f | 0x80
|
||||
return fmt.Sprintf("%x-%x-%x-%x-%x", b[0:4], b[4:6], b[6:8], b[8:10], b[10:])
|
||||
}
|
||||
|
||||
func (m *Manager) changeModel(ctx context.Context, sess api.AgentSession, model, actor string) (api.AgentSession, error) {
|
||||
|
||||
Reference in New Issue
Block a user