nikivdev/code · error

Review todo '{}' not found among open items

Error message

Review todo '{}' not found among open items

What it means

fix_review_todos filters OPEN review todos by id (exact or prefix). When the provided id matches no open item, it bails with 'not found among open items' (src/reviews_todo.rs:187). Unlike done_review_todo, matching is restricted to items whose status is not completed.

Source

Thrown at src/reviews_todo.rs:187

    let open_items: Vec<_> = items
        .iter()
        .filter(|item| item.status != "completed")
        .collect();

    if open_items.is_empty() {
        println!("No open review todos to fix.");
        return Ok(());
    }

    let to_fix: Vec<_> = if let Some(id) = id {
        let mut matched = Vec::new();
        for item in &open_items {
            if item.id == id || item.id.starts_with(id) {
                matched.push(*item);
            }
        }
        if matched.is_empty() {
            bail!("Review todo '{}' not found among open items", id);
        }
        if matched.len() > 1 {
            bail!("Review todo id '{}' is ambiguous", id);
        }
        matched
    } else if all {
        open_items
    } else {
        bail!("Specify a todo id or use --all to fix all open review todos");
    };

    for item in &to_fix {
        fix_single_todo(&root, item)?;
    }

    Ok(())
}

View on GitHub (pinned to a747e741ae)

Solutions

  1. List open (non-completed) review todos to find valid ids
  2. Verify the todo is still open rather than already completed
  3. Use --all to fix every open todo instead of a specific id
  4. Re-run the review if ids have changed

Example fix

// before
fix_review_todos(root, Some("deadbeef"), false)  // id not among open items
// after
fix_review_todos(root, None, true)  // fix all open todos
Defensive patterns

Strategy: validation

Validate before calling

let open = open_review_todos(root)?;
if !open.iter().any(|t| t.id == id || t.id.starts_with(id)) {
    eprintln!("{id} is not an open todo"); return;
}

Try / catch

match fix_review_todos(root, Some(id), false) {
    Err(e) if e.to_string().contains("not found among open items") => eprintln!("check the todo is still open or use --all"),
    other => other?,
}

Prevention

When it happens

Trigger: Calling the fix-todos command with an id that only exists as a completed todo, or matches nothing at all, and no --all flag.

Common situations: Trying to fix a todo that was already completed; the todo list was regenerated so ids changed; typo in id; targeting todos from a different repo root.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/ecc1b9a2f886ddff. Report an issue: GitHub.