{"record":{"id":"e9fcb20c35b721f6","repo":"jdx/mise","slug":"description-output-exceeded-bytes","errorCode":null,"errorMessage":"description output exceeded {} bytes","messagePattern":"description output exceeded (.+?) bytes","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/history/describe_command.rs","lineNumber":179,"sourceCode":"        }\n        if started.elapsed() >= timeout {\n            // the shell and whatever it started; the reader thread ends\n            // with the last writer of the pipe, so it is not waited for\n            active.0.kill();\n            let _ = child.kill();\n            let _ = child.wait();\n            bail!(\"took longer than {}s\", timeout.as_secs());\n        }\n        std::thread::sleep(Duration::from_millis(100));\n    };\n    // a descendant that outlived the shell and kept the pipe is not the\n    // shell's answer: the output is waited for a moment, not forever\n    let Ok(output) = receiver.recv_timeout(output_grace) else {\n        active.0.kill();\n        bail!(\"a process it started kept its output open\");\n    };\n    if output.len() > DIFF_LIMIT {\n        bail!(\"description output exceeded {} bytes\", DIFF_LIMIT);\n    }\n    if !status.success() {\n        bail!(\"exited with {status}\");\n    }\n    let Some(line) = first_line(&output) else {\n        return Ok(None);\n    };\n    annotate(\n        store,\n        entry,\n        Annotation {\n            description: Some(line.clone()),\n            description_source: Some(DescriptionSource::Command),\n            labels: None,\n            updated_at: store::now_rfc3339(),\n        },\n    )?;\n    Ok(Some(line))","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/history/describe_command.rs#L161-L197","documentation":"run_with_limits caps the describe command's captured output at DIFF_LIMIT bytes. If the output exceeds this cap, mise bails with 'description output exceeded N bytes' instead of storing or processing an oversized description. The limit keeps history records and memory use bounded.","triggerScenarios":"The describe command prints more than DIFF_LIMIT bytes to stdout, e.g. dumping whole logs, full directory listings, or verbose tool output as the 'description'.","commonSituations":"Describe scripts that `cat` large files or include debug dumps; commands whose verbosity increased after an update; capturing binary output by accident.","solutions":["Trim the describe command's output (head -n, cut, jq projections) so it emits a concise one-line description","Increase DIFF_LIMIT / the configured output size cap if large output is legitimate","Redirect any diagnostic output to stderr or a file so only the intended description line reaches stdout"],"exampleFix":"# before: dumps everything\nthe-command --dump-all\n\n# after: emit a bounded summary\nthe-command --summary | head -c 2000","handlingStrategy":"validation","validationCode":"out=$(describe-command); [ ${#out} -le 8000 ] || echo \"describe output too large; trim it\" >&2","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Design describe output as one concise line","Pipe output through head/cut as a final safety bound","Send diagnostics to stderr, not stdout"],"tags":["history","output-limit","process"],"backgroundTag":"payload-too-large","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}