warpdotdev/warp · error · anyhow::Error

Failed to resolve artifact upload association: no usable --r

Error message

Failed to resolve artifact upload association: no usable --run-id or --conversation-id was provided, and {OZ_RUN_ID_ENV_VAR}: {env_err}

What it means

Artifact upload association needs an explicit `--run-id`, a `--conversation-id`, or a usable OZ_RUN_ID (injected by the Oz runner). With none supplied, `resolve_env_run_id` fails ('not set' or invalid) and this error surfaces the env cause as `{env_err}`.

Source

Thrown at app/src/ai/agent_sdk/artifact_upload.rs:373

                        return Ok(ResolvedUploadAssociation {
                            conversation_id: Some(conversation_id),
                            run_id: None,
                            ambient_task_id,
                        });
                    }
                    Err(env_err) => env_err,
                };

                return Err(anyhow!(
                    "Failed to resolve artifact upload association for conversation '{}': {conversation_err}; also failed to use {OZ_RUN_ID_ENV_VAR}: {env_err}",
                    conversation_id.as_str()
                ));
            }
        }
    }

    let ambient_task_id = resolve_env_run_id(env_run_id).map_err(|env_err| {
        anyhow!(
            "Failed to resolve artifact upload association: no usable --run-id or --conversation-id was provided, and {OZ_RUN_ID_ENV_VAR}: {env_err}"
        )
    })?;

    Ok(ResolvedUploadAssociation {
        conversation_id: None,
        run_id: Some(ambient_task_id),
        ambient_task_id,
    })
}

#[cfg(test)]
#[path = "artifact_upload_tests.rs"]
mod tests;

View on GitHub (pinned to e72fd7aacb)

Solutions

  1. Pass `--run-id <ambient task id>` with the upload
  2. Or export OZ_RUN_ID=<task id> in the environment before uploading
  3. If you expect to be inside a runner, verify the runner actually injected OZ_RUN_ID (echo it)

Example fix

# before
warp artifacts upload results.log
# after
warp artifacts upload --run-id <ambient-task-id> results.log
Defensive patterns

Strategy: validation

Validate before calling

use std::env::var_os;

fn has_upload_association(run_id: Option<&str>, conv_id: Option<&str>) -> bool {
    run_id.is_some()
        || conv_id.is_some()
        || var_os("OZ_RUN_ID").is_some_and(|v| v.to_str().is_some())
}
// Refuse to stage artifacts for upload when false.

Prevention

When it happens

Trigger: Running `warp artifacts upload <file>` outside an Oz runner context — OZ_RUN_ID not exported — without passing --run-id or --conversation-id.

Common situations: Local manual uploads; CI containers that don't inherit runner env; scripts assuming the runner sets the variable; running the CLI from a different shell than the agent.

Related errors


AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16). Data as JSON: /api/errors/e61b704eeda3f1ee. Report an issue: GitHub.