Personal Telegram developer console for GitHub
feat: expand bounded workspace editor limits
davoodmehraban89 committed
Oct 4, 2026 at 11:12 UTC
8f6d242e208cb743f811cb766d69707af82b0bdc
1 file changed
+9
-4
src/core/workspace-policy.js
+9
-4
@@ -1,8 +1,13 @@
1
-const MAX_CHARS = 3000;
2
-const MAX_BYTES = 12000;
1
+const MAX_CHARS = 20000;
2
+const MAX_BYTES = 65536;
3
const MAX_COMMIT_MESSAGE = 120;
4
const SAFE_HANDLE = /^[A-Za-z0-9_-]{10}$/;
5
6
+export const WORKSPACE_EDITOR_LIMITS = Object.freeze({
7
+ maxChars: MAX_CHARS,
8
+ maxBytes: MAX_BYTES
9
+});
10
+
11
const encoder = new TextEncoder();
12
13
const sensitivePath = value => {
@@ -31,8 +36,8 @@ export function validateEditableFile({ path, text, byteLength } = {}) {
36
if (sensitivePath(path)) reason = 'Sensitive file path is not editable.';
37
else if (source.includes('\0')) reason = 'Binary-like content is not editable.';
38
else if (/^version https:\/\/git-lfs\.github\.com\/spec\/v1(?:\r?\n|$)/.test(source)) reason = 'Git LFS pointer files are not editable.';
34
- else if (charLength > MAX_CHARS) reason = 'Editable text is limited to 3,000 Unicode characters.';
35
- else if (effectiveBytes > MAX_BYTES) reason = 'Editable text is limited to 12,000 UTF-8 bytes.';
39
+ else if (charLength > MAX_CHARS) reason = 'Editable text is limited to 20,000 Unicode characters.';
40
+ else if (effectiveBytes > MAX_BYTES) reason = 'Editable text is limited to 65,536 UTF-8 bytes.';
41
42
return {
43
editable: reason === '',