BigPizzaV3/CodexPlusPlus · error · anyhow::Error

Remote Control recovery requires profile and provider…

Error message

Remote Control recovery requires profile and provider provenance

What it means

validate_request also requires that a pending Remote Control recovery record carry provenance: both profile_id and target_provider must be non-empty. Without them the recovery cannot determine which relay profile to restore.

Solutions

  1. Populate profile_id and target_provider from the active relay profile before enqueueing
  2. Fail fast at the caller when the active profile is unknown instead of queueing recovery
  3. Migrate old persisted records to include provenance fields

Example fix

// before
let req = PendingRemoteControlRecovery { thread_id, profile_id: "".into(), target_provider: "".into(), .. };
// after
let req = PendingRemoteControlRecovery { thread_id, profile_id: active_profile.id.clone(), target_provider: active_profile.name.clone(), .. };
Defensive patterns

Strategy: validation

Validate before calling

fn has_provenance(r: &PendingRemoteControlRecovery) -> bool {
    !r.profile_id.trim().is_empty() && !r.target_provider.trim().is_empty()
}

Try / catch

match enqueue_pending_remote_control_recovery(&req) {
    Err(e) if e.to_string().contains("provenance") => {
        eprintln!("recovery dropped: missing profile/provider");
        Ok(())
    }
    other => other,
}

Prevention

When it happens

Trigger: Calling enqueue_pending_remote_control_recovery with profile_id or target_provider being empty or whitespace-only.

Common situations: Recovery was queued before the active profile was resolved; a legacy record format lacked these fields; caller passed defaults instead of the actual active provider.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BigPizzaV3/CodexPlusPlus@b1ed92e5e4 (2026-09-19). Data as JSON: /api/errors/8e5c620aa8ce897e. Report an issue: GitHub.

Appendix: source

Thrown at crates/codex-plus-core/src/remote_control_recovery.rs:153

}

fn save_state(path: &Path, state: &PendingRemoteControlRecoveryState) -> anyhow::Result<()> {
    if state.requests.is_empty() {
        match std::fs::remove_file(path) {
            Ok(()) => return Ok(()),
            Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(()),
            Err(error) => return Err(error.into()),
        }
    }
    atomic_write(path, serde_json::to_string_pretty(state)?.as_bytes())
}

fn validate_request(request: &PendingRemoteControlRecovery) -> anyhow::Result<()> {
    if request.thread_id.trim().is_empty() || request.thread_id.len() > 128 {
        anyhow::bail!("Remote Control recovery requires a valid thread id");
    }
    if request.profile_id.trim().is_empty() || request.target_provider.trim().is_empty() {
        anyhow::bail!("Remote Control recovery requires profile and provider provenance");
    }
    Ok(())
}

#[cfg(test)]
mod tests {
    use super::*;
    use tempfile::tempdir;

    fn request(thread_id: &str) -> PendingRemoteControlRecovery {
        PendingRemoteControlRecovery {
            thread_id: thread_id.to_string(),
            profile_id: "official-mix".to_string(),
            target_provider: "custom".to_string(),
            config_generation: "generation".to_string(),
            created_at: 1,
        }
    }

View on GitHub (pinned to b1ed92e5e4)