Add Codex DeepSeek credentialed e2e

This commit is contained in:
pku-xht
2026-08-05 01:30:42 +08:00
parent 46db608843
commit 01704b9a3a
9 changed files with 362 additions and 16 deletions

View File

@@ -85,7 +85,12 @@ function responseObject(text: string): Record<string, unknown> {
}
}
function completeEvents(text: string): Record<string, unknown>[] {
/**
* Build the minimal Responses SSE event sequence consumed by Codex 0.146.0.
* @param text - exact assistant answer.
* @returns ordered response lifecycle events.
*/
export function completeResponsesEvents(text: string): Record<string, unknown>[] {
const completed = responseObject(text)
const message = (completed.output as Record<string, unknown>[])[0]!
const part = (message.content as Record<string, unknown>[])[0]!
@@ -250,7 +255,7 @@ export async function startResponsesFixture(
})
if (behavior.kind === 'hold') return
const events = behavior.kind === 'complete'
? completeEvents(behavior.text)
? completeResponsesEvents(behavior.text)
: functionCallEvents(behavior.name, behavior.arguments)
for (const event of events) {
response.write(`data: ${JSON.stringify(event)}\n\n`)