Hmbown/CodeWhale · info · anyhow::Error

Push is never automatic; re-run with --dry-run to preview, t

Error message

Push is never automatic; re-run with --dry-run to preview, then confirm explicitly

What it means

`codewhale account push` refuses to run without --dry-run by design: pushing local settings to the account is never automatic and always requires an explicit confirmation step that does not exist yet. The bail fires after client.me() succeeds, so it also proves sign-in works; it is a policy guard, not a failure.

Source

Thrown at crates/cli/src/cloud.rs:712

            writeln!(out, "Account settings (pull --dry-run):")?;
            writeln!(out, "Account ID: {}", printable(&user.id))?;
            writeln!(out, "Profile: {}", printable(profile))?;
            writeln!(out, "API: {api_base}")?;
            writeln!(
                out,
                "dry-run: remote settings import is not available; local config unchanged"
            )?;
            // Show the invariant: Bearer custody stays in the OS keyring, never in config.toml.
            writeln!(
                out,
                "Secure custody: Bearer tokens remain in the OS keyring"
            )?;
            Ok(())
        }
        CloudCommand::Push(args) => {
            let user = client.me()?;
            if !args.dry_run {
                bail!(
                    "Push is never automatic; re-run with --dry-run to preview, then confirm explicitly"
                );
            }
            writeln!(out, "Account settings (push --dry-run):")?;
            writeln!(out, "Account ID: {}", printable(&user.id))?;
            writeln!(out, "Profile: {}", printable(profile))?;
            writeln!(out, "API: {api_base}")?;
            writeln!(
                out,
                "dry-run: would PATCH /api/me/preferences with If-Match revision check (412 on conflict)"
            )?;
            writeln!(
                out,
                "No credentials, paths, or env are copied; only explicit fields (field-level last-writer-wins)"
            )?;
            Ok(())
        }
    }

View on GitHub (pinned to 0c42157ee5)

Solutions

  1. Run `codewhale account push --dry-run` to preview what a future push would PATCH (/api/me/preferences with If-Match revision check).
  2. Wait for the explicit confirm flow; there is currently no way to force a real push.
  3. Remove non-dry-run push from scripts/docs since it always bails.

Example fix

# before
codewhale account push

# after
codewhale account push --dry-run
Defensive patterns

Strategy: validation

Validate before calling

let args = PushArgs { dry_run: true }; // preview-only until confirm flow exists

Prevention

When it happens

Trigger: Running `codewhale account push` expecting it to upload settings; scripting config sync via push without flags.

Common situations: Users familiar with tools that auto-sync settings assuming push applies immediately; onboarding flows that instruct `account push` before the confirm flow landed.

Related errors


AI-assisted analysis of Hmbown/CodeWhale@0c42157ee5 (2026-08-20). Data as JSON: /api/errors/d7da0f60882d820f. Report an issue: GitHub.