nikivdev/code · error

Commit queue is empty. Run `f pr "message"` or queue a commi

Error message

Commit queue is empty. Run `f pr "message"` or queue a commit first with `f commit --queue`.

What it means

When no explicit `--hash` is supplied, the command refreshes and loads the commit queue and takes the most recent entry to operate on. If the queue is empty (`entries.pop()` returns None) there is nothing to act on, so it bails with guidance on how to populate the queue (`f pr "message"` or `f commit --queue`).

Source

Thrown at src/commit.rs:9598

            false,
            review_selection,
            message.as_deref(),
            1000,
            false,
            queue,
            false,
            &opts.paths,
            CommitGateOverrides::default(),
        )?;
    }

    let hash = if let Some(hash) = opts.hash {
        hash
    } else {
        let _ = refresh_commit_queue(&repo_root);
        let mut entries = load_commit_queue_entries(&repo_root)?;
        let Some(entry) = entries.pop() else {
            bail!(
                "Commit queue is empty. Run `f pr \"message\"` or queue a commit first with `f commit --queue`."
            );
        };
        entry.commit_sha
    };

    run_commit_queue(CommitQueueCommand {
        action: Some(CommitQueueAction::PrCreate {
            hash,
            base: opts.base,
            draft: opts.draft,
            open: !opts.no_open,
        }),
    })
}

fn run_pr_open(repo_root: &Path, opts: &PrOpts) -> Result<()> {
    ensure_gh_available()?;

View on GitHub (pinned to a747e741ae)

Solutions

  1. Queue a commit first: `f commit --queue` or `f pr "message"`.
  2. Pass an explicit `--hash <sha>` to bypass the queue.
  3. Check the queue contents (queue file/`f commit` list) to confirm it is empty and why.
  4. Verify you are in the intended repository root.

Example fix

// before
f pr push          # queue empty
// after
f commit --queue
f pr push          # or: f pr push --hash <sha>
Defensive patterns

Strategy: validation

Validate before calling

let q = load_commit_queue_entries(&repo_root)?;
if q.is_empty() {
    eprintln!("Queue empty: run `f commit --queue` or pass --hash <sha>");
    std::process::exit(1);
}

Try / catch

if let Err(e) = run() {
    if e.to_string().contains("Commit queue is empty") { queue_first_then_retry(); }
    else { return Err(e.into()); }
}

Prevention

When it happens

Trigger: Running the push/approve command with no `--hash` before any commit has been queued; queue was cleared/consumed by an earlier run; `refresh_commit_queue` pruned stale entries; wrong repo root so the queue file isn't found.

Common situations: Fresh clone or new machine where the queue file never existed; running the command twice (first run popped the entry); forgetting to run `f commit --queue` first.

Related errors


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