{"record":{"id":"e61b704eeda3f1ee","repo":"warpdotdev/warp","slug":"failed-to-resolve-artifact-upload-association-no","errorCode":null,"errorMessage":"Failed to resolve artifact upload association: no usable --run-id or --conversation-id was provided, and {OZ_RUN_ID_ENV_VAR}: {env_err}","messagePattern":"Failed to resolve artifact upload association: no usable --run-id or --conversation-id was provided, and (.+?): (.+?)","errorType":"exception","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"app/src/ai/agent_sdk/artifact_upload.rs","lineNumber":373,"sourceCode":"                        return Ok(ResolvedUploadAssociation {\n                            conversation_id: Some(conversation_id),\n                            run_id: None,\n                            ambient_task_id,\n                        });\n                    }\n                    Err(env_err) => env_err,\n                };\n\n                return Err(anyhow!(\n                    \"Failed to resolve artifact upload association for conversation '{}': {conversation_err}; also failed to use {OZ_RUN_ID_ENV_VAR}: {env_err}\",\n                    conversation_id.as_str()\n                ));\n            }\n        }\n    }\n\n    let ambient_task_id = resolve_env_run_id(env_run_id).map_err(|env_err| {\n        anyhow!(\n            \"Failed to resolve artifact upload association: no usable --run-id or --conversation-id was provided, and {OZ_RUN_ID_ENV_VAR}: {env_err}\"\n        )\n    })?;\n\n    Ok(ResolvedUploadAssociation {\n        conversation_id: None,\n        run_id: Some(ambient_task_id),\n        ambient_task_id,\n    })\n}\n\n#[cfg(test)]\n#[path = \"artifact_upload_tests.rs\"]\nmod tests;\n","sourceCodeStart":355,"sourceCodeEnd":388,"githubUrl":"https://github.com/warpdotdev/warp/blob/e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc/app/src/ai/agent_sdk/artifact_upload.rs#L355-L388","documentation":"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}`.","triggerScenarios":"Running `warp artifacts upload <file>` outside an Oz runner context — OZ_RUN_ID not exported — without passing --run-id or --conversation-id.","commonSituations":"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.","solutions":["Pass `--run-id <ambient task id>` with the upload","Or export OZ_RUN_ID=<task id> in the environment before uploading","If you expect to be inside a runner, verify the runner actually injected OZ_RUN_ID (echo it)"],"exampleFix":"# before\nwarp artifacts upload results.log\n# after\nwarp artifacts upload --run-id <ambient-task-id> results.log","handlingStrategy":"validation","validationCode":"use std::env::var_os;\n\nfn has_upload_association(run_id: Option<&str>, conv_id: Option<&str>) -> bool {\n    run_id.is_some()\n        || conv_id.is_some()\n        || var_os(\"OZ_RUN_ID\").is_some_and(|v| v.to_str().is_some())\n}\n// Refuse to stage artifacts for upload when false.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass --run-id in upload scripts","Verify the runner injects OZ_RUN_ID before relying on it","Fail fast before staging large artifacts for upload"],"tags":["artifact-upload","env-var","arguments","cli"],"backgroundTag":null,"analyzedSha":"e72fd7aacbbb2236d9b3be2aad7e7178fe94b4bc","analyzedAt":"2026-08-16T08:27:25.381Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}