fix: show codexapp steer insertion status

This commit is contained in:
shiyue
2026-06-15 13:48:40 +08:00
parent ed3238fa49
commit 0849666a6e
5 changed files with 229 additions and 18 deletions

View File

@@ -887,9 +887,37 @@ async function main() {
ws.send(JSON.stringify({ type: 'message', text: 'slow codexapp prompt', sessionId: codexAppSession.sessionId, mode: 'yolo', agent: 'codexapp' }));
await nextMessage(messages, ws, (msg) => msg.type === 'session_list' && msg.sessions.some((s) => s.id === codexAppSession.sessionId && s.isRunning));
await sleep(150);
ws.send(JSON.stringify({ type: 'message', text: 'runtime steer insert', sessionId: codexAppSession.sessionId, mode: 'yolo', agent: 'codexapp' }));
ws.send(JSON.stringify({
type: 'message',
text: 'runtime steer insert',
sessionId: codexAppSession.sessionId,
mode: 'yolo',
agent: 'codexapp',
clientMessageId: 'regression-steer-message',
}));
const steerPending = await nextMessage(messages, ws, (msg) =>
msg.type === 'codex_app_steer_status' &&
msg.sessionId === codexAppSession.sessionId &&
msg.clientMessageId === 'regression-steer-message' &&
msg.status === 'pending'
);
assert(/引导中/.test(steerPending.message || ''), 'Codex App steer should expose pending status');
const steerDelta = await nextMessage(messages, ws, (msg) => msg.type === 'text_delta' && msg.sessionId === codexAppSession.sessionId && /steer accepted: runtime steer insert/.test(msg.text || ''));
assert(/runtime steer insert/.test(steerDelta.text || ''), 'Codex App running message should use turn/steer');
const steerInserted = await nextMessage(messages, ws, (msg) =>
msg.type === 'codex_app_steer_status' &&
msg.sessionId === codexAppSession.sessionId &&
msg.clientMessageId === 'regression-steer-message' &&
msg.status === 'inserted'
);
assert(/已插入/.test(steerInserted.message || ''), 'Codex App steer should expose inserted status');
const steerSystemMessage = await nextMessage(messages, ws, (msg) =>
msg.type === 'system_message' &&
msg.sessionId === codexAppSession.sessionId &&
/已引导对话: runtime steer insert/.test(msg.message || '')
);
assert(steerSystemMessage.transient === true, 'Codex App steer marker should be transient');
assert(/已引导对话: runtime steer insert/.test(steerSystemMessage.message || ''), 'Codex App steer should show guided conversation marker with preview');
await nextMessage(messages, ws, (msg) => msg.type === 'done' && msg.sessionId === codexAppSession.sessionId);
storedCodexApp = JSON.parse(fs.readFileSync(path.join(sessionsDir, `${codexAppSession.sessionId}.json`), 'utf8'));
assert(storedCodexApp.codexAppThreadId === codexAppThreadId, 'Codex App follow-up should resume the same app-server thread');