MCPcopy Index your code
hub / github.com/simstudioai/sim / getLatestSeq

Function getLatestSeq

apps/sim/lib/copilot/request/session/buffer.ts:220–229  ·  view source on GitHub ↗
(streamId: string)

Source from the content-addressed store, hash-verified

218}
219
220export async function getLatestSeq(streamId: string): Promise<number | null> {
221 return withRedisRetry({ operation: 'get_latest_seq', streamId }, async (redis) => {
222 const currentSeq = await redis.get(getSeqKey(streamId))
223 if (currentSeq === null) {
224 return null
225 }
226 const parsed = Number(currentSeq)
227 return Number.isFinite(parsed) ? parsed : null
228 })
229}
230
231export async function writeAbortMarker(streamId: string): Promise<void> {
232 const ttlSeconds = getStreamConfig().ttlSeconds

Callers 1

checkForReplayGapFunction · 0.90

Calls 3

withRedisRetryFunction · 0.70
getSeqKeyFunction · 0.70
getMethod · 0.65

Tested by

no test coverage detected