jdx/mise · error

description output exceeded {} bytes

Error message

description output exceeded {} bytes

What it means

Thrown by `run_with_limits` when the captured description command output exceeds `DIFF_LIMIT` bytes. Description output is stored as a bounded annotation in history, so the library rejects oversized results instead of truncating them silently or bloating the store.

Source

Thrown at src/system/history/describe_command.rs:178

        }
        if started.elapsed() >= timeout {
            // the shell and whatever it started; the reader thread ends
            // with the last writer of the pipe, so it is not waited for
            active.0.kill();
            let _ = child.kill();
            let _ = child.wait();
            bail!("took longer than {}s", timeout.as_secs());
        }
        std::thread::sleep(Duration::from_millis(100));
    };
    // a descendant that outlived the shell and kept the pipe is not the
    // shell's answer: the output is waited for a moment, not forever
    let Ok(output) = receiver.recv_timeout(output_grace) else {
        active.0.kill();
        bail!("a process it started kept its output open");
    };
    if output.len() > DIFF_LIMIT {
        bail!("description output exceeded {} bytes", DIFF_LIMIT);
    }
    if !status.success() {
        bail!("exited with {status}");
    }
    let Some(line) = first_line(&output) else {
        return Ok(None);
    };
    annotate(
        store,
        entry,
        Annotation {
            description: Some(line.clone()),
            description_source: Some(DescriptionSource::Command),
            labels: None,
            updated_at: store::now_rfc3339(),
        },
    )?;
    Ok(Some(line))

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Trim the command output: print only a summary line (e.g. `git diff --stat` instead of full diff).
  2. Pipe output through `head -c` to cap bytes before it reaches the collector.
  3. Quiet unrelated stderr (`2>/dev/null`) if warnings are inflating the output.
  4. Raise DIFF_LIMIT in the describe_command configuration only if larger outputs are genuinely required.

Example fix

// before
git diff
// after
git diff --stat | head -c 4000
Defensive patterns

Strategy: validation

Validate before calling

// out=$(my-command | head -c 4000); [ "${#out}" -le 4000 ] || echo "too large"

Try / catch

// if let Err(e) = run_with_limits(...) {
//     if e.message().starts_with("description output exceeded") {
//         // fall back to a summarizing command
//     }
// }

Prevention

When it happens

Trigger: A description command that emits more than DIFF_LIMIT bytes on stdout/stderr — e.g. dumping a full diff, recursive listing, or verbose logs — between the spawn and the DIFF_LIMIT check after `receiver.recv_timeout` returns.

Common situations: Hook scripts that print entire repository diffs, `git diff` without a stat limit, commands that echo large file contents, or verbose/debug logging accidentally enabled in a description command.

Understand the failure class

Background: "File too large" / "file size exceeds limit" errors: why libraries cap file sizes and how to fix them — this error's family across 46 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/e9fcb20c35b721f6. Report an issue: GitHub.