mirror of
https://github.com/deepseek-ai/deepseek-harness.git
synced 2026-08-29 04:26:38 +00:00
fix(subagent): normalize Codex payload diagnostics
This commit is contained in:
@@ -49,7 +49,11 @@ const CODEX_PACKAGE_BIN = resolve(
|
||||
function missingPayloadDiagnostic(child: SubprocessHandle): string | undefined {
|
||||
const stderr = child.collected.stderr?.readFrom(0).text
|
||||
if (stderr === undefined) return undefined
|
||||
return /Missing optional dependency[^\r\n]*/.exec(stderr)?.[0]?.trim()
|
||||
const platformPackage = /Missing optional dependency (@openai\/codex-[a-z0-9-]+)/
|
||||
.exec(stderr)?.[1]
|
||||
return platformPackage === undefined
|
||||
? undefined
|
||||
: `Missing optional dependency ${platformPackage}`
|
||||
}
|
||||
|
||||
function withMissingPayloadDiagnostic(
|
||||
|
||||
@@ -1074,7 +1074,8 @@ describe('run lifecycle and quiescence', () => {
|
||||
const child = fakeChild({
|
||||
stderr: [
|
||||
'credential-like unrelated stderr',
|
||||
'Error: Missing optional dependency @openai/codex-linux-x64.',
|
||||
'Error: Missing optional dependency @openai/codex-linux-x64. '
|
||||
+ 'Reinstall Codex: pnpm add -g @openai/codex@latest',
|
||||
].join('\n'),
|
||||
})
|
||||
const starting = startCodexRun(request(), runSpec(child))
|
||||
@@ -1088,6 +1089,8 @@ describe('run lifecycle and quiescence', () => {
|
||||
if (!(error instanceof Error)) throw new Error('expected startup failure')
|
||||
expect(error.message).toContain('Missing optional dependency @openai/codex-linux-x64')
|
||||
expect(error.message).not.toContain('credential-like unrelated stderr')
|
||||
expect(error.message).not.toContain('Reinstall Codex')
|
||||
expect(error.message).not.toContain('pnpm add -g')
|
||||
expect(child.terminate).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user