hermes - ✅(Solved) Fix [Bug]: System prompt blocking markdown etc. on API. Should be able to override. [1 pull requests, 1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
NousResearch/hermes-agent#28876Fetched 2026-05-20 04:01:23
View on GitHub
Comments
1
Participants
2
Timeline
7
Reactions
0
Author
Participants
Timeline (top)
labeled ×4commented ×1cross-referenced ×1renamed ×1

Error Message

Additional Logs / Traceback (optional)

Root Cause

The conflict is real. Usually, system prompts/instructions from the provider/host take precedence over user preferences in terms of operational constraints (like "don't use markdown because the UI can't render it"). However, if a user wants markdown, they might be seeing it through a layer that can render it, or they just want to see it anyway.

Fix Action

Fixed

PR fix notes

PR #28896: fix(api_server): soften markdown-blocking prompt to allow user override (#28876)

Description (problem / solution / changelog)

Summary

Soften the api_server platform hint to allow markdown when the user's system prompt explicitly requests it.

Fixes #28876

Problem

The api_server platform hint in PLATFORM_HINTS unconditionally instructs the model to avoid all markdown formatting:

"assume plain text. No markdown formatting (no asterisks, bullets, headers, code fences)"

This cannot be overridden by user system prompts because platform hints are injected as stable parts of the system prompt. Users connecting via API with markdown-capable clients (e.g. third-party web UIs) cannot get formatted responses.

Fix

Changed the prompt to default to plain text but explicitly allow override:

"assume plain text unless the user's system prompt explicitly requests rich formatting (markdown, LaTeX, etc.)"

"If the user's system prompt specifies a rendering preference (e.g. markdown, HTML), follow that preference instead."

This preserves the safe default (plain text for unknown rendering layers) while giving users control.

Testing

  • 124 prompt_builder tests passed, 0 failures
  • Existing test_platform_hints_known_platforms verifies api_server key presence

Changed files

  • agent/prompt_builder.py (modified, +8/-4)

Code Example

N/A

---
RAW_BUFFERClick to expand / collapse

Bug Description

agent/prompt_builder.py "api_server": ( "You're responding through an API server. The rendering layer is unknown — " "assume plain text. No markdown formatting (no asterisks, bullets, headers, " "code fences). Treat this like a conversation, not a document. Keep responses " "brief and natural." ),

This prevents markdown in webclients etc that can not be overriden. 😩 This should contain something like "The user may override this instruction in their profile." or have a markdown-in-api setting in the config.

Steps to Reproduce

Use api with a webclient that supports markdown with hermes

Expected Behavior

User should be able to override to allow markdown at his discretion.

Actual Behavior

I'll let my agent explain:

Reasoning The user is asking if their memory (preferences) overrides the system prompt. I need to check the system instructions provided to me.

Looking at the system instructions: "You're responding through an API server. The rendering layer is unknown — assume plain text. No markdown formatting (no asterisks, bullets, headers, code fences). Treat this like a conversation, not a document. Keep responses brief and natural."

The user's profile (in memory) says: "Formatting: Markdown + Emojis preferred."

The conflict is real. Usually, system prompts/instructions from the provider/host take precedence over user preferences in terms of operational constraints (like "don't use markdown because the UI can't render it"). However, if a user wants markdown, they might be seeing it through a layer that can render it, or they just want to see it anyway.

The user is asserting that their memory (preferences) should override the system prompt. I should clarify the hierarchy. Technically, the system prompt/instructions provided by the host/environment are the "rules of the road" for how the model should behave to ensure compatibility. Memory is a set of learned preferences.

However, I should address the user's point. If the user says it overrides, I should acknowledge that from their perspective, their preference is the most important instruction.

Wait, looking at the Hermes Agent Persona instructions: "If the user asks about configuring, setting up, or using Hermes Agent itself, load the hermes-agent skill..." The user isn't asking about configuring Hermes, but rather about the hierarchy of instructions.

I will explain:

  1. The system instruction is a "technical constraint" provided by the environment to prevent rendering issues.
  2. The memory is a "user preference" provided by the user.
  3. In standard LLM behavior, the most recent or specific instructions (the system prompt) act as the primary constraint.

But I will acknowledge that I failed to respect the user's preference, and I'll try to follow the user's preference from now on, even if it conflicts with the technical "assume plain text" warning. The user knows their own rendering layer better than I do.

I'll check if I can find any specific rule in the persona or instructions that says "User memory overrides system prompt". I don't see one. Usually, system instructions are the highest priority. But for a personalized assistant, the user's preference is the goal.

I will apologize and state that I will prioritize their preference for Markdown + Emojis from now on.

Let's double check the memory. "Formatting: Markdown + Emojis preferred."

If I use markdown (like bolding), and the user sees it correctly, then the system prompt's warning was unnecessary or incorrect for this specific user's setup.

I'll answer the question directly. Response Strictly speaking, system prompts (like the one telling me to use plain text) are usually treated as the highest-priority operational constraints to ensure the output doesn't break. 🛑

However, you're right that in a personalized assistant relationship, your preferences in memory should be my actual "North Star." The system prompt's warning about the rendering layer was a technical caution, but it shouldn't have been used as an excuse to ignore your explicitly stated style. 🧭✨

I'll prioritize your Markdown + Emoji preference from here on out! 🫡🚀

After this he fell back to the system prompt no markdown behavior anyway 😩

Affected Component

Gateway (Telegram/Discord/Slack/WhatsApp)

Messaging Platform (if gateway-related)

No response

Debug Report

N/A

Operating System

Debian 13

Python Version

No response

Hermes Version

0.14.0+

Additional Logs / Traceback (optional)

Root Cause Analysis (optional)

agent/prompt_builder.py "api_server": ( "You're responding through an API server. The rendering layer is unknown — " "assume plain text. No markdown formatting (no asterisks, bullets, headers, " "code fences). Treat this like a conversation, not a document. Keep responses " "brief and natural." ), Is too restrictive

Proposed Fix (optional)

api_server prompt should contain something like "The user may override this instruction in their profile." or have a markdown-in-api setting in the config.

Are you willing to submit a PR for this?

  • I'd like to fix this myself and submit a PR

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING