fix(prompt): constrain Output Style to UI-renderable Markdown subset#65
Merged
Conversation
The chat UI (OAN-UI card-bubble) renders responses with react-markdown + remark-gfm but overrides only p/ol/ul/li/strong. Headings (#/##/###) flatten to body text, GFM tables render as unstyled smashed columns, and LaTeX ($\times$) / *** HR leak as raw text to the farmer. Replaces the vague "No unnecessary headings" bullet with explicit constraints: bold/bullets/numbered lists/paragraphs only; no headings, tables, HR, or math. Use **bold:** labels instead of headings, bullets instead of tables, × instead of $\times$. Eval evidence (sme_review_400 / Shridhar OSS eval): 40 chat rows emit ### headings, 5 emit GFM tables, chat51 leaks literal $\times$. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The chat agent emits Markdown the OAN-UI chat bubble cannot render.
OAN-UI/src/.../bubbles/card-bubble.tsxrenders answers viareact-markdown@10+remark-gfm@4, but overrides components for onlyp,ol,ul,li,strong. With Tailwind preflight:###headings → flatten to body text (noh1–h6styling). Section structure the model intended is visually lost.table/tdoverride).$\times$/ LaTeX → leaks literally (no remark-math/katex). Farmer seesમાતા ગાય $\times$ પસંદ કરેલો બળદ.***→ near-invisible<hr>.Evidence (Shridhar OSS eval,
sme_review_400)### headings(chat 141, 57, 197, 10, 16, 19, 25, 49, 60, 74, 93, 94, …)$\times$(×2)Change
One surgical edit to the existing
## Output Stylesection inassets/prompts/agrinet_system.md: the vagueNo unnecessary headings for simple answers.bullet is replaced with explicit, UI-matched constraints — allow only bold / bullet / numbered lists / paragraphs; forbid headings, tables, HR, and math; use**bold:**labels instead of headings, bullets instead of tables,×instead of$\times$.Root-cause fix (steers all future traffic), not a per-row patch. Paired with a defensive OAN-UI PR that adds graceful
h1–h6/table/hroverrides.Validation
Prompt-only change. Recommend dev smoke on a few of the affected eval queries (chat 51/69/141) to confirm the agent drops headings/tables/LaTeX before prod promotion.
🤖 Generated with Claude Code