Switch to prefixed IDs and tell agents which Mac a message came from
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"g.fc.run/ai/byre/internal/api"
|
||||
"g.fc.run/ai/byre/internal/ids"
|
||||
"g.fc.run/ai/byre/internal/mcp"
|
||||
"g.fc.run/ai/byre/internal/store"
|
||||
)
|
||||
@@ -73,7 +74,7 @@ func (m *Manager) forkTool(l *live) mcp.Tool {
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
_, _, err = m.Message(ctx, sessionID, agentActor, args.Prompt, "", "")
|
||||
_, _, err = m.Message(ctx, sessionID, agentActor, args.Prompt, "", "", "")
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("task %s forked, but its agent did not start: %w", t.Id, err)
|
||||
}
|
||||
@@ -121,7 +122,7 @@ func (m *Manager) AnswerAgain(ctx context.Context, creator api.User, create api.
|
||||
return api.Task{}, err
|
||||
}
|
||||
|
||||
id := store.NewID()
|
||||
id := ids.New(ids.InboxItem)
|
||||
err = m.store.CreateAnsweredItem(ctx, api.InboxItem{
|
||||
Id: id,
|
||||
ProjectId: t.ProjectId,
|
||||
@@ -196,13 +197,13 @@ func (m *Manager) fork(ctx context.Context, src api.Task, project api.Project, n
|
||||
return api.Task{}, "", err
|
||||
}
|
||||
|
||||
id := newUUID()
|
||||
id := ids.New(ids.Session)
|
||||
err = m.store.CreateSession(ctx, api.AgentSession{
|
||||
Id: id,
|
||||
TaskId: t.Id,
|
||||
Vendor: srcSess.Vendor,
|
||||
Model: srcSess.Model,
|
||||
VendorSessionId: initialVendorSessionID(srcSess.Vendor, id),
|
||||
VendorSessionId: initialVendorSessionID(srcSess.Vendor),
|
||||
State: api.AgentSessionStateIdle,
|
||||
Role: api.Implementer,
|
||||
CreatedBy: creator.Login,
|
||||
|
||||
Reference in New Issue
Block a user