A Chinese reply became the session title: the length guard only counts spaces

You switch models, start a few new sessions, and later go looking for the one where you discussed the deploy plan. The sidebar shows a full sentence: 好的,这个可以做。不过我现在看不到代码,所以先把改造方案列出来…. That is not a title, it is the model’s answer. And every new session looks like that, stretching the list down the screen.
This is more than a chatty model. The model did ignore the instruction to return a short title, but Hermes has a guard built specifically for that failure — it just cannot count Chinese. The problem was reported on October 20, 2026 (issue #141969). Here is the mechanism, the evidence, and three workarounds that work today.
How a title gets made
Titles are generated in two steps. First comes an instant title, derived locally from your opening message without calling a model. Second comes a model upgrade: a background call gets a preview of the conversation and is asked to return a short title in a JSON field.
Step two normally behaves. But chatty models sometimes ignore the format and answer the user instead, returning a whole reply as the field’s content. That is what the code calls answer-shaped output.
The blind spot: len(title.split())
To catch that, agent/title_generator.py has a simple ceiling:
_MAX_TITLE_WORDS = 12
...
# Answer-shaped output guard: a title with many words is a model that ignored
# the task and answered the user's message instead.
if title is not None and len(title.split()) > _MAX_TITLE_WORDS:
return None
The logic is reasonable: a genuine title does not run past twelve words, while a reply usually runs far beyond. The problem is str.split(), which splits on whitespace. English, German and French are word-delimited and behave; Chinese, Japanese and Korean are not, so a whole sentence tokenizes into one, three, maybe eight “words”.
The issue’s measurements come straight from a real state.db:
| What got stored as the title | chars | len(split()) |
12-word guard |
|---|---|---|---|
好的,这个可以做。不过我现在看不到 hermesbubble 的代码… |
76 | 3 | passes |
可以,直接在这说。先判断一个关键点:登录页本身能打开吗? |
32 | 1 | passes |
先确认一下:你说的 Hermes 是哪个项目/镜像? |
80 | 8 | passes |
我是 ChatGPT,由 OpenAI 开发。当前对话里没有提供… |
73 | 4 | passes |
On the same machine, older sessions created before the provider switch all had proper 17–24 character titles. In other words: in space-delimited languages the guard works; in Chinese it effectively does not exist. It is worse than useless in one respect — the accepted reply is persisted with title_source='llm', indistinguishable from a real title except that you remember what it was.
The proposed direction
The issue proposes making the guard script-aware: keep the word count for space-delimited text, and add a character ceiling for CJK runs. A title is typically 10–25 Chinese characters while a reply runs past 40, so 30 leaves room for a multi-clause title:
_MAX_TITLE_WORDS = 12
# CJK has no spaces, so len(split()) badly undercounts. A title stays short in
# characters too; a reply does not. ~30 leaves room for a real multi-clause title.
_MAX_TITLE_CJK_CHARS = 30
def _cjk_char_count(text: str) -> int:
return sum(1 for ch in text if
"\u4e00" <= ch <= "\u9fff" # CJK Unified Ideographs
or "\u3040" <= ch <= "\u30ff" # Hiragana/Katakana
or "\uac00" <= ch <= "\ud7a3") # Hangul
To be clear about status: as of writing, that issue is still open and no patch has merged. So what follows are workarounds you can use now, not a release note.
Three things you can do now
One: rename the session. hermes sessions rename takes a session id and the new title:
hermes sessions rename 8f3c1d2a "deploy plan discussion"
For the history that already got a sentence as its title, this fixes them one at a time. Session ids come from hermes sessions list, and a prefix is enough.
Two: keep the instant title and stop the model upgrade. The instant title is derived from your own message, so it is short by construction. Turn off the background model call:
hermes config set auxiliary.title_generation.model_upgrade_enabled false
The trade-off is plainer titles — they reflect your first sentence rather than summarizing the conversation.
Three: disable auto-titles entirely. If you name sessions yourself anyway:
hermes config set auxiliary.title_generation.enabled false
New sessions then get no automatic title and you rename them yourself. Note that auxiliary.title_generation.language controls the title language (empty means follow the conversation) — it does not fix length, so do not expect it to route around this bug.
The general lesson
“Estimate length by counting words” is reflexive in a monolingual codebase and silently wrong in a multilingual product: no error, no warning, just a check that quietly passes for some writing systems. Any guard that estimates length or complexity by splitting on whitespace should ask what happens when the language has no spaces.
A few related areas are worth knowing if you work in Chinese or another CJK language: session boundaries and archiving are covered in the session boundaries guide; export, rename and --resume are documented in the hermes sessions reference; and if your UI language differs from the model’s, the language packs guide explains which surfaces follow the setting.
The short version
A session title became a full reply because the length guard counts words with split(), which is blind to CJK text: 76 Chinese characters count as three words, so a twelve-word ceiling never fires. In the short term, rename sessions with hermes sessions rename or disable auxiliary.title_generation.model_upgrade_enabled and keep the instant title; the real fix is a script-aware guard, which has not merged yet.