Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Compactor ¶
type Compactor struct {
// contains filtered or unexported fields
}
func (*Compactor) Compact ¶
func (c *Compactor) Compact( ctx context.Context, model fantasy.LanguageModel, store CompactorStore, sessionID string, ) error
Compact narrows the LLM-facing message window when it grows past the configured caps. The daemon's agent_messages table has no "hidden but visible-to-UI" notion, so compaction is destructive in the new model: rows that drop out of the window are gone for the UI too. The summarize strategy injects a synthetic "[Conversation summary]: …" assistant row in place of the old window; the slide strategy just keeps the tail.
Per the alpha plan that moved storage to the daemon, this trade is intentional — the dashboard ListMessages view now mirrors the model's actual context, never a "collapsed" superset.
type CompactorStore ¶
type CompactorStore interface {
ListMessages(ctx context.Context, sessionID string) ([]memoryclient.StoredMessage, error)
ReplaceMessages(ctx context.Context, sessionID string, msgs []memoryclient.StoredMessage) error
}
CompactorStore is the read+rewrite surface Compact needs. *memoryclient.Client satisfies it; tests inject an in-memory fake.