MCPcopy Create free account
hub / github.com/tiann/hapi / disconnect

Method disconnect

cli/src/codex/codexAppServerClient.ts:254–276  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

252 }
253
254 async disconnect(): Promise<void> {
255 if (!this.connected) {
256 return;
257 }
258
259 const child = this.process;
260 this.process = null;
261
262 try {
263 child?.stdin.end();
264 if (child) {
265 await killProcessByChildProcess(child);
266 }
267 } catch (error) {
268 logger.debug('[CodexAppServer] Error while stopping process', error);
269 } finally {
270 this.rejectAllPending(new Error('Codex app-server disconnected'));
271 this.connected = false;
272 this.resetParserState();
273 }
274
275 logger.debug('[CodexAppServer] Disconnected');
276 }
277
278 private async sendRequest(
279 method: string,

Callers 1

listCodexModelsFunction · 0.95

Calls 5

rejectAllPendingMethod · 0.95
resetParserStateMethod · 0.95
endMethod · 0.80
debugMethod · 0.80

Tested by

no test coverage detected