pub struct SetupReport {
pub login: StepResult<LoginInfo>,
pub claim: StepResult<ClaimInfo>,
pub claim_attempts: Vec<TierAttempt>,
pub models: StepResult<ModelsInfo>,
pub status: StepResult<StatusResponse>,
pub auth_expired: bool,
}Expand description
Display-friendly summary of each step’s outcome. Returned by run
so the caller can render however it wants (plain stdout, TUI body
scrollback, future JSON output for scripting).
Fields§
§login: StepResult<LoginInfo>§claim: StepResult<ClaimInfo>§claim_attempts: Vec<TierAttempt>Per-tier cascade history. Populated by step_claim with one
entry per tier actually attempted (in cascade order Max → Pro
→ Lite). Empty when the cascade never ran (e.g. login failed
upstream — claim is Skipped(CASCADE_FROM_UPSTREAM_FAIL)) or
when a legacy test fixture wants the old single-row claim
summary. render walks this to emit one row per tier so
refused / errored intermediate tiers are visible, not hidden
behind a single “claim failed” summary.
models: StepResult<ModelsInfo>§status: StepResult<StatusResponse>§auth_expired: boolTrue when any API call rejected the stored bearer token
(401/403). is_logged_in() only checks “does auth.toml exist”
and get_valid_token only refreshes when the recorded
expires_in says so — neither catches a server-side revocation
or a refresh-token that the broker no longer accepts. Shells
(TUI /codingplan, CLI atomcode codingplan) read this flag
to drive an inline re-OAuth + retry instead of leaving the user
staring at a “claim failed — run atomcode login again” line
when /login would have fixed it in one step.
Implementations§
Source§impl SetupReport
impl SetupReport
Sourcepub fn render(&self) -> String
pub fn render(&self) -> String
Render as a multi-line plain-text block for stdout / TUI body.
Shared by the CLI subcommand and the /codingplan slash command
so the visual contract stays consistent.
Sourcepub fn should_persist_config(&self) -> bool
pub fn should_persist_config(&self) -> bool
True iff every persist-relevant step (login + claim + models)
either succeeded outright or was skipped non-fatally (server
reported duplicate=true, model list already current, etc.).
Callers use this to decide whether to persist config changes
to disk.
claim MUST be in the predicate: when claim returns Err
(e.g. backend 500 like the AtomGit claim-v2 transaction-
rollback bug), run() short-circuits and parks models as
Skipped(CASCADE_FROM_UPSTREAM_FAIL) so the report stays
focused on the actual failure. Without the claim check the
gate flipped to true on every claim-failure path —
triggering save_and_reload to rewrite config.toml
unconditionally. That clobbered any manual edits the user
made between TUI startup and /codingplan, and read as
“claim failed but it still wrote models to my config”.
Trait Implementations§
Source§impl Clone for SetupReport
impl Clone for SetupReport
Source§fn clone(&self) -> SetupReport
fn clone(&self) -> SetupReport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SetupReport
impl RefUnwindSafe for SetupReport
impl Send for SetupReport
impl Sync for SetupReport
impl Unpin for SetupReport
impl UnsafeUnpin for SetupReport
impl UnwindSafe for SetupReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more