Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:1jehuang Jcode run provider e2e

From Leeroopedia
Knowledge Sources
Domains Testing, Diagnostics
Last Updated 2026-10-18 00:00 GMT

Overview

Concrete tool for running escalating-tier provider diagnostics through strict end-to-end checkpoints provided by the jcode provider-doctor.

Description

The run_provider_e2e function is the core of jcode provider-doctor. It takes a provider profile, optional API key, optional model, and a DoctorTier, and runs the appropriate checkpoints for that tier. The DoctorTier enum (Offline, Catalog, Full) controls how much of the pipeline runs: offline validates only internal wiring, catalog adds a live model fetch, and full adds live chat/streaming/tool-call probes. Results are assembled into a DoctorReport with per-checkpoint DoctorCheck entries.

Usage

  • Offline diagnostics: jcode provider-doctor --tier offline — no key, no network, no spend.
  • Catalog diagnostics: jcode provider-doctor --tier catalog — key required, negligible spend.
  • Full diagnostics: jcode provider-doctor --tier full — key required, spends balance.
  • JSON output: jcode provider-doctor --json --tier full — machine-readable report.

Code Reference

Source Location

  • Repository: jcode
  • File: crates/jcode-provider-doctor/src/provider_e2e.rs

Signature

pub enum DoctorTier {
    Offline,
    Catalog,
    Full,
}

impl DoctorTier {
    pub fn requires_api_key(self) -> bool
    pub fn spends_balance(self) -> bool
    pub fn as_str(self) -> &'static str
}

impl std::str::FromStr for DoctorTier {
    type Err = String;
    fn from_str(value: &str) -> Result<Self, Self::Err>
}

pub struct DoctorCheck {
    pub checkpoint: &'static str,
    pub label: &'static str,
    pub status: LiveVerificationStageStatus,
    pub detail: String,
}

pub async fn run_provider_e2e(
    profile: OpenAiCompatibleProfile,
    api_key: Option<&str>,
    requested_model: Option<&str>,
    tier: DoctorTier,
) -> Result<DoctorReport>

Import

// Accessed via CLI: jcode provider-doctor --tier <tier>
// crates/jcode-provider-doctor/src/provider_e2e.rs

I/O Contract

Inputs

Name Type Required Description
profile OpenAiCompatibleProfile Yes Provider configuration (endpoint, headers)
api_key Option<&str> No /// Required for Catalog and Full tiers
requested_model Option<&str> No /// Model ID to test
tier DoctorTier Yes /// Validation depth: offline, catalog, or full

Outputs

Name Type Description
return Result<DoctorReport> Report with per-checkpoint DoctorCheck results
exit code i32 0 = all passed, non-zero = failures

Usage Examples

Offline Tier

# No key, no network, no spend — validates jcode wiring only
jcode provider-doctor --tier offline

Full Tier with JSON

# Key required, spends balance — full chat/streaming/tool-call checks
jcode provider-doctor --tier full --json

Related Pages

Implements Principle

Requires Environment

Uses Heuristics

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment