feat: map codex realtime thread status
This commit is contained in:
73
tests/fixtures/codex-app-server-runtime.mjs
vendored
73
tests/fixtures/codex-app-server-runtime.mjs
vendored
@@ -394,6 +394,79 @@ rl.on("line", (line) => {
|
||||
},
|
||||
});
|
||||
}
|
||||
if (process.env.BOSS_CODEX_APP_SERVER_FIXTURE_EMIT_REALTIME_EVENTS === "1") {
|
||||
send({
|
||||
method: "thread/status/changed",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
status: {
|
||||
type: "active",
|
||||
activeFlags: ["waitingOnApproval", "waitingOnUserInput"],
|
||||
},
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/started",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
realtimeSessionId: "rt-session-1",
|
||||
version: "v2",
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/sdp",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
sdp: "v=0 secret-sk-should-not-leak",
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/transcript/delta",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
role: "assistant",
|
||||
delta: "正在分析 Codex ",
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/transcript/done",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
role: "assistant",
|
||||
text: "正在分析 Codex App Server 实时事件。",
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/outputAudio/delta",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
audio: {
|
||||
data: "audio-secret-payload",
|
||||
sampleRate: 24000,
|
||||
numChannels: 1,
|
||||
samplesPerChannel: 480,
|
||||
itemId: "audio-item-1",
|
||||
},
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/itemAdded",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
item: {
|
||||
type: "message",
|
||||
text: "raw realtime item should not be persisted",
|
||||
},
|
||||
},
|
||||
});
|
||||
send({
|
||||
method: "thread/realtime/closed",
|
||||
params: {
|
||||
threadId: message.params?.threadId,
|
||||
reason: "completed",
|
||||
},
|
||||
});
|
||||
}
|
||||
send({
|
||||
method: "item/agentMessage/delta",
|
||||
params: {
|
||||
|
||||
Reference in New Issue
Block a user