mirror of
https://github.com/openswarm-ai/openswarm.git
synced 2026-09-12 20:57:42 +02:00
[eric] chat: output blocks cap at 320px and the model-facing [presentation] hint never reaches human eyes
This commit is contained in:
@@ -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' },
|
||||
|
||||
Reference in New Issue
Block a user