MCPcopy Create free account
hub / github.com/arctic-cli/interface / ensureBaseSnapshot

Function ensureBaseSnapshot

packages/arctic/src/session/benchmark.ts:171–186  ·  view source on GitHub ↗
(parent: Session.Info)

Source from the content-addressed store, hash-verified

169 }
170
171 export async function ensureBaseSnapshot(parent: Session.Info) {
172 if (!isParent(parent)) return undefined
173 if (parent.benchmark.baseSnapshot) return parent.benchmark.baseSnapshot
174 const snapshot = await Snapshot.track()
175 if (!snapshot) {
176 throw new SnapshotUnavailableError({
177 message: "Benchmark mode requires snapshots (git) to be enabled.",
178 })
179 }
180 await Session.update(parent.id, (draft) => {
181 if (draft.benchmark?.type === "parent") {
182 draft.benchmark.baseSnapshot = snapshot
183 }
184 })
185 return snapshot
186 }
187
188 export async function updateChildSnapshot(sessionID: string, snapshot?: string, error?: string) {
189 await Session.update(sessionID, (draft) => {

Callers

nothing calls this directly

Calls 2

isParentFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected