From c0ae205bdf82ab81bccbe2b11f499b165469a40e Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Sat, 17 Oct 2026 17:12:37 +1100 Subject: [PATCH] refactor(curator): rename SessionSummary to SessionRef --- internal/domain/curator/registrar.go | 6 +++--- internal/gateway/session_tools.go | 10 +++++----- internal/infrastructure/sessioncurator/adapter.go | 6 +++--- .../infrastructure/sessioncurator/sessioncurator.go | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/internal/domain/curator/registrar.go b/internal/domain/curator/registrar.go index 932b989cd..0455fc70f 100644 --- a/internal/domain/curator/registrar.go +++ b/internal/domain/curator/registrar.go @@ -125,15 +125,15 @@ type MemoryEngineSource interface { type ConversationSource interface { // RecentSessions returns every session touched at or after since, // newest first. - RecentSessions(ctx context.Context, since time.Time) ([]SessionSummary, error) + RecentSessions(ctx context.Context, since time.Time) ([]SessionRef, error) // Messages returns the most recent n messages of one session, in // chronological order. Messages(ctx context.Context, sessionID string, n int) ([]ConversationMessage, error) } -// SessionSummary identifies one session, the agent that served it, and when +// SessionRef identifies one session, the agent that served it, and when // it was last active. -type SessionSummary struct { +type SessionRef struct { ID string // AgentID is the agent that owns the session, as recorded on the // session's own source. Agent-user memory is addressed by it, so a diff --git a/internal/gateway/session_tools.go b/internal/gateway/session_tools.go index a5ae4d8ff..4bc7bd0be 100644 --- a/internal/gateway/session_tools.go +++ b/internal/gateway/session_tools.go @@ -31,11 +31,11 @@ const ( maxSessionTranscriptLimit = 10000 ) -// ChatSessionSummary is the per-session view the session tools return. It is +// ChatSessionEntry is the per-session view the session tools return. It is // deliberately narrower than a store session: the source tuple (platform, bot, // channel, thread) is addressing metadata, not something that helps the model // pick which conversation to resume. -type ChatSessionSummary struct { +type ChatSessionEntry struct { ID string `json:"id"` Title string `json:"title"` BranchName string `json:"branch_name,omitempty"` @@ -45,7 +45,7 @@ type ChatSessionSummary struct { // SessionListResult is what session_list returns. type SessionListResult struct { - Sessions []ChatSessionSummary `json:"sessions"` + Sessions []ChatSessionEntry `json:"sessions"` } // SessionResumeResult is what session_resume returns. @@ -122,9 +122,9 @@ func sessionListTool(store SessionStore, platform, channelID string) tools.ToolE } // Non-nil even when empty: an empty catalog is an answer, and a // null would read to the model as a failed call worth retrying. - sessions := make([]ChatSessionSummary, 0, len(all)) + sessions := make([]ChatSessionEntry, 0, len(all)) for _, s := range all { - sessions = append(sessions, ChatSessionSummary{ + sessions = append(sessions, ChatSessionEntry{ ID: s.SessionID, Title: sessionDisplayTitle(s), BranchName: s.BranchName, diff --git a/internal/infrastructure/sessioncurator/adapter.go b/internal/infrastructure/sessioncurator/adapter.go index 08b012e22..c0ee182df 100644 --- a/internal/infrastructure/sessioncurator/adapter.go +++ b/internal/infrastructure/sessioncurator/adapter.go @@ -31,17 +31,17 @@ func NewAdapter(store gateway.SessionStore, agentID string) *Adapter { // AgentID is the agent every session's memory is addressed by -- the // composition's configured bot user, the same value a chat turn addresses // its own reads with. -func (a *Adapter) RecentSessions(ctx context.Context, since time.Time) ([]curator.SessionSummary, error) { +func (a *Adapter) RecentSessions(ctx context.Context, since time.Time) ([]curator.SessionRef, error) { sessions, err := a.store.List(ctx) if err != nil { return nil, fmt.Errorf("sessioncurator: listing sessions: %w", err) } - var out []curator.SessionSummary + var out []curator.SessionRef for _, s := range sessions { if s.LastActiveAt.Before(since) { continue } - out = append(out, curator.SessionSummary{ID: s.SessionID, AgentID: a.agentID, LastActive: s.LastActiveAt}) + out = append(out, curator.SessionRef{ID: s.SessionID, AgentID: a.agentID, LastActive: s.LastActiveAt}) } return out, nil } diff --git a/internal/infrastructure/sessioncurator/sessioncurator.go b/internal/infrastructure/sessioncurator/sessioncurator.go index 1f003447a..bb9e09647 100644 --- a/internal/infrastructure/sessioncurator/sessioncurator.go +++ b/internal/infrastructure/sessioncurator/sessioncurator.go @@ -128,7 +128,7 @@ func effectiveSince(since, now time.Time) time.Time { // reviewOne extracts observations from one session and writes them as // agent-user memory for its single participant. It returns nil when nothing // was extracted, or a skip action when the session cannot be attributed. -func (c *Curator) reviewOne(ctx context.Context, engine domainmemory.MemoryEngine, sess curator.SessionSummary) (*curator.Action, error) { +func (c *Curator) reviewOne(ctx context.Context, engine domainmemory.MemoryEngine, sess curator.SessionRef) (*curator.Action, error) { msgs, err := c.host.Conversations.Messages(ctx, sess.ID, messageTailSize) if err != nil { return nil, err