MCPcopy Create free account
hub / github.com/anomalyco/opencode / cmpMessage

Function cmpMessage

packages/app/src/context/server-session.ts:21–21  ·  view source on GitHub ↗
(a: Message, b: Message)

Source from the content-addressed store, hash-verified

19
20const cmp = (a: string, b: string) => (a < b ? -1 : a > b ? 1 : 0)
21const cmpMessage = (a: Message, b: Message) => a.time.created - b.time.created || cmp(a.id, b.id)
22const SKIP_PARTS = new Set(["patch", "step-start", "step-finish"])
23const initialMessagePageSize = 2
24const historyMessagePageSize = 200

Callers 1

loadMessagesFunction · 0.85

Calls 1

cmpFunction · 0.70

Tested by

no test coverage detected