Reconcile Pi prerequisites with the integrated runtime while holding admission

This commit is contained in:
Dotta committed 2026-10-08 15:01:33 -05:00
1 parent 20ce062701
commit f620e7157b
313 files changed
+13086 -2187

No files matched your search

@@ -161,6 +161,17 @@ describe("issue validators", () => {
expect(parsed.comment).toBe("Done\n\n- Verified the route");
});
it("preserves literal escapes in multiline issue descriptions and comments", () => {
const content = `${"0123456789abcdef".repeat(2)}\n`;
const description = ["Write the exact JSON content.", "```json", JSON.stringify({ content }), "```"].join("\n");
expect(createIssueSchema.parse({ title: "Native memory", description }).description).toBe(description);
expect(updateIssueSchema.parse({ description, comment: description }).description).toBe(description);
expect(updateIssueSchema.parse({ comment: description }).comment).toBe(description);
const storedJson = createIssueSchema.parse({ title: "Native memory", description }).description!.split("\n")[2]!;
expect(JSON.parse(storedJson).content).toBe(content);
expect(Buffer.byteLength(JSON.parse(storedJson).content, "utf8")).toBe(33);
});
it("validates structured unblock descriptors", () => {
expect(
updateIssueSchema.parse({
+4
View File
@@ -1,6 +1,10 @@
import { z } from "zod";
export function normalizeEscapedLineBreaks(value: string): string {
// Recover legacy single-line payloads that encoded their own line breaks.
// A real multiline body already has decoded transport newlines; decoding
// it again corrupts literal escapes in JSON, code, paths and agent prompts.
if (/[\r\n]/.test(value)) return value;
return value
.replace(/\\r\\n/g, "\n")
.replace(/\\n/g, "\n")