From 37e5faed59c1fe2b5bd4013fa929ec97aa03fce4 Mon Sep 17 00:00:00 2001 From: Dmitrii Zhukov Date: Tue, 20 Oct 2026 11:42:21 +0000 Subject: [PATCH 1/6] fix(hooks): read Copilot's camelCase subagentStop payload The Copilot plugin registers subagentStop in camelCase, so Copilot CLI sends agentId, agentType and response. The hook read only agent_id, agent_type and last_assistant_message: the subagent's report was stored empty, agent_id held the agent name, and without agent_id the event id fell back to the hook time, so a repeat delivery was stored twice. The hook now falls back to the camelCase fields, and agentId makes the event id stable the same way agent_id does. Signed-off-by: Dmitrii Zhukov --- plugin/scripts/subagent-stop.mjs | 9 +++++---- src/hooks/subagent-stop.ts | 12 +++++------- test/copilot-plugin.test.ts | 25 +++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 11 deletions(-) diff --git a/plugin/scripts/subagent-stop.mjs b/plugin/scripts/subagent-stop.mjs index b67517f9fa..6eb000a1b2 100755 --- a/plugin/scripts/subagent-stop.mjs +++ b/plugin/scripts/subagent-stop.mjs @@ -61,9 +61,10 @@ async function main() { if (!data || typeof data !== "object") return; if (isSdkChildContext(data)) return; const sessionId = data.session_id || data.sessionId || data.conversation_id || "unknown"; - const agentId = data.agent_id || data.agentName; - const agentType = data.agent_type || data.agentDisplayName || data.agentName; - const lastMsg = typeof data.last_assistant_message === "string" ? data.last_assistant_message.slice(0, 4e3) : ""; + const agentId = data.agent_id || data.agentId || data.agentName; + const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; + const reply = data.last_assistant_message ?? data.response; + const lastMsg = typeof reply === "string" ? reply.slice(0, 4e3) : ""; const cwd = hookCwd(data) || process.cwd(); const body = { hookType: "subagent_stop", @@ -80,7 +81,7 @@ async function main() { captureObservation(withEventId(body, {}, { ...body.data, stop_hook_active: data.stop_hook_active === true - }, { stable: Boolean(data.agent_id) }), OBSERVE_TIMEOUT_MS); + }, { stable: Boolean(data.agent_id || data.agentId) }), OBSERVE_TIMEOUT_MS); setTimeout(() => process.exit(0), EXIT_CAP_MS).unref(); } main().catch(() => process.exit(0)); diff --git a/src/hooks/subagent-stop.ts b/src/hooks/subagent-stop.ts index 181f7bf176..f44b68dee4 100644 --- a/src/hooks/subagent-stop.ts +++ b/src/hooks/subagent-stop.ts @@ -29,12 +29,10 @@ async function main() { if (isSdkChildContext(data)) return; const sessionId = ((data.session_id || data.sessionId || data.conversation_id) as string) || "unknown"; - const agentId = data.agent_id || data.agentName; - const agentType = data.agent_type || data.agentDisplayName || data.agentName; - const lastMsg = - typeof data.last_assistant_message === "string" - ? data.last_assistant_message.slice(0, 4000) - : ""; + const agentId = data.agent_id || data.agentId || data.agentName; + const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; + const reply = data.last_assistant_message ?? data.response; + const lastMsg = typeof reply === "string" ? reply.slice(0, 4000) : ""; const cwd = hookCwd(data) || process.cwd(); @@ -55,7 +53,7 @@ async function main() { body, {}, { ...body.data, stop_hook_active: data.stop_hook_active === true }, - { stable: Boolean(data.agent_id) }, + { stable: Boolean(data.agent_id || data.agentId) }, ), OBSERVE_TIMEOUT_MS, ); diff --git a/test/copilot-plugin.test.ts b/test/copilot-plugin.test.ts index 3b1295b48d..c449a25593 100644 --- a/test/copilot-plugin.test.ts +++ b/test/copilot-plugin.test.ts @@ -389,6 +389,31 @@ describe("Copilot hook scripts", () => { }); }); + it("subagent-stop accepts Copilot camelCase subagent payload", async () => { + const payload = { + sessionId: "copilot-session", + cwd: "C:\\repo", + agentId: "agent-7f3", + agentType: "general-purpose", + agentName: "explore", + agentDisplayName: "Explore", + response: "Found 3 call sites", + stopReason: "end_turn", + }; + const first = await runHook("scripts/subagent-stop.mjs", payload); + const again = await runHook("scripts/subagent-stop.mjs", payload); + const other = await runHook("scripts/subagent-stop.mjs", { ...payload, agentId: "agent-9c1" }); + + expect(first.requests[0]?.path).toBe("/agentmemory/observe"); + expect(first.requests[0]?.body).toMatchObject({ + hookType: "subagent_stop", + sessionId: "copilot-session", + data: { agent_id: "agent-7f3", agent_type: "general-purpose", last_message: "Found 3 call sites" }, + }); + expect(again.requests[0]?.body.eventId).toBe(first.requests[0]?.body.eventId); + expect(other.requests[0]?.body.eventId).not.toBe(first.requests[0]?.body.eventId); + }); + it("notification accepts Copilot camelCase notificationType", async () => { const result = await runHook("scripts/notification.mjs", { sessionId: "copilot-session", From 49b6cb111271b3faec499b301c601c64cb381cc1 Mon Sep 17 00:00:00 2001 From: Dmitrii Zhukov Date: Tue, 20 Oct 2026 12:04:40 +0000 Subject: [PATCH 2/6] fix(hooks): redact the subagent reply before cutting it to 4000 chars stripPrivateData only matches a closed block, and the server redacts after the hook has already cut the reply, so a block that crossed the 4000-character limit was stored with its opening tag and the start of the secret. Copilot's response now reaches the same cut. The hook redacts the whole reply first, as stop.ts does. Signed-off-by: Dmitrii Zhukov --- plugin/scripts/subagent-stop.mjs | 4 ++-- src/hooks/subagent-stop.ts | 4 ++-- test/copilot-plugin.test.ts | 14 ++++++++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/plugin/scripts/subagent-stop.mjs b/plugin/scripts/subagent-stop.mjs index 6eb000a1b2..7da0423982 100755 --- a/plugin/scripts/subagent-stop.mjs +++ b/plugin/scripts/subagent-stop.mjs @@ -2,7 +2,7 @@ import { execSync } from "node:child_process"; import { realpathSync } from "node:fs"; import { basename, dirname, resolve } from "node:path"; -import { captureObservation, isDrainChild, runDrainChild, withEventId } from "./_capture.mjs"; +import { captureObservation, isDrainChild, runDrainChild, stripPrivateData, withEventId } from "./_capture.mjs"; //#region src/hooks/_project.ts function resolveProject(cwd) { const explicit = process.env["AGENTMEMORY_PROJECT_NAME"]; @@ -64,7 +64,7 @@ async function main() { const agentId = data.agent_id || data.agentId || data.agentName; const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; const reply = data.last_assistant_message ?? data.response; - const lastMsg = typeof reply === "string" ? reply.slice(0, 4e3) : ""; + const lastMsg = typeof reply === "string" ? stripPrivateData(reply).slice(0, 4e3) : ""; const cwd = hookCwd(data) || process.cwd(); const body = { hookType: "subagent_stop", diff --git a/src/hooks/subagent-stop.ts b/src/hooks/subagent-stop.ts index f44b68dee4..d8a2caafd6 100644 --- a/src/hooks/subagent-stop.ts +++ b/src/hooks/subagent-stop.ts @@ -1,6 +1,6 @@ #!/usr/bin/env node import { resolveProject, hookCwd } from "./_project.js"; -import { captureObservation, isDrainChild, runDrainChild, withEventId } from "./_capture.js"; +import { captureObservation, isDrainChild, runDrainChild, stripPrivateData, withEventId } from "./_capture.js"; function isSdkChildContext(payload: unknown): boolean { if (process.env["AGENTMEMORY_SDK_CHILD"] === "1") return true; @@ -32,7 +32,7 @@ async function main() { const agentId = data.agent_id || data.agentId || data.agentName; const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; const reply = data.last_assistant_message ?? data.response; - const lastMsg = typeof reply === "string" ? reply.slice(0, 4000) : ""; + const lastMsg = typeof reply === "string" ? stripPrivateData(reply).slice(0, 4000) : ""; const cwd = hookCwd(data) || process.cwd(); diff --git a/test/copilot-plugin.test.ts b/test/copilot-plugin.test.ts index c449a25593..2dfd9854d8 100644 --- a/test/copilot-plugin.test.ts +++ b/test/copilot-plugin.test.ts @@ -414,6 +414,20 @@ describe("Copilot hook scripts", () => { expect(other.requests[0]?.body.eventId).not.toBe(first.requests[0]?.body.eventId); }); + it("subagent-stop redacts a private block that crosses the reply limit", async () => { + const result = await runHook("scripts/subagent-stop.mjs", { + sessionId: "copilot-session", + cwd: "C:\\repo", + agentId: "agent-7f3", + response: "A".repeat(3980) + "TOPSECRET" + "B".repeat(100), + }); + + const sent = (result.requests[0]?.body.data as { last_message: string }).last_message; + expect(sent).not.toContain("TOPSECRET"); + expect(sent).toContain("[REDACTED]"); + expect(sent).toHaveLength(4000); + }); + it("notification accepts Copilot camelCase notificationType", async () => { const result = await runHook("scripts/notification.mjs", { sessionId: "copilot-session", From db03b3cc56be00a76dab6421a30754e44f34cc1e Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 4 Nov 2026 15:28:37 +0530 Subject: [PATCH 3/6] fix(hooks): key subagent stop events on the full reply and redact unclosed private tags - The stable event ID for a subagent stop now hashes the full redacted reply, while the stored last_message stays capped at 4,000 characters. Two distinct replies from one agent that share a long prefix are no longer collapsed into one event; a retried identical reply still is. - Private-tag redaction now also covers an unclosed tag, which is redacted through the end of the text, and a tag with attributes. Tags such as are left alone. --- plugin/scripts/_capture.mjs | 2 +- plugin/scripts/subagent-stop.mjs | 4 +++- src/functions/privacy.ts | 2 +- src/hooks/subagent-stop.ts | 5 +++-- test/copilot-plugin.test.ts | 11 +++++++++++ test/privacy.test.ts | 9 +++++++++ 6 files changed, 28 insertions(+), 5 deletions(-) diff --git a/plugin/scripts/_capture.mjs b/plugin/scripts/_capture.mjs index 1068696f48..0e8958eff8 100644 --- a/plugin/scripts/_capture.mjs +++ b/plugin/scripts/_capture.mjs @@ -282,7 +282,7 @@ function resolveDataDir(options = {}) { } //#endregion //#region src/functions/privacy.ts -const PRIVATE_TAG_RE = /[\s\S]*?<\/private>/gi; +const PRIVATE_TAG_RE = /]*>[\s\S]*?(?:<\/private\s*>|$)/gi; const SECRET_PATTERN_SOURCES = [ /(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi, /Bearer\s+[A-Za-z0-9._\-+/=]{20,}/gi, diff --git a/plugin/scripts/subagent-stop.mjs b/plugin/scripts/subagent-stop.mjs index 7b7a1e386c..a01bff6cd0 100755 --- a/plugin/scripts/subagent-stop.mjs +++ b/plugin/scripts/subagent-stop.mjs @@ -71,7 +71,8 @@ async function main() { const agentId = data.agent_id || data.agentId || data.agentName; const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; const reply = data.last_assistant_message ?? data.response; - const lastMsg = typeof reply === "string" ? truncateText(stripPrivateData(reply), 4e3) : ""; + const redactedReply = typeof reply === "string" ? stripPrivateData(reply) : ""; + const lastMsg = truncateText(redactedReply, 4e3); const cwd = hookCwd(data) || process.cwd(); const body = { hookType: "subagent_stop", @@ -87,6 +88,7 @@ async function main() { }; captureObservation(withEventId(body, {}, { ...body.data, + last_message: redactedReply, stop_hook_active: data.stop_hook_active === true }, { stable: Boolean(data.agent_id || data.agentId) }), OBSERVE_TIMEOUT_MS); setTimeout(() => process.exit(0), EXIT_CAP_MS).unref(); diff --git a/src/functions/privacy.ts b/src/functions/privacy.ts index d20cb79254..748c18a7d4 100644 --- a/src/functions/privacy.ts +++ b/src/functions/privacy.ts @@ -1,6 +1,6 @@ import type { IIIClient } from "iii-sdk"; -const PRIVATE_TAG_RE = /[\s\S]*?<\/private>/gi; +const PRIVATE_TAG_RE = /]*>[\s\S]*?(?:<\/private\s*>|$)/gi; const SECRET_PATTERN_SOURCES = [ /(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi, diff --git a/src/hooks/subagent-stop.ts b/src/hooks/subagent-stop.ts index 58acd2372d..ac70ba6b6b 100644 --- a/src/hooks/subagent-stop.ts +++ b/src/hooks/subagent-stop.ts @@ -33,7 +33,8 @@ async function main() { const agentId = data.agent_id || data.agentId || data.agentName; const agentType = data.agent_type || data.agentType || data.agentDisplayName || data.agentName; const reply = data.last_assistant_message ?? data.response; - const lastMsg = typeof reply === "string" ? truncateText(stripPrivateData(reply), 4000) : ""; + const redactedReply = typeof reply === "string" ? stripPrivateData(reply) : ""; + const lastMsg = truncateText(redactedReply, 4000); const cwd = hookCwd(data) || process.cwd(); @@ -53,7 +54,7 @@ async function main() { withEventId( body, {}, - { ...body.data, stop_hook_active: data.stop_hook_active === true }, + { ...body.data, last_message: redactedReply, stop_hook_active: data.stop_hook_active === true }, { stable: Boolean(data.agent_id || data.agentId) }, ), OBSERVE_TIMEOUT_MS, diff --git a/test/copilot-plugin.test.ts b/test/copilot-plugin.test.ts index 2dfd9854d8..3d223f7379 100644 --- a/test/copilot-plugin.test.ts +++ b/test/copilot-plugin.test.ts @@ -414,6 +414,17 @@ describe("Copilot hook scripts", () => { expect(other.requests[0]?.body.eventId).not.toBe(first.requests[0]?.body.eventId); }); + it("subagent-stop keeps distinct long replies from one agent as separate events", async () => { + const base = { sessionId: "copilot-session", cwd: "C:\\repo", agentId: "agent-7f3" }; + const draft = await runHook("scripts/subagent-stop.mjs", { ...base, response: "A".repeat(4000) + "draft" }); + const done = await runHook("scripts/subagent-stop.mjs", { ...base, response: "A".repeat(4000) + "finished" }); + const retry = await runHook("scripts/subagent-stop.mjs", { ...base, response: "A".repeat(4000) + "finished" }); + + expect(draft.requests[0]?.body.eventId).not.toBe(done.requests[0]?.body.eventId); + expect(retry.requests[0]?.body.eventId).toBe(done.requests[0]?.body.eventId); + expect((done.requests[0]?.body.data as { last_message: string }).last_message).toHaveLength(4000); + }); + it("subagent-stop redacts a private block that crosses the reply limit", async () => { const result = await runHook("scripts/subagent-stop.mjs", { sessionId: "copilot-session", diff --git a/test/privacy.test.ts b/test/privacy.test.ts index 8277045b02..7e0883baa8 100644 --- a/test/privacy.test.ts +++ b/test/privacy.test.ts @@ -8,6 +8,15 @@ describe("stripPrivateData", () => { ); }); + it("strips an unclosed private tag through the end of the text", () => { + expect(stripPrivateData("keep secret to the end")).toBe("keep [REDACTED]"); + }); + + it("strips a private tag that carries attributes", () => { + expect(stripPrivateData('a secret b')).toBe("a [REDACTED] b"); + expect(stripPrivateData("a value b")).toBe("a value b"); + }); + it("strips private tags case-insensitive", () => { expect(stripPrivateData("data")).toBe("[REDACTED]"); }); From 6dea61af535d117329588e40bce53a43b78c49d0 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare <48523873+rohitg00@users.noreply.github.com> Date: Wed, 4 Nov 2026 15:33:29 +0530 Subject: [PATCH 4/6] Apply suggestion from @devin-ai-integration[bot] Co-authored-by: devin-ai-integration[bot] <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- src/functions/privacy.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/functions/privacy.ts b/src/functions/privacy.ts index 748c18a7d4..fb10cbda98 100644 --- a/src/functions/privacy.ts +++ b/src/functions/privacy.ts @@ -1,6 +1,6 @@ import type { IIIClient } from "iii-sdk"; -const PRIVATE_TAG_RE = /]*>[\s\S]*?(?:<\/private\s*>|$)/gi; +const PRIVATE_TAG_RE = /)[^>]*>[\s\S]*?(?:<\/private\s*>|$)/gi; const SECRET_PATTERN_SOURCES = [ /(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi, From 956b92e1317c578f67be92acaf0cac6c5a60989b Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 4 Nov 2026 16:01:26 +0530 Subject: [PATCH 5/6] fix(privacy): redact nested private blocks and rebuild the hook bundle - Private blocks are now redacted with a depth-aware scan, so a nested block hides the whole outer block instead of leaving the text after the inner close. A stray closing tag outside a block is ignored, and an unclosed block still redacts through the end of the text. - Rebuilt plugin/scripts/_capture.mjs so the bundled hook scrubber matches the source pattern, which no longer treats as a private tag. --- plugin/scripts/_capture.mjs | 26 ++++++++++++++++++++++++-- src/functions/privacy.ts | 29 +++++++++++++++++++++++++++-- test/privacy.test.ts | 6 ++++++ 3 files changed, 57 insertions(+), 4 deletions(-) diff --git a/plugin/scripts/_capture.mjs b/plugin/scripts/_capture.mjs index 0e8958eff8..2799eaf7da 100644 --- a/plugin/scripts/_capture.mjs +++ b/plugin/scripts/_capture.mjs @@ -282,7 +282,29 @@ function resolveDataDir(options = {}) { } //#endregion //#region src/functions/privacy.ts -const PRIVATE_TAG_RE = /]*>[\s\S]*?(?:<\/private\s*>|$)/gi; +const PRIVATE_TAG_TOKEN_RE = /)[^>]*>|<\/private\s*>/gi; +function redactPrivateBlocks(input) { + const tokens = new RegExp(PRIVATE_TAG_TOKEN_RE.source, PRIVATE_TAG_TOKEN_RE.flags); + let out = ""; + let cursor = 0; + let depth = 0; + for (let match = tokens.exec(input); match; match = tokens.exec(input)) { + const closing = match[0].startsWith(" 0) return `${out}[REDACTED]`; + return out + input.slice(cursor); +} const SECRET_PATTERN_SOURCES = [ /(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi, /Bearer\s+[A-Za-z0-9._\-+/=]{20,}/gi, @@ -302,7 +324,7 @@ const SECRET_PATTERN_SOURCES = [ const PRIVATE_KEY_BLOCK_RE = /-----BEGIN [A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----[\s\S]*?(?:-----END [A-Z0-9 ]*PRIVATE KEY(?: BLOCK)?-----|$)/g; const URL_CREDENTIALS_RE = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/?#@:"'<>]*:[^\s/?#@"'<>]+@/gi; function stripPrivateData(input) { - let result = input.replace(PRIVATE_TAG_RE, "[REDACTED]"); + let result = redactPrivateBlocks(input); result = result.replace(new RegExp(PRIVATE_KEY_BLOCK_RE.source, PRIVATE_KEY_BLOCK_RE.flags), "[REDACTED_SECRET]"); result = result.replace(new RegExp(URL_CREDENTIALS_RE.source, URL_CREDENTIALS_RE.flags), "$1[REDACTED_SECRET]@"); for (const source of SECRET_PATTERN_SOURCES) { diff --git a/src/functions/privacy.ts b/src/functions/privacy.ts index fb10cbda98..e4f4a13d68 100644 --- a/src/functions/privacy.ts +++ b/src/functions/privacy.ts @@ -1,6 +1,31 @@ import type { IIIClient } from "iii-sdk"; -const PRIVATE_TAG_RE = /)[^>]*>[\s\S]*?(?:<\/private\s*>|$)/gi; +const PRIVATE_TAG_TOKEN_RE = /)[^>]*>|<\/private\s*>/gi; + +function redactPrivateBlocks(input: string): string { + const tokens = new RegExp(PRIVATE_TAG_TOKEN_RE.source, PRIVATE_TAG_TOKEN_RE.flags); + let out = ""; + let cursor = 0; + let depth = 0; + for (let match = tokens.exec(input); match; match = tokens.exec(input)) { + const closing = match[0].startsWith(" 0) return `${out}[REDACTED]`; + return out + input.slice(cursor); +} const SECRET_PATTERN_SOURCES = [ /(?:api[_-]?key|secret|token|password|credential|auth)[\s]*[=:]\s*["']?[A-Za-z0-9_\-/.+]{20,}["']?/gi, @@ -26,7 +51,7 @@ const URL_CREDENTIALS_RE = /\b([a-z][a-z0-9+.-]*:\/\/)[^\s/?#@:"'<>]*:[^\s/?#@"'<>]+@/gi; export function stripPrivateData(input: string): string { - let result = input.replace(PRIVATE_TAG_RE, "[REDACTED]"); + let result = redactPrivateBlocks(input); result = result.replace(new RegExp(PRIVATE_KEY_BLOCK_RE.source, PRIVATE_KEY_BLOCK_RE.flags), "[REDACTED_SECRET]"); result = result.replace(new RegExp(URL_CREDENTIALS_RE.source, URL_CREDENTIALS_RE.flags), "$1[REDACTED_SECRET]@"); for (const source of SECRET_PATTERN_SOURCES) { diff --git a/test/privacy.test.ts b/test/privacy.test.ts index 7e0883baa8..2e5cc1cc42 100644 --- a/test/privacy.test.ts +++ b/test/privacy.test.ts @@ -12,9 +12,15 @@ describe("stripPrivateData", () => { expect(stripPrivateData("keep secret to the end")).toBe("keep [REDACTED]"); }); + it("strips a nested private block as one block", () => { + expect(stripPrivateData("a outer inner outer-secret b")).toBe("a [REDACTED] b"); + expect(stripPrivateData("a b x c")).toBe("a b [REDACTED] c"); + }); + it("strips a private tag that carries attributes", () => { expect(stripPrivateData('a secret b')).toBe("a [REDACTED] b"); expect(stripPrivateData("a value b")).toBe("a value b"); + expect(stripPrivateData("a value b")).toBe("a value b"); }); it("strips private tags case-insensitive", () => { From a854554a5ba910b813c661b73a724f0d610ea596 Mon Sep 17 00:00:00 2001 From: Rohit Ghumare Date: Wed, 4 Nov 2026 16:45:12 +0530 Subject: [PATCH 6/6] chore(hooks): drop a stale redaction comment in the Stop hook The comment said private-tag redaction only matches closed blocks; this pull request makes it handle unclosed and attribute-bearing tags. --- src/hooks/stop.ts | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/hooks/stop.ts b/src/hooks/stop.ts index 60d23a3ac6..5ecf93a794 100644 --- a/src/hooks/stop.ts +++ b/src/hooks/stop.ts @@ -16,8 +16,6 @@ const EXIT_CAP_MS = 3500; const END_CAP_MS = 1500; const REPLY_MAX_CHARS = 4000; -// stripPrivateData only matches a closed block, so the whole reply -// has to be redacted before anything shortens it. function boundReply(reply: string): { text: string; bytes?: number } { const safe = stripPrivateData(reply); if (safe.length <= REPLY_MAX_CHARS) return { text: safe };