Skip to content

Commit d6aea78

Browse files
bokelleyclaude
andcommitted
fix: add type: ignore for MCP session return values
Add type: ignore[return-value] annotations to handle Any return from session storage while maintaining proper ClientSession type hints. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 1d09f2f commit d6aea78

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/adcp/protocols/mcp.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,15 @@ def __init__(self, *args: Any, **kwargs: Any):
4040
self._session: Any = None
4141
self._exit_stack: Any = None
4242

43-
async def _get_session(self) -> ClientSession: # type: ignore[name-defined]
43+
async def _get_session(self) -> ClientSession:
4444
"""
4545
Get or create MCP client session with URL fallback handling.
4646
4747
Raises:
4848
ADCPConnectionError: If connection to agent fails
4949
"""
5050
if self._session is not None:
51-
return self._session
51+
return self._session # type: ignore[return-value]
5252

5353
logger.debug(f"Creating MCP session for agent {self.agent_config.id}")
5454

@@ -112,7 +112,7 @@ async def _get_session(self) -> ClientSession: # type: ignore[name-defined]
112112
f"(configured: {self.agent_config.agent_uri})"
113113
)
114114

115-
return self._session
115+
return self._session # type: ignore[return-value]
116116
except Exception as e:
117117
last_error = e
118118
# Clean up the exit stack on failure to avoid async scope issues

0 commit comments

Comments
 (0)