Simplify codebase per audit of 461aac7

This commit is contained in:
Ian Gulliver
2026-10-23 16:21:56 -07:00
parent 92edbcfdcc
commit 7aff773b72
23 changed files with 180 additions and 201 deletions
+3 -12
View File
@@ -5,7 +5,6 @@ import (
"errors"
"fmt"
"log/slog"
"strings"
"g.fc.run/ai/byre/internal/api"
"g.fc.run/ai/byre/internal/store"
@@ -59,7 +58,7 @@ func (m *Manager) launchCompaction(ctx context.Context, sess api.AgentSession, t
m.mu.Lock()
m.handoffModel[sess.Id] = modelChoice{model, effort}
m.mu.Unlock()
return m.launch(ctx, sess, task, "byre", Prompt{Text: prompt})
return m.launch(ctx, sess, task, "byre", Prompt{Text: prompt, Kind: store.MessageHandoff})
}
func (m *Manager) continuationModel(sess api.AgentSession) modelChoice {
@@ -73,14 +72,6 @@ func (m *Manager) continuationModel(sess api.AgentSession) modelChoice {
return c
}
func isHandoffPrompt(actor, text string) bool {
return actor == "byre" && (text == handoffPrompt || text == leadHandoffPrompt)
}
func isContinuation(actor, text string) bool {
return actor == "byre" && (strings.HasPrefix(text, handoffPreamble) || strings.HasPrefix(text, leadHandoffPreamble))
}
func (m *Manager) continueFromHandoff(sessionID, handoff string) {
ctx := context.Background()
m.waitResumed(sessionID)
@@ -111,7 +102,7 @@ func (m *Manager) handoff(ctx context.Context, sessionID, handoff string) error
if err != nil {
return err
}
_, err = m.createLead(ctx, creator, "byre", Prompt{Text: leadHandoffPreamble + handoff, Model: model.model, Effort: model.effort})
_, err = m.createLead(ctx, creator, "byre", Prompt{Text: leadHandoffPreamble + handoff, Kind: store.MessageContinuation, Model: model.model, Effort: model.effort})
return err
}
@@ -132,6 +123,6 @@ func (m *Manager) handoff(ctx context.Context, sessionID, handoff string) error
return err
}
m.stopLive(sess.Id)
_, err = m.launch(ctx, next, task, "byre", Prompt{Text: handoffPreamble + handoff})
_, err = m.launch(ctx, next, task, "byre", Prompt{Text: handoffPreamble + handoff, Kind: store.MessageContinuation})
return err
}