mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-04-28 01:21:43 +00:00
fix: resolve all invalid-return-type ty diagnostics across codebase
Widen return type annotations to match actual control flow, add unreachable assertions after retry loops ty cannot prove terminate, split ambiguous union returns (auth.py credential pool), and remove the AIOHTTP_AVAILABLE conditional-import guard from api_server.py.
This commit is contained in:
parent
d3dde0b459
commit
224e6d46d9
23 changed files with 102 additions and 103 deletions
|
|
@ -891,7 +891,7 @@ BROWSER_TOOL_SCHEMAS = [
|
|||
# Utility Functions
|
||||
# ============================================================================
|
||||
|
||||
def _create_local_session(task_id: str) -> Dict[str, str]:
|
||||
def _create_local_session(task_id: str) -> Dict[str, Any]:
|
||||
import uuid
|
||||
session_name = f"h_{uuid.uuid4().hex[:10]}"
|
||||
logger.info("Created local browser session %s for task %s",
|
||||
|
|
@ -904,7 +904,7 @@ def _create_local_session(task_id: str) -> Dict[str, str]:
|
|||
}
|
||||
|
||||
|
||||
def _create_cdp_session(task_id: str, cdp_url: str) -> Dict[str, str]:
|
||||
def _create_cdp_session(task_id: str, cdp_url: str) -> Dict[str, Any]:
|
||||
"""Create a session that connects to a user-supplied CDP endpoint."""
|
||||
import uuid
|
||||
session_name = f"cdp_{uuid.uuid4().hex[:10]}"
|
||||
|
|
@ -918,7 +918,7 @@ def _create_cdp_session(task_id: str, cdp_url: str) -> Dict[str, str]:
|
|||
}
|
||||
|
||||
|
||||
def _get_session_info(task_id: Optional[str] = None) -> Dict[str, str]:
|
||||
def _get_session_info(task_id: Optional[str] = None) -> Dict[str, Any]:
|
||||
"""
|
||||
Get or create session info for the given task.
|
||||
|
||||
|
|
@ -1678,7 +1678,7 @@ def browser_scroll(direction: str, task_id: Optional[str] = None) -> str:
|
|||
from tools.browser_camofox import camofox_scroll
|
||||
# Camofox REST API doesn't support pixel args; use repeated calls
|
||||
_SCROLL_REPEATS = 5
|
||||
result = None
|
||||
result: str = ""
|
||||
for _ in range(_SCROLL_REPEATS):
|
||||
result = camofox_scroll(direction, task_id)
|
||||
return result
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue