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

Function dropSessionState

packages/app/src/context/layout.tsx:326–345  ·  view source on GitHub ↗
(keys: string[])

Source from the content-addressed store, hash-verified

324 ] as const
325
326 const dropSessionState = (keys: string[]) => {
327 for (const key of keys) {
328 const scope = SessionStateKey.scope(key)
329 const parts = SessionStateKey.route(key).split("/")
330 const dir = parts[0]
331 const session = parts[1]
332 if (!dir) continue
333
334 for (const entry of SESSION_STATE_KEYS) {
335 const target = session
336 ? Persist.serverSession(scope, dir, session, entry.key)
337 : Persist.serverWorkspace(scope, dir, entry.key)
338 void removePersisted(target, platform)
339
340 if (scope !== ServerScope.local) continue
341 const legacyKey = `${dir}/${entry.legacy}${session ? "/" + session : ""}.${entry.version}`
342 void removePersisted({ key: legacyKey }, platform)
343 }
344 }
345 }
346
347 function prune(keep?: string) {
348 const drop = pruneSessionKeys({

Callers 1

pruneFunction · 0.85

Calls 1

removePersistedFunction · 0.90

Tested by

no test coverage detected