use client

This commit is contained in:
Ahmed Ibrahim
2025-11-25 12:44:43 -08:00
parent 5c40534e98
commit 075d50677d

View File

@@ -7,11 +7,10 @@ use codex_client::ReqwestTransport;
use http::header::CONTENT_TYPE;
use serde::Deserialize;
use serde::Serialize;
use serde_json::Value;
use std::fmt;
use std::time::Duration;
use strum::Display;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[derive(Debug, Clone, Display, Copy, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "snake_case")]
pub enum ComponentHealth {
Operational,
@@ -33,14 +32,6 @@ impl ComponentHealth {
}
}
impl fmt::Display for ComponentHealth {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
let value = Value::from(self).as_str().ok_or(fmt::Error)?;
f.write_str(value)
}
}
pub async fn fetch_codex_health() -> Result<ComponentHealth> {
let client = reqwest::Client::builder()
.connect_timeout(Duration::from_secs(5))