@@ -18,7 +18,8 @@ import type {
1818 ItemStartedNotification , ThreadItem ,
1919 ModelReroutedNotification ,
2020 ThreadTokenUsageUpdatedNotification ,
21- TurnPlanUpdatedNotification
21+ TurnPlanUpdatedNotification ,
22+ WarningNotification
2223} from "./app-server/v2" ;
2324import type { McpStartupCompleteEvent } from "./app-server" ;
2425import { toTokenCount } from "./TokenCount" ;
@@ -115,6 +116,8 @@ export class CodexEventHandler {
115116 return null ;
116117 case "configWarning" :
117118 return await this . createConfigWarningEvent ( notification . params ) ;
119+ case "warning" :
120+ return this . createWarningEvent ( notification . params ) ;
118121 case "thread/compacted" :
119122 return {
120123 sessionUpdate : "agent_message_chunk" ,
@@ -139,7 +142,6 @@ export class CodexEventHandler {
139142 case "windowsSandbox/setupCompleted" :
140143 case "account/login/completed" :
141144 case "skills/changed" :
142- case "warning" :
143145 case "deprecationNotice" :
144146 case "mcpServer/oauthLogin/completed" :
145147 case "externalAgentConfig/import/completed" :
@@ -179,6 +181,16 @@ export class CodexEventHandler {
179181 }
180182 }
181183
184+ private createWarningEvent ( event : WarningNotification ) : UpdateSessionEvent {
185+ return {
186+ sessionUpdate : "agent_message_chunk" ,
187+ content : {
188+ type : "text" ,
189+ text : `Warning: ${ event . message } \n\n`
190+ }
191+ } ;
192+ }
193+
182194 private createModelReroutedEvent ( event : ModelReroutedNotification ) : UpdateSessionEvent {
183195 return {
184196 sessionUpdate : "agent_thought_chunk" ,
0 commit comments