jdx/mise · error
invalid task action identity
Error message
invalid task action identity
What it means
validate_task_identity requires task ids to be exactly 64 ASCII lowercase hex characters (b'0'..=b'9', b'a'..=b'f') — the blake3 digest format used as cache key throughout the agent. Wrong length, uppercase hex, non-hex bytes, or an empty string all fail, in both begin_task/commit paths and prediction recording.
Source
Thrown at crates/mise-cache-core/src/agent.rs:1797
let response = match serde_json::from_str(&line) {
Ok(request) => self.respond(request).await,
Err(error) => AgentResponse::Error {
message: format!("invalid agent request: {error}"),
},
};
send_response(&mut writer, &response).await?;
}
Ok(())
}
}
fn validate_task_identity(task: &str) -> Result<()> {
if task.len() != 64
|| !task
.bytes()
.all(|byte| byte.is_ascii_digit() || (b'a'..=b'f').contains(&byte))
{
bail!("invalid task action identity");
}
Ok(())
}
fn validate_action_prediction(prediction: &ActionPrediction) -> Result<()> {
prediction.invocation.validate()?;
prediction.action.validate()?;
if prediction.adapter.is_empty()
|| !prediction
.adapter
.bytes()
.all(|byte| byte.is_ascii_alphanumeric() || matches!(byte, b'-' | b'_'))
{
bail!("invalid action prediction adapter");
}
if prediction.payload.len() > MAX_ACTION_PREDICTION_PAYLOAD {
bail!("action prediction payload is too large");
}View on GitHub (pinned to 6f52dcdf99)
Solutions
- Compute task ids as 64-char lowercase hex digests (e.g. blake3 of the task identity)
- Lowercase the id before sending: id.to_ascii_lowercase()
- Do not pass the run token from begin_task where a task identity is expected — they are different values
Example fix
// before let task = "my-task-name"; // after let task = CacheDigest::blake3(task_identity_bytes).hash; // 64 lowercase hex chars
Defensive patterns
Strategy: validation
Validate before calling
let task = task.trim().to_ascii_lowercase(); assert!(is_task_identity(&task), "task id must be 64 lowercase hex chars"); let run = agent.begin_task(&task).await?;
Type guard
fn is_task_identity(task: &str) -> bool {
task.len() == 64
&& task.bytes().all(|b| b.is_ascii_digit() || (b'a'..=b'f').contains(&b))
} Prevention
- Derive task ids from a 256-bit hash and hex-encode lowercase (blake3 preferred, matches the agent)
- Keep task identity and the begin_task run token as distinct, non-interchangeable values
- Add the 64-lowercase-hex assertion at client boundaries to fail fast
When it happens
Trigger: Passing a human-readable task name, a 40-char sha1, a 64-char UPPERCASE digest, a digest with 'g'-'z' characters, or confusing the begin_task run token with the task identity.
Common situations: Clients deriving ids with a different hash (sha1/sha256 hex uppercase); feeding filenames or task labels where the digest belongs; manual testing with placeholder strings.
Understand the failure class
Background: "invalid id" errors: invalid identifier format — why libraries reject IDs before lookup, and how to fix them — this error's family across 37 libraries.
Related errors
- invalid action prediction adapter
- remote rustc action metadata is invalid
- remote action output directory is invalid
- Unknown checksum algorithm: {}
- trimPrefix requires exactly 2 arguments
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/dee12591db5361b9.
Report an issue: GitHub.