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

Function stop

packages/arctic/src/session/benchmark.ts:151–169  ·  view source on GitHub ↗
(input: { sessionID: string })

Source from the content-addressed store, hash-verified

149 }
150
151 export async function stop(input: { sessionID: string }) {
152 const parent = await resolveParent(input.sessionID)
153 if (!parent || !isParent(parent)) return parent ?? (await Session.get(input.sessionID))
154
155 const children = parent.benchmark.children
156 await Promise.all(
157 children.map((child) =>
158 Session.update(child.sessionID, (draft) => {
159 draft.benchmark = undefined
160 }),
161 ),
162 )
163 const worktreeRoot = path.join(Global.Path.data, "benchmark", parent.id)
164 await fs.rm(worktreeRoot, { recursive: true, force: true }).catch(() => {})
165
166 return Session.update(parent.id, (draft) => {
167 draft.benchmark = undefined
168 })
169 }
170
171 export async function ensureBaseSnapshot(parent: Session.Info) {
172 if (!isParent(parent)) return undefined

Callers 1

startFunction · 0.70

Calls 4

resolveParentFunction · 0.85
isParentFunction · 0.85
getMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected