Fix: Handle None request_overrides in gateway/run.py - #7281
Closed
matt-legrand wants to merge 1 commit into
Closed
Conversation
When service_tier is empty/falsy, turn_route.get('request_overrides') returns None.
This None bypasses the safe dict() initialization in run_agent.py constructor,
causing AttributeError when _build_api_kwargs() calls .get() on None.
Fix: use 'or {}' fallback to ensure request_overrides is always a dict.
Fixes: NousResearch#7259
matt-legrand
force-pushed
the
fix/request-overrides-none
branch
from
April 10, 2026 16:54
7cd7732 to
2b63c25
Compare
Collaborator
Contributor
|
Thanks for the focused fix. This is an automated hermes-sweeper review; the requested None-safety is already implemented on current
The member note identifying #7350 as the duplicate is confirmed. |
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.
Summary
Fixes
AttributeError: 'NoneType' object has no attribute 'get'whenrequest_overridesisNoneingateway/run.py.Root Cause
When
service_tieris empty/falsy,_resolve_turn_route()setsroute['request_overrides'] = None. ThisNoneis then directly assigned toagent.request_overridesat line 6974, bypassing the safedict()initialization inrun_agent.pyline 678.Later,
_build_api_kwargs()at line 5522 callsself.request_overrides.get('speed')which crashes onNone.Fix
This ensures
request_overridesis always a dict, matching the constructor's safe initialization.Testing
AttributeErroron local Hermes instancerequest_overridesis properly populatedCredits
Issue identified by
@li3500764in issue #7259.