MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / unsubscribe

Method unsubscribe

apps/kimi-web/src/api/daemon/ws.ts:170–183  ·  view source on GitHub ↗

Unsubscribe from a session's events.

(sessionId: string)

Source from the content-addressed store, hash-verified

168
169 /** Unsubscribe from a session's events. */
170 unsubscribe(sessionId: string): void {
171 this.subscriptions.delete(sessionId);
172 // Also cancel a subscribe that was queued before server_hello; otherwise
173 // onServerHello would merge it back into the active subscription set.
174 const pendingIdx = this.pendingSubscriptions.findIndex((p) => p.sessionId === sessionId);
175 if (pendingIdx !== -1) this.pendingSubscriptions.splice(pendingIdx, 1);
176 if (this.connected && this.ws) {
177 this.send({
178 type: 'unsubscribe',
179 id: this.nextId(),
180 payload: { session_ids: [sessionId] },
181 });
182 }
183 }
184
185 /**
186 * Send a WS abort control message for a prompt.

Callers

nothing calls this directly

Calls 3

sendMethod · 0.95
nextIdMethod · 0.95
deleteMethod · 0.65

Tested by

no test coverage detected