Open-source Grok Bot alternative with a virtual machine that bots can use
TypeScript ai-agentsclaude-codecodexcomputer-usedockerelectrongrokgrok-botgrok-bot-alternativeself-hostedtypescript
Drop issue numbers from comments (comment-history guard)
Bugfixer 2f64d331e169e
diff --git a/src/components/MarkdownFilePreview.dom.test.ts b/src/components/MarkdownFilePreview.dom.test.tsindex 63e3f835ec..8b03a04be6 100644--- a/src/components/MarkdownFilePreview.dom.test.ts+++ b/src/components/MarkdownFilePreview.dom.test.ts@@ -21,7 +21,7 @@ async function open(answer: () => Promise<Response>) {}const alertText = () => host.querySelector("[role=alert]")?.textContent ?? "";-describe("Markdown file preview errors and encodings (#5618)", () => {+describe("Markdown file preview errors and encodings", () => {it("opens a file saved as Windows-1252 instead of failing", async () => {// "# Relatório\n\nAção concluída" in Windows-1252: ó=F3, ç=E7, ã=E3, í=ED.const bytes = new Uint8Array([0x23, 0x20, 0x52, 0x65, 0x6c, 0x61, 0x74, 0xf3, 0x72, 0x69, 0x6f, 0x0a, 0x0a, 0x41, 0xe7, 0xe3, 0x6f, 0x20, 0x63, 0x6f, 0x6e, 0x63, 0x6c, 0x75, 0xed, 0x64, 0x61]);diff --git a/src/components/MarkdownFilePreview.tsx b/src/components/MarkdownFilePreview.tsxindex 1daac89738..fe066960e5 100644--- a/src/components/MarkdownFilePreview.tsx+++ b/src/components/MarkdownFilePreview.tsx@@ -24,12 +24,12 @@ export default function MarkdownFileContent({ path, name, message }: { path: strtry {const response = await requestMessageFile(path, message, controller.signal);answered = true;- // Notes saved by Windows apps are often Windows-1252, not UTF-8 (#5618).+ // Notes saved by Windows apps are often Windows-1252, not UTF-8.const text = await readTableResponse(response, controller.signal, MARKDOWN_PREVIEW_MAX_BYTES, "windows-1252");if (!controller.signal.aborted) setSource(text);} catch (reason) {if (controller.signal.aborted) return;- // A refusal from the server says why (#5618); only a request that got no answer (TypeError) is the connection.+ // A refusal from the server says why; only a request that got no answer (TypeError) is the connection.if (!answered && reason instanceof Error && !(reason instanceof TypeError)) setError({ reason: reason.message });else setError(reason instanceof Error && reason.message === "size" ? "size" : "load");}diff --git a/src/components/TableFilePreview.tsx b/src/components/TableFilePreview.tsxindex bf74ea01cf..e2f7586d04 100644--- a/src/components/TableFilePreview.tsx+++ b/src/components/TableFilePreview.tsx@@ -6,7 +6,7 @@ import { TABLE_FILE_MAX_BYTES, tableDelimiter, type TextTable } from "@/lib/tablimport { t } from "@/lib/i18n";/** A preview limit, not a download limit: chunked responses are bounded too. Text that is not UTF-8 is refused, unless- * `fallback` names a single-byte encoding to read it in instead (#5618); a NUL byte (UTF-16, binary) is refused even+ * `fallback` names a single-byte encoding to read it in instead; a NUL byte (UTF-16, binary) is refused even* then, since such an encoding would only show it as garbage. */export async function readTableResponse(response: Response, signal: AbortSignal, maxBytes = TABLE_FILE_MAX_BYTES, fallback?: string): Promise<string> {if (Number(response.headers.get("content-length")) > maxBytes) {