Conversation
…rror 1213
ZAI (glm-5.2) rejects empty/whitespace-only user content with HTTP 400
error 1213 ('The prompt parameter was not received normally'). The MoA
_reference_messages() function was appending user messages unconditionally
even when their content was empty — only updating last_user_content when
non-empty. In conversations with empty user turns (image-only messages,
whitespace, etc.), the empty content reached the reference model and
caused a one-sided MoA failure (reference drops out, aggregator works
with partial input).
Fix: only append user messages that have non-empty text content. This
also eliminates consecutive-role alternation violations these empty
messages would otherwise create.
Duplicate of #58465 — both add an empty/whitespace-only user-turn skip to the same |
teknium1
left a comment
There was a problem hiding this comment.
Thanks for targeting a real MoA reference-view failure. The premise remains present on current main: agent/moa_loop.py:478-480 renders blank user turns.
Problems
agent/moa_loop.py:478-480does not cover an advisory transcript with no nonempty user text. For a sole whitespace user turn, this branch leavesrenderedempty, then the unchanged fallback atagent/moa_loop.py:521-527returns that same whitespace string as a user message. The strict-provider failure therefore remains for that case.- The PR has no regression test. Existing reference-view coverage in
tests/run_agent/test_moa_loop_mode.py:282-392does not cover the empty-only fallback.
Suggested changes
- Guard the fallback against blank strings and preserve a nonempty terminal user message when no textual user context exists.
- Add an empty-only/whitespace-only regression case asserting no blank user content is emitted.
Automated hermes-sweeper review.
| if text.strip(): | ||
| last_user_content = text | ||
| rendered.append({"role": "user", "content": text}) | ||
| rendered.append({"role": "user", "content": text}) |
There was a problem hiding this comment.
This skips blank turns only when another message renders. With a transcript containing only {"role": "user", "content": " "}, rendered stays empty and the unchanged fallback at lines 521-527 returns the whitespace string as a user message. Please harden that fallback and add an empty-only regression test.
|
Thanks @alihancankara91-cloud — correct diagnosis of the same empty-user-turn class (your ZAI error-1213 report matched the Kimi/Moonshot 400 in #58464). This landed on main via #64409, which salvages the earliest submission (#58465, Jul 4) with a follow-up reconciling multimodal/image-only turns. Your report is credited in the fix's provider coverage. Closing as superseded. |
…rror 1213
ZAI (glm-5.2) rejects empty/whitespace-only user content with HTTP 400 error 1213 ('The prompt parameter was not received normally'). The MoA _reference_messages() function was appending user messages unconditionally even when their content was empty — only updating last_user_content when non-empty. In conversations with empty user turns (image-only messages, whitespace, etc.), the empty content reached the reference model and caused a one-sided MoA failure (reference drops out, aggregator works with partial input).
Fix: only append user messages that have non-empty text content. This also eliminates consecutive-role alternation violations these empty messages would otherwise create.
What does this PR do?
Related Issue
Fixes #
Type of Change
Changes Made
How to Test
Checklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AFor New Skills
hermes --toolsets skills -q "Use the X skill to do Y"Screenshots / Logs