MCPcopy Create free account
hub / github.com/ChatLab/ChatLab / abort

Function abort

src/services/ai-stream/service.ts:139–156  ·  view source on GitHub ↗
(requestId: string)

Source from the content-addressed store, hash-verified

137 },
138
139 async abort(requestId: string): Promise<{ success: boolean; error?: string }> {
140 const entry = requestIdMap.get(requestId)
141 if (!entry) return { success: false, error: 'Request not found' }
142
143 entry.abortController.abort()
144
145 if (entry.serverId) {
146 try {
147 const { post } = await import('../utils/http')
148 await post<{ success: boolean }>('/ai/agent/abort', { requestId: entry.serverId })
149 } catch {
150 // server-side abort is best-effort; client already aborted the fetch
151 }
152 }
153
154 requestIdMap.delete(requestId)
155 return { success: true }
156 },
157 }
158}

Callers

nothing calls this directly

Calls 3

abortMethod · 0.80
getMethod · 0.65
deleteMethod · 0.65

Tested by

no test coverage detected