[codex] add harness engineering guardrails (#284)

* refactor: add harness engineering guardrails

* fix: address harness review feedback

---------

Co-authored-by: apple <apple@appledeMacBook-Pro.local>
This commit is contained in:
Cita
2026-03-26 21:22:36 +08:00
committed by GitHub
parent b3387dfba7
commit 8ebfc39745
16 changed files with 737 additions and 22 deletions
+6 -2
View File
@@ -119,9 +119,13 @@ function decodeRuntimeResponseBuffer(buffer: Buffer, contentEncoding: string | n
export async function readRuntimeResponseText(
response: RuntimeResponse,
): Promise<string> {
const contentEncoding = response.headers.get('content-encoding');
const contentEncoding = typeof response.headers?.get === 'function'
? response.headers.get('content-encoding')
: null;
if (!hasZstdContentEncoding(contentEncoding)) {
return response.text().catch(() => '');
return typeof response.text === 'function'
? response.text().catch(() => '')
: '';
}
const rawBuffer = Buffer.from(await response.arrayBuffer());