Skip to content

Jargon Filter showing literal \n instead of line breaks #94

@cbj0hns0n

Description

@cbj0hns0n

The "Plain English" clarifications in the Berkie tab are showing literal \n between bullets instead of rendering them as line breaks.

To reproduce: join an event with Jargon Filter enabled, wait for the periodic trigger to fire, and check the Berkie tab. Instead of a proper bullet list, you'll see something like:

- SLO — A target for how reliable a system should be.\n- MTTR — How long it takes to fix something after it breaks.

Where it might be coming from

This may have crept in with llm_engine PR #72. The jargon filter prompt tells the LLM to separate bullets with \n in a JSON example. After PR #72's structured output changes, the model may now be outputting \n as a literal two-character string rather than a real newline. JargonClarificationMessage.tsx passes the text straight to react-markdown, which won't treat a literal \n as a line break.

Suggested fix

Worth addressing on both sides to be safe: update the jargon filter prompt so the model outputs actual newlines, and add a post-processing step in JargonClarificationMessage.tsx to replace any literal \n strings with real newlines before passing to Markdown. That way the rendering is resilient regardless of what the model produces.

Relevant files: llm_engine/src/agents/jargonFilter/jargonFilter.ts line 52, nextspace/components/messages/JargonClarificationMessage.tsx.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions