← Back to Kontasks
Testing System-Reminder Injection
Guide for testing post-compaction system-reminder injection in dashboard console
Output
Testing System-Reminder Injection
The system-reminder injection ensures Claude still creates a kontask after context compaction (when Claude's memory is summarized due to running out of context window).
How It Works
1. Dashboard console sets isDashboardConsole: true on session 2. When Claude's context runs out, it triggers auto_compact 3. Stream detects auto_compact end → injects <system-reminder> 4. Reminder tells Claude to still create a kontask with output
Testing Methods
1. Unit Tests (Recommended First)
# Add tests to konsole/tests/session.test.ts
cd /konnectvol/konsole && deno task test
Currently no tests for getPostCompactionReminder or isDashboardConsoleSession.
2. Log Verification (Quick Check)
# Watch for injection logs during a session
kon-tail sole | grep -E "post-compaction|system-reminder|auto.*compact"
Look for:
"msg": "Auto-compact complete" "msg": "Injecting post-compaction system reminder"
3. Force Compaction (Integration Test)
To trigger compaction deliberately:
# Send a very long prompt or do many tool calls in one turn # For example, read many large files sequentially: "Read all files in /konnectvol/konui/src then summarize them" # Or explicitly ask: "Keep reading files until you run out of context"
4. WebSocket Event Verification
In browser dev tools, check for these stream events:
{"type":"auto_compact_start"} // Compaction begins {"type":"auto_compact_end", "durationMs": ...} {"type":"system_reminder", "content": "..."} // ← Should appear
Key Files
konsole/src/ ├── session.ts:183 # isDashboardConsole flag set ├── session.ts:206-208 # isDashboardConsoleSession() check ├── session.ts:220-242 # getPostCompactionReminder() generator └── stream.ts:635-656 # Injection point after compaction
What Success Looks Like
- ✓ Log shows "Injecting post-compaction system reminder"
- ✓
system_reminderevent appears in WebSocket stream - ✓ Claude still creates a kontask after compaction
- ✓ Kontask has proper
context.outputHTML
Recommended: Add Unit Tests
// Add to konsole/tests/session.test.ts describe("dashboard console flags", () => { it("setDashboardRequestId marks session as dashboard console", async () => { const session = await createSession(); await setDashboardRequestId(session.id, "req_123"); assertEquals(isDashboardConsoleSession(session.id), true); }); it("getPostCompactionReminder returns null for non-dashboard session", async () => { const session = await createSession(); assertEquals(getPostCompactionReminder(session.id), null); }); it("getPostCompactionReminder returns reminder for dashboard session", async () => { const session = await createSession(); await setDashboardRequestId(session.id, "req_123"); const reminder = getPostCompactionReminder(session.id); assertExists(reminder); assertEquals(reminder.includes("<system-reminder>"), true); assertEquals(reminder.includes("kontask"), true); }); });
💡 Quick test: Run kon-tail sole in another terminal, then in this console ask me to "read all TypeScript files in konui/src and explain them" - this should trigger compaction after several files.
Quick Actions
Original Request
No layout configured
Details
Type
General
Status
Completed
Scope
greatvibe
Tags
konsoletestingcompaction
Created
11 Jan 2026, 11:11 am
Updated
11 Jan 2026, 11:11 am
Timing
⏱️ 101.5s
0 tools
● TTFE 0%
● Thinking 100%
● Tools 0%
Created By
claude
📋 Claude's Context
Session
ses_40728090...
Raw Data
{
"id": "e447d884-4ad5-4eac-aebc-ef36580f4858",
"type": "general",
"status": "completed",
"title": "Testing System-Reminder Injection",
"description": "Guide for testing post-compaction system-reminder injection in dashboard console",
"context": {
"output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:'Consolas','Monaco',monospace;\">\n<h2 style=\"font-family:sans-serif;color:#fff;margin:0 0 16px 0;\">Testing System-Reminder Injection</h2>\n\n<p style=\"color:#e0e0e0;line-height:1.6;\">The system-reminder injection ensures Claude still creates a kontask after context compaction (when Claude's memory is summarized due to running out of context window).</p>\n\n<h3 style=\"font-family:sans-serif;color:#56b6c2;margin:20px 0 12px 0;\">How It Works</h3>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;color:#e0e0e0;\">\n<span style=\"color:#7f848e;\">1.</span> Dashboard console sets <span style=\"color:#98c379;\">isDashboardConsole: true</span> on session\n<span style=\"color:#7f848e;\">2.</span> When Claude's context runs out, it triggers <span style=\"color:#e5c07b;\">auto_compact</span>\n<span style=\"color:#7f848e;\">3.</span> Stream detects <span style=\"color:#e5c07b;\">auto_compact</span> end → injects <span style=\"color:#c678dd;\"><system-reminder></span>\n<span style=\"color:#7f848e;\">4.</span> Reminder tells Claude to still create a kontask with output\n</pre>\n\n<h3 style=\"font-family:sans-serif;color:#56b6c2;margin:20px 0 12px 0;\">Testing Methods</h3>\n\n<h4 style=\"font-family:sans-serif;color:#61afef;margin:16px 0 8px 0;\">1. Unit Tests (Recommended First)</h4>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#7f848e;\"># Add tests to konsole/tests/session.test.ts</span>\ncd /konnectvol/konsole && deno task test\n</pre>\n<p style=\"color:#7f848e;font-size:0.9em;margin:8px 0;\">Currently no tests for <code style=\"background:#3d3d3d;padding:2px 6px;border-radius:3px;\">getPostCompactionReminder</code> or <code style=\"background:#3d3d3d;padding:2px 6px;border-radius:3px;\">isDashboardConsoleSession</code>.</p>\n\n<h4 style=\"font-family:sans-serif;color:#61afef;margin:16px 0 8px 0;\">2. Log Verification (Quick Check)</h4>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#7f848e;\"># Watch for injection logs during a session</span>\nkon-tail sole | grep -E \"post-compaction|system-reminder|auto.*compact\"\n</pre>\n<p style=\"color:#e0e0e0;margin:8px 0;\">Look for:</p>\n<pre style=\"background:#2d2d2d;padding:12px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#98c379;\">\"msg\": \"Auto-compact complete\"</span>\n<span style=\"color:#98c379;\">\"msg\": \"Injecting post-compaction system reminder\"</span>\n</pre>\n\n<h4 style=\"font-family:sans-serif;color:#61afef;margin:16px 0 8px 0;\">3. Force Compaction (Integration Test)</h4>\n<p style=\"color:#e0e0e0;margin:8px 0;\">To trigger compaction deliberately:</p>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#7f848e;\"># Send a very long prompt or do many tool calls in one turn</span>\n<span style=\"color:#7f848e;\"># For example, read many large files sequentially:</span>\n\"Read all files in /konnectvol/konui/src then summarize them\"\n\n<span style=\"color:#7f848e;\"># Or explicitly ask:</span>\n\"Keep reading files until you run out of context\"\n</pre>\n\n<h4 style=\"font-family:sans-serif;color:#61afef;margin:16px 0 8px 0;\">4. WebSocket Event Verification</h4>\n<p style=\"color:#e0e0e0;margin:8px 0;\">In browser dev tools, check for these stream events:</p>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#e5c07b;\">{\"type\":\"auto_compact_start\"}</span> <span style=\"color:#7f848e;\">// Compaction begins</span>\n<span style=\"color:#e5c07b;\">{\"type\":\"auto_compact_end\", \"durationMs\": ...}</span>\n<span style=\"color:#c678dd;\">{\"type\":\"system_reminder\", \"content\": \"...\"}</span> <span style=\"color:#7f848e;\">// ← Should appear</span>\n</pre>\n\n<h3 style=\"font-family:sans-serif;color:#56b6c2;margin:20px 0 12px 0;\">Key Files</h3>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.8;color:#e0e0e0;\">\n<span style=\"color:#56b6c2;font-weight:bold;\">konsole/src/</span>\n├── <span style=\"color:#e5c07b;\">session.ts</span>:183 <span style=\"color:#7f848e;\"># isDashboardConsole flag set</span>\n├── <span style=\"color:#e5c07b;\">session.ts</span>:206-208 <span style=\"color:#7f848e;\"># isDashboardConsoleSession() check</span>\n├── <span style=\"color:#e5c07b;\">session.ts</span>:220-242 <span style=\"color:#7f848e;\"># getPostCompactionReminder() generator</span>\n└── <span style=\"color:#e5c07b;\">stream.ts</span>:635-656 <span style=\"color:#7f848e;\"># Injection point after compaction</span>\n</pre>\n\n<h3 style=\"font-family:sans-serif;color:#56b6c2;margin:20px 0 12px 0;\">What Success Looks Like</h3>\n<ul style=\"color:#e0e0e0;line-height:1.8;margin:8px 0;padding-left:20px;\">\n<li><span style=\"color:#98c379;\">✓</span> Log shows \"Injecting post-compaction system reminder\"</li>\n<li><span style=\"color:#98c379;\">✓</span> <code style=\"background:#3d3d3d;padding:2px 6px;border-radius:3px;\">system_reminder</code> event appears in WebSocket stream</li>\n<li><span style=\"color:#98c379;\">✓</span> Claude still creates a kontask after compaction</li>\n<li><span style=\"color:#98c379;\">✓</span> Kontask has proper <code style=\"background:#3d3d3d;padding:2px 6px;border-radius:3px;\">context.output</code> HTML</li>\n</ul>\n\n<h3 style=\"font-family:sans-serif;color:#56b6c2;margin:20px 0 12px 0;\">Recommended: Add Unit Tests</h3>\n<pre style=\"background:#2d2d2d;padding:16px;border-radius:6px;overflow-x:auto;line-height:1.6;\">\n<span style=\"color:#7f848e;\">// Add to konsole/tests/session.test.ts</span>\n\n<span style=\"color:#c678dd;\">describe</span>(<span style=\"color:#98c379;\">\"dashboard console flags\"</span>, () => {\n <span style=\"color:#c678dd;\">it</span>(<span style=\"color:#98c379;\">\"setDashboardRequestId marks session as dashboard console\"</span>, <span style=\"color:#c678dd;\">async</span> () => {\n <span style=\"color:#c678dd;\">const</span> session = <span style=\"color:#c678dd;\">await</span> createSession();\n <span style=\"color:#c678dd;\">await</span> setDashboardRequestId(session.id, <span style=\"color:#98c379;\">\"req_123\"</span>);\n \n assertEquals(isDashboardConsoleSession(session.id), <span style=\"color:#d19a66;\">true</span>);\n });\n\n <span style=\"color:#c678dd;\">it</span>(<span style=\"color:#98c379;\">\"getPostCompactionReminder returns null for non-dashboard session\"</span>, <span style=\"color:#c678dd;\">async</span> () => {\n <span style=\"color:#c678dd;\">const</span> session = <span style=\"color:#c678dd;\">await</span> createSession();\n assertEquals(getPostCompactionReminder(session.id), <span style=\"color:#d19a66;\">null</span>);\n });\n\n <span style=\"color:#c678dd;\">it</span>(<span style=\"color:#98c379;\">\"getPostCompactionReminder returns reminder for dashboard session\"</span>, <span style=\"color:#c678dd;\">async</span> () => {\n <span style=\"color:#c678dd;\">const</span> session = <span style=\"color:#c678dd;\">await</span> createSession();\n <span style=\"color:#c678dd;\">await</span> setDashboardRequestId(session.id, <span style=\"color:#98c379;\">\"req_123\"</span>);\n \n <span style=\"color:#c678dd;\">const</span> reminder = getPostCompactionReminder(session.id);\n assertExists(reminder);\n assertEquals(reminder.includes(<span style=\"color:#98c379;\">\"<system-reminder>\"</span>), <span style=\"color:#d19a66;\">true</span>);\n assertEquals(reminder.includes(<span style=\"color:#98c379;\">\"kontask\"</span>), <span style=\"color:#d19a66;\">true</span>);\n });\n});\n</pre>\n\n<div style=\"margin-top:24px;padding-top:16px;border-top:1px solid #3d3d3d;\">\n<p style=\"color:#7f848e;font-size:0.9em;\">💡 <strong style=\"color:#e0e0e0;\">Quick test:</strong> Run <code style=\"background:#3d3d3d;padding:2px 6px;border-radius:3px;\">kon-tail sole</code> in another terminal, then in this console ask me to \"read all TypeScript files in konui/src and explain them\" - this should trigger compaction after several files.</p>\n</div>\n</div>",
"requestedAt": "2026-01-11T00:00:00.000Z",
"requestId": "16b2329d-c494-49d9-a45e-5599ac8c1c4f",
"choices": [
{
"label": "Add unit tests",
"value": "Add the recommended unit tests for isDashboardConsoleSession and getPostCompactionReminder to konsole/tests/session.test.ts",
"primary": true
},
{
"label": "Trigger compaction",
"value": "Read all TypeScript files in konui/src to trigger context compaction so we can verify the system-reminder injection works"
},
{
"label": "Show logs",
"value": "Show me the konsole logs filtered for compaction and system-reminder events"
}
],
"turnTiming": {
"totalMs": 101482,
"ttfeMs": 109,
"thinkingMs": 101371,
"toolExecutionMs": 0,
"toolCallCount": 0,
"thinkingPct": 100,
"toolsPct": 0,
"ttfePct": 0
}
},
"createdBy": "claude",
"createdAt": "2026-01-11T01:11:36.197Z",
"updatedAt": "2026-01-11T01:11:40.592Z",
"requestId": "16b2329d-c494-49d9-a45e-5599ac8c1c4f",
"scope": "greatvibe",
"tags": [
"konsole",
"testing",
"compaction"
],
"sessionId": "ses_40728090-b86"
}