feat: inspect the full prompt in the live log

The "context built" event now carries the fully-rendered prompt (persona, gists,
recalled details, recent turns, the new message) plus a total char count. The
log panel renders it as a collapsed "view full prompt" block — clean by default,
one click to see exactly what hit the model.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 23:52:35 +00:00
parent d7c258eba0
commit 236a16b331
3 changed files with 38 additions and 6 deletions
+5 -1
View File
@@ -734,7 +734,10 @@
const level = event.level || 'info';
const time = new Date((event.ts || 0) * 1000).toLocaleTimeString();
const fields = event.fields || {};
const fields = Object.assign({}, event.fields || {});
// `detail` is rendered as an expandable block, not an inline field.
const detail = fields.detail;
delete fields.detail;
const fieldStr = Object.keys(fields).length
? Object.entries(fields).map(([k, v]) => `${k}=${v}`).join(' ')
: '';
@@ -746,6 +749,7 @@
<span class="log-level log-level-${level}">${escapeHtml(level)}</span>
<span class="log-msg">${escapeHtml(event.msg || '')}</span>
${fieldStr ? `<span class="log-fields">${escapeHtml(fieldStr)}</span>` : ''}
${detail ? `<details class="log-detail"><summary>view full prompt</summary><pre>${escapeHtml(detail)}</pre></details>` : ''}
`;
thinkingContent.appendChild(eventDiv);