chore: handle all cases for EventMsg (#936)

For now, this removes the `#[non_exhaustive]` directive on `EventMsg` so
that we are forced to handle all `EventMsg` by default. (We may revisit
this if/when we publish `core/` as a `lib` crate.) For now, it is
helpful to have this as a forcing function because we have effectively
two UIs (`tui` and `exec`) and usually when we add a new variant to
`EventMsg`, we want to be sure that we update both.
This commit is contained in:
Michael Bolin
2025-05-14 13:36:43 -07:00
committed by GitHub
parent 497c5396c0
commit 34aa1991f1
5 changed files with 36 additions and 10 deletions

View File

@@ -157,7 +157,23 @@ pub async fn run_codex_tool_session(
EventMsg::SessionConfigured(_) => {
tracing::error!("unexpected SessionConfigured event");
}
_ => {}
EventMsg::Error(_)
| EventMsg::TaskStarted
| EventMsg::AgentReasoning(_)
| EventMsg::McpToolCallBegin(_)
| EventMsg::McpToolCallEnd(_)
| EventMsg::ExecCommandBegin(_)
| EventMsg::ExecCommandEnd(_)
| EventMsg::BackgroundEvent(_)
| EventMsg::PatchApplyBegin(_)
| EventMsg::PatchApplyEnd(_) => {
// For now, we do not do anything extra for these
// events. Note that
// send(codex_event_to_notification(&event)) above has
// already dispatched these events as notifications,
// though we may want to do give different treatment to
// individual events in the future.
}
}
}
Err(e) => {