fix(codex): preserve native safety behavior (#1024)

* test: reproduce issue #1020

* fix: preserve Codex safety behavior (closes #1020)

* test: cover Codex safety buffering dismissal

* test: cover Codex safety retry edge cases

* fix: keep dismissed safety buffering prompts hidden
This commit is contained in:
SSU-WEI HUANG
2026-07-12 18:39:56 +08:00
committed by GitHub
parent d160203bb2
commit d9ea9db507
8 changed files with 1166 additions and 14 deletions
+14
View File
@@ -16,6 +16,8 @@ import type {
TurnStartResponse,
TurnInterruptParams,
TurnInterruptResponse,
ThreadRollbackParams,
ThreadRollbackResponse,
ThreadCompactStartParams,
ThreadCompactStartResponse,
ThreadGoalSetParams,
@@ -207,6 +209,18 @@ export class CodexAppServerClient extends JsonLineParser {
return response as TurnInterruptResponse;
}
/**
* Deprecated upstream, but still required to match Codex's native
* safety-buffering retry flow. Keep the protocol call isolated here so it
* can be replaced when app-server exposes a successor.
*/
async rollbackThread(params: ThreadRollbackParams): Promise<ThreadRollbackResponse> {
const response = await this.sendRequest('thread/rollback', params, {
timeoutMs: 30_000
});
return response as ThreadRollbackResponse;
}
async compactThread(
params: ThreadCompactStartParams,
options?: { signal?: AbortSignal }