fix(agent): drop tool_calls key when all tool_calls are deduplicated (#70126) - #70176
Closed
ms-alan wants to merge 3 commits into
Closed
fix(agent): drop tool_calls key when all tool_calls are deduplicated (#70126)#70176ms-alan wants to merge 3 commits into
ms-alan wants to merge 3 commits into
Conversation
added 3 commits
July 24, 2026 00:08
Closes NousResearch#70146 When hermes sessions optimize-storage runs and the database grows (rather than shrinks), the old code always printed '(reclaimed X MB)' with a negative value. Fix by using a conditional label: - positive delta → 'reclaimed X MB' - negative delta → 'grew by X MB'
…upes Closes NousResearch#70126 sanitize_api_messages() Step 3 deduplication creates tool_calls: [] when every tool_call in a turn has a duplicate id. This empty array then passes through to strict OpenAI-compatible providers (Qwen-series) which reject it with HTTP 400. Fix: when kept_tcs is empty after dedup, drop the tool_calls key entirely instead of setting it to []. This matches the behavior already present in the separate empty-tool_calls cleanup step (lines 2736-2747) and ensures byte-stable persisted history.
…odels GLM models (glm-4, glm-4-plus, etc.) use the same reasoning_effort: ultra parameter as GPT-5.6 ultra. The _reasoning_config_for_model function was only checking for gpt-5.6, causing GLM reasoning effort to be sent as raw string 'ultra' instead of the normalized integer. This fixes the mismatch for GLM model families. Closes NousResearch#70058
Collaborator
Duplicate of #64345 for the same sanitize_api_messages dedup-output empty-tool_calls fix. This PR also bundles unrelated transport and CLI display changes; please consolidate the focused repair with the canonical PR. |
This was referenced Aug 3, 2026
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.
Closes #70126
sanitize_api_messages() Step 3 deduplication creates tool_calls: []
when every tool_call in a turn has a duplicate id. This empty array
then passes through to strict OpenAI-compatible providers (Qwen-series)
which reject it with HTTP 400. Fix: when kept_tcs is empty after
dedup, drop the tool_calls key entirely instead of setting it to []. This
matches the behavior already present in the separate empty-tool_calls
cleanup step (lines 2736-2747) and ensures byte-stable persisted history.