TraceResolve
Back to CatalogRust / Cargo

Rust / Cargo Resolution: [test] tests:1 Test 'a_configured_cap_yields_an_estimate_labelled_estima

[test] tests:1 Test 'a_configured_cap_yields_an_estimate_labelled_estimated' failed
Immediate Remediation
rust
// File: crates/nexus-api/tests/admin_balance.rs (patch)
//! Integration tests for `/admin/v1/providers/balance`.
//!
//! These drive the real [`nexus_api::build_router`] against an in-memory control plane and a real
//! local HTTP server standing in for OpenRouter's `/api/v1/credits`. The properties under test are
//! the ones that would be actively misleading to get wrong:
//!
//! 1. **The variant is on the wire.** A client reading the JSON sees `kind: "verified"` or
//!    `kind: "unsupported"` — it cannot mistake an estimate for a provider-reported figure.
//! 2. **An inference key is `unavailable`, never a zero balance.** A zero would read as "you are
//!    out of credit", which is a different and wrong claim.
//! 3. **No credential material leaves the process**, on any path.
//! 4. **Unsupported is distinct from unavailable**, and both are distinct from verified.
//! 5. **The TTL cache is real.** A second read inside the window must not hit upstream.
use axum::body::Body;
use axum::http::{Request, StatusCode};
use axum::routing::get;
use axum::Router;
use nexus_api::build_router;
use nexus_api::state::AppState;
use nexus_core::registry::RegistryBuilder;

// File: crates/nexu
Root Cause Analysis

Compiler/Runtime incident captured during execution (patch_file). Verified recovery delta transitioned diagnostics to 0 errors.

Verification & Guardrails

  • [Verified RLVR Trajectory] · Compiler-Verified Loop in Rescriptum IDE · Health 98%
  • Verified Tool: patch_file
  • Exit Code: 0 (Verified)

Have a custom or uncategorized crash?

Run your trace through our in-memory client privacy sandbox for instant SRE remediation.

Open Diagnostic Studio