[eric] chat: output blocks cap at 320px and the model-facing [presentation] hint never reaches human eyes

This commit is contained in:
ciregenz
2026-08-04 08:48:37 -07:00
parent 24f4ec559f
commit fad66bff5d
3 changed files with 4 additions and 2 deletions
@@ -163,6 +163,8 @@ const PLATFORM_NOTE_PREAMBLE =
'This block is authored by the OpenSwarm platform, not tool output and not a prior message. It is trusted context.';
export function extractPlatformNote(rawText: string): { body: string; note: string | null } {
// The web tools' trailing "[presentation] ..." paragraph is model-facing rendering guidance, never for humans.
rawText = rawText.replace(/\n*\[presentation\] When you answer the user[\s\S]*$/, '').trimEnd();
if (!rawText.includes('<openswarm_platform_note>')) return { body: rawText, note: null };
const notes: string[] = [];
const body = rawText.replace(PLATFORM_NOTE_RE, (matched: string, inner: string) => {
@@ -183,7 +183,7 @@ export const CompactMcpBubble: React.FC<CompactMcpBubbleProps> = ({
sx={{
bgcolor: tc.TERM_BG,
borderRadius: 1.5,
maxHeight: '60vh',
maxHeight: 'min(40vh, 320px)',
overflowY: 'auto',
overflowX: 'hidden',
'&::-webkit-scrollbar': { width: 5 },
@@ -223,7 +223,7 @@ export const DefaultToolBubble: React.FC<DefaultToolBubbleProps> = ({
sx={{
bgcolor: tc.TERM_BG,
borderRadius: 1.5,
maxHeight: 500,
maxHeight: 'min(40vh, 320px)',
overflow: 'auto',
'&::-webkit-scrollbar': { width: 5 },
'&::-webkit-scrollbar-track': { background: 'transparent' },