Add Codex clear and compact slash commands (#541)

* Add Codex clear and compact slash commands

* Stabilize queued thinking event test

* Interrupt active Codex turn before slash commands
This commit is contained in:
NightWatcher314
2026-04-29 14:15:44 +08:00
committed by GitHub
parent 0160da4bb5
commit a612be50d6
15 changed files with 460 additions and 16 deletions
+14 -1
View File
@@ -13,7 +13,9 @@ import type {
TurnStartParams,
TurnStartResponse,
TurnInterruptParams,
TurnInterruptResponse
TurnInterruptResponse,
ThreadCompactStartParams,
ThreadCompactStartResponse
} from './appServerTypes';
type JsonRpcLiteRequest = {
@@ -173,6 +175,17 @@ export class CodexAppServerClient {
return response as TurnInterruptResponse;
}
async compactThread(
params: ThreadCompactStartParams,
options?: { signal?: AbortSignal }
): Promise<ThreadCompactStartResponse> {
const response = await this.sendRequest('thread/compact/start', params, {
signal: options?.signal,
timeoutMs: CodexAppServerClient.DEFAULT_TIMEOUT_MS
});
return response as ThreadCompactStartResponse;
}
async disconnect(): Promise<void> {
if (!this.connected) {
return;