You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary: sgr_deep_research/core/agents/sgr_so_tool_calling_agent.py currently feeds raw dicts/unchecked completions into the OpenAI streaming APIs, so Pylance fires reportArgumentType, reportAssignmentType, and reportOptionalSubscript errors (lines 48, 53‑66, 85).
Problems:
tool_choice is a plain dict, but the API expects ChatCompletionToolChoiceOptionParam.
The code indexes choices[0].message.tool_calls[0].function.parsed_arguments without null guards, so ReasoningTool may be assigned from object | None, and subscripting None is invalid.
The second pass assumes stream.get_final_completion() always returns a ReasoningTool, but it can be None, so the assignment is unsafe.
reasoning.tool_name is str | None, but add_tool_call expects a str, so we end up calling it with None.
Suggestion: add explicit null/empty guards, use the typed tool_choice, validate that parsed arguments are a ReasoningTool, and ensure tool_name is non-null before logging.
Description:
Summary: sgr_deep_research/core/agents/sgr_so_tool_calling_agent.py currently feeds raw dicts/unchecked completions into the OpenAI streaming APIs, so Pylance fires reportArgumentType, reportAssignmentType, and reportOptionalSubscript errors (lines 48, 53‑66, 85).
Problems:
Suggestion: add explicit null/empty guards, use the typed tool_choice, validate that parsed arguments are a ReasoningTool, and ensure tool_name is non-null before logging.