fix(codex): clear completed safety review prompt (#1156)

This commit is contained in:
SSU-WEI HUANG
2026-07-26 15:07:24 +08:00
committed by GitHub
parent 75e803f359
commit 73bc45c1ae
2 changed files with 16 additions and 2 deletions
@@ -946,6 +946,20 @@ describe('AppServerEventConverter', () => {
faster_model: 'gpt-5.4-mini'
}]);
expect(converter.handleNotification('model/safetyBuffering/updated', {
threadId: 'thread-1',
turnId: 'turn-1',
showBufferingUi: false
})).toEqual([{
type: 'model_safety_buffering',
thread_id: 'thread-1',
turn_id: 'turn-1',
use_cases: [],
reasons: [],
show_buffering_ui: false,
faster_model: null
}]);
expect(converter.handleNotification('model/rerouted', {
threadId: 'thread-1',
turnId: 'turn-1',
@@ -791,12 +791,12 @@ export class AppServerEventConverter {
if (method === 'model/safetyBuffering/updated') {
const model = asString(paramsRecord.model);
const showBufferingUi = asBoolean(paramsRecord.showBufferingUi ?? paramsRecord.show_buffering_ui);
if (!model || showBufferingUi === null) {
if (showBufferingUi === null || (showBufferingUi && !model)) {
return events;
}
events.push(scoped({
type: 'model_safety_buffering',
model,
...(model ? { model } : {}),
use_cases: extractStringArray(paramsRecord.useCases ?? paramsRecord.use_cases),
reasons: extractStringArray(paramsRecord.reasons),
show_buffering_ui: showBufferingUi,