From 00ddb3b169bbe4e6f297af0e5a04d8d1e3411c51 Mon Sep 17 00:00:00 2001 From: gavrielc Date: Mon, 11 May 2026 12:49:28 +0300 Subject: [PATCH] fix(compact): place destination reminder at end of compaction summary Tell the compactor to include the wrapping reminder verbatim at the END of the summary so it's the last thing the agent sees after compaction. Previously the instruction just asked to "preserve" routing info, which the compactor could place anywhere or summarize away. Co-Authored-By: Claude Opus 4.6 (1M context) --- container/agent-runner/src/compact-instructions.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/container/agent-runner/src/compact-instructions.ts b/container/agent-runner/src/compact-instructions.ts index b682061..1cbea0d 100644 --- a/container/agent-runner/src/compact-instructions.ts +++ b/container/agent-runner/src/compact-instructions.ts @@ -26,9 +26,9 @@ const instructions = [ '2. Preserve the chronological message/reply sequence of recent exchanges.', ' The agent needs to see: who said what, in what order, and from which destination.', '', - '3. The `from` attribute identifies which destination sent the message.', - ' The agent MUST wrap all responses in ... blocks.', - ` Available destinations: ${names.length > 0 ? names.map((n) => `\`${n}\``).join(', ') : '(none)'}`, + '3. At the END of the compaction summary, include this verbatim reminder:', + ' "You MUST wrap all responses in ... blocks.', + ` Available destinations: ${names.length > 0 ? names.map((n) => `\`${n}\``).join(', ') : '(none)'}."`, ]; console.log(instructions.join('\n'));