Completed
on 3 Jan 2026, 9:09 am

Output

✓ Raw Prompt Bug Fixed

The Problem

When switching pages and returning, the console showed the full wrapped prompt including:

  • "DASHBOARD CONSOLE REQUEST from user..."
  • "CRITICAL OUTPUT INSTRUCTIONS"
  • JSON template structure
  • All the system instructions

The Fix

Added sanitizePrompt() helper function that:

  1. Splits by --- to remove CRITICAL OUTPUT INSTRUCTIONS
  2. Extracts user's actual message after "from user X:"
  3. Truncates to 100 chars for clean display

Changes Made

console-history.ts

  • Line 19-29: Added sanitizePrompt() helper function
  • Line 260: Use sanitizePrompt for workingHistory prompt
  • Line 365: Use sanitizePrompt for fallback prompt

Before vs After

Before After
DASHBOARD CONSOLE REQUEST from user "johnathon":\n\nSend a long-running task...\n\n---\nCRITICAL OUTPUT... Send a long-running task, navigate away, then come back to test...

What's Next?

Test by switching pages again:

Quick Actions

Original Request

No layout configured

Details

Type General
Status Completed
Scope vibetools
Tags consolebug-fixui
Created 3 Jan 2026, 9:09 am
Updated 3 Jan 2026, 9:09 am
Created By claude

Raw Data

{
  "id": "9fca3852-c006-4864-8d57-9aa35d3d62c7",
  "type": "general",
  "status": "completed",
  "title": "Raw prompt display bug fixed",
  "description": "Added sanitizePrompt helper to strip system instructions from displayed prompts",
  "context": {
    "output": "<div style=\"background:#1e1e1e;color:#e0e0e0;padding:20px;border-radius:8px;font-family:system-ui,-apple-system,sans-serif;\">\n<h2 style=\"color:#fff;margin:0 0 16px 0;\">✓ Raw Prompt Bug Fixed</h2>\n\n<div style=\"background:#3a1a1a;border:1px solid #f87171;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#f87171;margin:0 0 8px 0;\">The Problem</h3>\n<p style=\"margin:0;line-height:1.6;\">When switching pages and returning, the console showed the <strong>full wrapped prompt</strong> including:</p>\n<ul style=\"margin:8px 0 0 0;padding-left:20px;line-height:1.8;\">\n<li>\"DASHBOARD CONSOLE REQUEST from user...\"</li>\n<li>\"CRITICAL OUTPUT INSTRUCTIONS\"</li>\n<li>JSON template structure</li>\n<li>All the system instructions</li>\n</ul>\n</div>\n\n<div style=\"background:#1a3a1a;border:1px solid #22c55e;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#22c55e;margin:0 0 8px 0;\">The Fix</h3>\n<p style=\"margin:0;line-height:1.6;\">Added <code style=\"background:#2d2d2d;padding:2px 6px;border-radius:3px;\">sanitizePrompt()</code> helper function that:</p>\n<ol style=\"margin:8px 0 0 0;padding-left:20px;line-height:1.8;\">\n<li>Splits by <code style=\"background:#2d2d2d;padding:2px 6px;border-radius:3px;\">---</code> to remove CRITICAL OUTPUT INSTRUCTIONS</li>\n<li>Extracts user's actual message after \"from user X:\"</li>\n<li>Truncates to 100 chars for clean display</li>\n</ol>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#61afef;margin:0 0 12px 0;\">Changes Made</h3>\n<p style=\"margin:0 0 8px 0;\"><code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">console-history.ts</code></p>\n<ul style=\"margin:8px 0 0 0;padding-left:20px;line-height:1.8;\">\n<li><strong>Line 19-29</strong>: Added <code style=\"background:#1a1a1a;padding:2px 6px;border-radius:3px;\">sanitizePrompt()</code> helper function</li>\n<li><strong>Line 260</strong>: Use sanitizePrompt for workingHistory prompt</li>\n<li><strong>Line 365</strong>: Use sanitizePrompt for fallback prompt</li>\n</ul>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-bottom:16px;\">\n<h3 style=\"color:#c678dd;margin:0 0 12px 0;\">Before vs After</h3>\n<table style=\"width:100%;border-collapse:collapse;font-size:0.9rem;\">\n<tr style=\"border-bottom:1px solid #444;\">\n<th style=\"text-align:left;padding:8px;color:#fff;\">Before</th>\n<th style=\"text-align:left;padding:8px;color:#fff;\">After</th>\n</tr>\n<tr>\n<td style=\"padding:8px;color:#f87171;\">DASHBOARD CONSOLE REQUEST from user \"johnathon\":\\n\\nSend a long-running task...\\n\\n---\\nCRITICAL OUTPUT...</td>\n<td style=\"padding:8px;color:#22c55e;\">Send a long-running task, navigate away, then come back to test...</td>\n</tr>\n</table>\n</div>\n\n<div style=\"background:#2d2d2d;padding:16px;border-radius:6px;margin-top:16px;\">\n<h4 style=\"margin:0 0 8px 0;color:#fff;\">What's Next?</h4>\n<p style=\"color:#9ca3af;margin:0;\">Test by switching pages again:</p>\n</div>\n</div>",
    "choices": [
      {
        "label": "Test it again",
        "value": "Send another long-running task, navigate away, then come back to verify the raw prompt bug is fixed",
        "primary": true
      },
      {
        "label": "Commit both fixes",
        "value": "Commit the RECONNECTING fix and the raw prompt display fix together"
      },
      {
        "label": "All good",
        "value": "Both bugs are fixed. Continue with normal work."
      }
    ],
    "requestedAt": "2026-01-03T11:00:00Z",
    "requestId": "8b21bd7e-a216-4322-bd9f-d247e2449108"
  },
  "createdBy": "claude",
  "createdAt": "2026-01-02T23:09:15.989Z",
  "updatedAt": "2026-01-02T23:09:16.126Z",
  "requestId": "8b21bd7e-a216-4322-bd9f-d247e2449108",
  "scope": "vibetools",
  "tags": [
    "console",
    "bug-fix",
    "ui"
  ],
  "targetUser": "claude"
}
DashboardReportsKontasksSessionsTelemetryLogs + Go