Make Codex and Claude Code subscriptions go further: a local model router that gives routine agent work to economical models and keeps your strongest model for the hard parts.
Rust ai-agentsai-gatewayclaude-codecodexcoding-agentcost-optimizationdeepseekllm-gatewayllm-routerlocal-firstmodel-routingrusttask-routingtauri
use serde::{Deserialize, Serialize};
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(tag = "kind", rename_all = "snake_case", deny_unknown_fields)]
pub enum RunProcessObservationV1 {
Running,
Exited { code: Option<i32> },
Unknown,
}
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(rename_all = "snake_case")]
pub enum RunStopScopeV1 {
Root,
ProcessGroup,
Job,
}
/// Only actual launcher facts, not authorization or proof about arbitrary descendants.
#[derive(Clone, Copy, Debug, Deserialize, Eq, PartialEq, Serialize)]
#[serde(deny_unknown_fields)]
pub struct RunStopEvidenceV1 {
pub scope: RunStopScopeV1,
pub observation: RunProcessObservationV1,
pub scope_stopped: bool,
pub residual_unknown: bool,
}
impl RunStopEvidenceV1 {
pub fn valid(&self) -> bool {
!self.scope_stopped || matches!(self.observation, RunProcessObservationV1::Exited { .. })
}
}