warpdotdev/warp · error · anyhow::Error
{error_prefix} '{run_id}': {err}
Error message
{error_prefix} '{run_id}': {err} What it means
`parse_ambient_task_id` runs `run_id.parse::<AmbientAgentTaskId>()` and on failure wraps the parser's own error with a caller-supplied prefix (e.g. 'Invalid run ID', 'Invalid OZ_RUN_ID'). The string is not shaped like an ambient agent task id; the appended `{err}` names the exact format violation.
Source
Thrown at app/src/ai/agent_sdk/common.rs:83
} else {
let suggestions = valid_ids
.iter()
.map(|id| id.to_string())
.collect::<Vec<_>>()
.join(", ");
Err(anyhow::anyhow!(
"Unknown model id '{model_id}'. Try one of: {suggestions}"
))
}
}
pub(super) fn parse_ambient_task_id(
run_id: &str,
error_prefix: &str,
) -> anyhow::Result<AmbientAgentTaskId> {
run_id
.parse()
.map_err(|err| anyhow::anyhow!("{error_prefix} '{run_id}': {err}"))
}
pub(super) fn set_ambient_task_context_from_run_id(
ctx: &AppContext,
run_id: &str,
) -> anyhow::Result<AmbientAgentTaskId> {
let task_id = parse_ambient_task_id(run_id, "Invalid run ID")?;
ServerApiProvider::handle(ctx)
.as_ref(ctx)
.get()
.set_ambient_agent_task_id(Some(task_id));
Ok(task_id)
}
/// Resolve the owner of a new cloud object. This resolution is based on the CLI `--team` and `--personal` flags.
///
/// If `team_flag` is true, attempts to get the current team UID (errors if not on a team).
/// If `user_flag` is true, gets the current user's UID.View on GitHub (pinned to e72fd7aacb)
Solutions
- Re-copy the full run id from the output that produced it (e.g. the task list)
- Confirm you are using a run/task id, not a conversation id or API key uid
- Trim whitespace and newlines before passing the value
- Read the appended parser error — it states the exact format problem
Example fix
# before RUN_ID=$(cat id.txt) # id.txt has a trailing newline # after RUN_ID=$(tr -d '[:space:]' < id.txt)
Defensive patterns
Strategy: type-guard
Validate before calling
fn parse_run_id_checked(s: &str) -> anyhow::Result<AmbientAgentTaskId> {
s.trim().parse().map_err(|err| anyhow!("Invalid run ID '{s}': {err}"))
} Type guard
fn is_valid_run_id(s: &str) -> bool {
s.trim() == s && s.parse::<AmbientAgentTaskId>().is_ok()
} Try / catch
match run_id.parse::<AmbientAgentTaskId>() {
Ok(task_id) => Ok(task_id),
Err(err) => Err(anyhow!("{error_prefix} '{run_id}': {err}")), // surface the parser's exact reason
} Prevention
- Trim ids before use
- Parse-validate ids at input boundaries
- Never substitute other-id types (conversation, api key) for run ids
When it happens
Trigger: Passing a --run-id (or OZ_RUN_ID, or a run id from another source) whose string does not match the AmbientAgentTaskId format — truncated copy, a different kind of id (conversation id, api key uid), or stray whitespace/newlines.
Common situations: Copy-paste truncation; using a conversation id where a run/task id is expected; extra quotes or newlines in env vars; ids taken from a different product surface.
Related errors
- Invalid repo format: '{}'. Expected 'owner/repo' or 'https:/
- createSemanticTokens: mode "${modeName}" not found in modeId
- Expected JSON object with 'reviews' key
- SKILL.md missing frontmatter (no opening ---)
- SKILL.md missing frontmatter (no closing ---)
AI-assisted analysis of warpdotdev/warp@e72fd7aacb (2026-08-16).
Data as JSON: /api/errors/901911a65c605348.
Report an issue: GitHub.