can1357/oh-my-pi · error · Error
Summary exceeds ${config.summaryHardLimit} bytes
Error message
Summary exceeds ${config.summaryHardLimit} bytes What it means
postProcessCommitMessage enforces a hard byte limit on the commit summary (first line) after lowercasing, verb normalization, and punctuation trimming. If the summary still exceeds config.summaryHardLimit bytes, it throws instead of emitting an over-long commit subject (raised in postProcessCommitMessage, called by generateConventionalCommit, generateFastCommit, messageFromAnalysis, validateAndProcess).
Source
Thrown at packages/coding-agent/src/commit/conventional/normalization.ts:217
return joinFirstRest(`${past}${suffix}`, rest);
}
/** Normalize summary, body, and footers before final validation. */
export function postProcessCommitMessage(
message: ConventionalCommit,
config: ConventionalGenerationConfig,
): ConventionalCommit {
let summary = normalizeCommitUnicode(message.summary);
summary = summary.replaceAll("\r", " ").replaceAll("\n", " ").split(/\s+/).filter(Boolean).join(" ");
summary = summary
.trim()
.replace(/[.;:]+$/g, "")
.trim();
summary = lowercaseFirstToken(summary);
summary = normalizeSummaryVerb(summary, message.type);
summary = lowercaseFirstToken(summary.trim()).replace(/\.+$/g, "").trim();
if (Buffer.byteLength(summary) > config.summaryHardLimit) {
throw new Error(`Summary exceeds ${config.summaryHardLimit} bytes`);
}
const body: string[] = [];
for (const raw of message.body) {
let detail = normalizeCommitUnicode(raw).replaceAll("\r", " ").replaceAll("\n", " ");
detail = detail
.trim()
.replace(/^[•\-*+]+/, "")
.trim()
.split(/\s+/)
.filter(Boolean)
.join(" ");
detail = detail.replace(/[.;,]+$/g, "").trim();
if (!detail) continue;
const first = firstCodePoint(detail);
if (first && first === first.toLowerCase() && first !== first.toUpperCase()) {
detail = first.toUpperCase() + detail.slice(first.length);
}View on GitHub (pinned to 9690622007)
Solutions
- Truncate or rewrite the summary before calling post-processing (e.g. cut at word boundary under the limit)
- Regenerate with prompt instruction to keep the subject short
- Raise config.summaryHardLimit if your project allows longer subjects
- Beware multibyte text: measure with Buffer.byteLength and trim to the byte budget
Example fix
// before
const message = await postProcessCommitMessage(raw, config);
// after: pre-trim the summary
const limit = config.summaryHardLimit;
let summary = raw.summary;
while (Buffer.byteLength(summary) > limit) summary = summary.slice(0, summary.lastIndexOf(" ")).trim();
const message = await postProcessCommitMessage({ ...raw, summary }, config); Defensive patterns
Strategy: validation
Validate before calling
if (Buffer.byteLength(summary) > config.summaryHardLimit) {
summary = summary.slice(0, config.summaryHardLimit).trim();
} Try / catch
try {
message = postProcessCommitMessage(raw, config);
} catch (err) {
if (err instanceof Error && err.message.includes("Summary exceeds")) {
// regenerate with a brevity instruction or truncate the subject
}
throw err;
} Prevention
- Instruct the model to keep subjects under ~72 characters
- Account for UTF-8 multibyte expansion when measuring length
- Pre-truncate long subjects at word boundaries before post-processing
When it happens
Trigger: Calling any commit-message generation/validation entry point with a message whose normalized summary exceeds summaryHardLimit bytes — typically very long model-generated subjects, CJK/multibyte text (byte-length counts UTF-8 bytes, not characters), or a config with an unusually small hard limit.
Common situations: Models ignoring subject-length instructions, multibyte characters pushing byte counts over the limit while looking short, overly verbose generated summaries after scope prefixing, or tightened summaryHardLimit config.
Related errors
- ${name} exceeds the ${SHARPSHOOTER_MAX_FILE_LINES}-line limi
- xAI image edits accept up to ${XAI_MAX_EDIT_IMAGES} referenc
- Archive ${field} exceeds ${maxPathBytes} bytes
- Archive is too large to read safely
- ZIP member path '${name}' is too long to write
AI-assisted analysis of can1357/oh-my-pi@9690622007 (2026-08-31).
Data as JSON: /api/errors/7c4aab8f2c5c6a6d.
Report an issue: GitHub.