Skip to content

Garry's Opinionated OpenClaw/Hermes Agent Brain

TypeScript

large pages: company-brain refusal names its own 5 MB limit; stdin shim comment

garrytan8bd264cbca2a
diff --git a/src/cli/main.ts b/src/cli/main.ts
index ef1ae974d5..3a4fed5d1c 100755
--- a/src/cli/main.ts
+++ b/src/cli/main.ts
@@ -1180,7 +1180,7 @@ export async function applyStdinParam(
* Legacy-signature shim over interaction.ts readStdinBounded (A5): the full
* stdin content, '' for a readable-but-empty stdin, or null for anything else
* (first-byte or inactivity timeout, stream error, closed fd). No byte cap
- * here: applyStdinParam keeps its own 5MB check and message.
+ * here: applyStdinParam keeps its own page-ceiling check and message.
*/
export async function readStdinBounded(): Promise<string | null> {
const r = await readStdinPayload({ maxBytes: Infinity });
diff --git a/src/core/company-brain/inspection.ts b/src/core/company-brain/inspection.ts
index 379e60fdbc..1c148be49f 100644
--- a/src/core/company-brain/inspection.ts
+++ b/src/core/company-brain/inspection.ts
@@ -308,7 +308,7 @@ export async function inspectCompanyBrain(options: InspectCompanyBrainOptions):
finding(plan, include.length ? 'error' : 'warning', 'unsupported_file', 'Only committed Markdown is supported; this file is not selected for import.', item.path);
} else if (item.bytes === null || item.bytes > limits.maxFileBytes) {
entry.disposition = 'unsupported'; entry.reason = 'file_too_large';
- finding(plan, 'error', 'request_too_large', 'Markdown exceeds the import file limit; split it into smaller files.', item.path);
+ finding(plan, 'error', 'request_too_large', `Markdown exceeds the company-brain file limit (${limits.maxFileBytes} bytes, separate from the 24 MiB page limit); split it into smaller files.`, item.path);
} else {
try {
const bytes = await readCommittedBlob(plan.revision, item, limits);
diff --git a/src/core/company-brain/revision.ts b/src/core/company-brain/revision.ts
index 685ad98846..bc9891187e 100644
--- a/src/core/company-brain/revision.ts
+++ b/src/core/company-brain/revision.ts
@@ -168,7 +168,7 @@ export async function readCommittedBlob(revision: RevisionIdentity, entry: Commi
{ fix: inspectAgain(revision.root, 'A fresh read-only inspection rebuilds the manifest from verified committed blobs.') });
}
if (entry.bytes === null || entry.bytes > limits.maxFileBytes) {
- throw opError('request_too_large', 'Markdown exceeds the import file limit; split it into smaller files.',
+ throw opError('request_too_large', `Markdown exceeds the company-brain file limit (${limits.maxFileBytes} bytes, separate from the 24 MiB page limit); split it into smaller files.`,
`${entry.path} is larger than the ${limits.maxFileBytes}-byte file limit. Split it into smaller files and commit them, or exclude it, then inspect again.`,
{ fix: inspectAgain(revision.root, 'Previews the plan without the oversized file; inspection is read-only.', [`--exclude=${entry.path}`]) });
}