fix: add ALWAYS REQUIRED markers to communication prompt to prevent missing tool_name#1461
Open
gdeyoung wants to merge 1 commit intoagent0ai:mainfrom
Open
fix: add ALWAYS REQUIRED markers to communication prompt to prevent missing tool_name#1461gdeyoung wants to merge 1 commit intoagent0ai:mainfrom
gdeyoung wants to merge 1 commit intoagent0ai:mainfrom
Conversation
…output Models like GLM-5.1 and MiniMax occasionally output JSON without the required tool_name field. Adding explicit ALWAYS REQUIRED markers and a CRITICAL warning line to the communication prompt reduces these errors significantly by making the requirement impossible to miss.
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.
TL;DR — Models like GLM-5.1 and MiniMax frequently output JSON without the required
tool_namefield, causing agent crashesThe
agent.system.main.communication.mdprompt tells the LLM how to format responses, but thetool_nameandtool_argsrequirements are easy to miss in the field list. Adding explicit← ALWAYS REQUIREDmarkers and a boldCRITICALwarning line reduces missing-field errors by making the requirement unmissable.Zero code changes — pure prompt engineering that prevents ~10 crashes per day with non-OpenAI models.
Problem
Current prompt format:
These look like every other field in the list. Models that produce JSON sometimes skip them, resulting in:
{"thoughts": [...], "headline": "..."}Missing
tool_name→ agent can't identify the tool → crash → misformat warning → wasted turn.Solution
Add explicit markers that are impossible to miss:
Impact
Changes
prompts/agent.system.main.communication.mdTesting
Related