This commit is contained in:
Ahmed Ibrahim
2025-12-18 18:32:41 -08:00
parent 677532f97b
commit f8ba48d995
2 changed files with 9 additions and 0 deletions

View File

@@ -67,6 +67,11 @@ pub(crate) fn map_api_error(err: ApiError) -> CodexErr {
status,
request_id: extract_request_id(headers.as_ref()),
})
} else if status == http::StatusCode::PRECONDITION_FAILED
&& body_text
.contains("Models catalog has changed. Please refresh your models list.")
{
CodexErr::OutdatedModels
} else {
CodexErr::UnexpectedStatus(UnexpectedResponseError {
status,

View File

@@ -90,6 +90,10 @@ pub enum CodexErr {
#[error("spawn failed: child stdout/stderr not captured")]
Spawn,
/// Returned when the models list is outdated and needs to be refreshed.
#[error("remote models list is outdated")]
OutdatedModels,
/// Returned by run_command_stream when the user pressed CtrlC (SIGINT). Session uses this to
/// surface a polite FunctionCallOutput back to the model instead of crashing the CLI.
#[error("interrupted (Ctrl-C). Something went wrong? Hit `/feedback` to report the issue.")]