MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / releaseFreebuffSlot

Function releaseFreebuffSlot

cli/src/hooks/use-freebuff-session.ts:255–265  ·  view source on GitHub ↗

Best-effort DELETE of the caller's session row, gated on actually holding * one. Used both by exit paths and any flow that wants the next POST to * start clean (rejoin, return-to-landing). Always swallows errors — the * server-side sweep is the backstop.

()

Source from the content-addressed store, hash-verified

253 * start clean (rejoin, return-to-landing). Always swallows errors — the
254 * server-side sweep is the backstop. */
255async function releaseFreebuffSlot(): Promise<void> {
256 const current = useFreebuffSessionStore.getState().session
257 if (!shouldReleaseSlot(current)) return
258 const { token } = getAuthTokenDetails()
259 if (!token) return
260 try {
261 await callSession('DELETE', token)
262 } catch {
263 // swallow
264 }
265}
266
267async function resetChatStore(): Promise<void> {
268 const { useChatStore } = await import('../state/chat-store')

Callers 3

restartFreebuffSessionFunction · 0.85

Calls 3

getAuthTokenDetailsFunction · 0.90
shouldReleaseSlotFunction · 0.85
callSessionFunction · 0.85

Tested by

no test coverage detected