Skip to content

Bug: NoneType error in run_agent.py _build_api_kwargs #7241

@topspeedzhang

Description

@topspeedzhang

Description
In run_agent.py line 5522, _build_api_kwargs() calls:

fast_mode=self.request_overrides.get("speed") == "fast",

This crashes with 'NoneType' object has no attribute 'get' when self.request_overrides is None.

Root Cause
Although __init__ initializes self.request_overrides = dict(request_overrides or {}), certain code paths may set it to None, leaving the .get() call unprotected.

Fix
Change line 5522 from:

fast_mode=self.request_overrides.get("speed") == "fast",

to:

fast_mode=(self.request_overrides or {}).get("speed") == "fast",

Affected Version
v0.8.0

Logs

ERROR root: API call failed after 3 retries. 'NoneType' object has no attribute 'get' | provider=minimax-cn model=MiniMax-M2.7

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Medium — degraded but workaround existscomp/agentCore agent loop, run_agent.py, prompt buildersweeper:implemented-on-mainSweeper: behavior already present on current maintype/bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions