Skip to content

change: enable ruff/ty#19908

Merged
ethernet8023 merged 2 commits into
mainfrom
typecheck
May 6, 2026
Merged

change: enable ruff/ty#19908
ethernet8023 merged 2 commits into
mainfrom
typecheck

Conversation

@ethernet8023

@ethernet8023 ethernet8023 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

Enable typechecking via ty.
This catches tons of real issues with the codebase.
This doesn't fix any issues ATM, nor does it cause any new CI failures. This is informative-only at the moment.

Related Issue

HACORE-1

Type of Change

  • 🐛 Bug fix (non-breaking change that fixes an issue)
  • ✨ New feature (non-breaking change that adds functionality)
  • 🔒 Security fix
  • 📝 Documentation update
  • ✅ Tests (adding or improving test coverage)
  • ♻️ Refactor (no behavior change)
  • 🎯 New skill (bundled or hub)

Changes Made

  • Added a CI job for ruff/ty.

How to Test

  1. Open a PR
  2. Check the posted comment for typecheck changes!

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

🔎 Lint report: typecheck vs origin/main

ruff

Total: 0 on HEAD, 0 on base (➖ 0)

🆕 New issues: none

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

ty (type checker)

Total: 7387 on HEAD, 0 on base (🆕 +7387)

🆕 New issues (3884):

Rule Count
unresolved-import 1201
invalid-argument-type 883
unresolved-attribute 849
invalid-assignment 438
unsupported-operator 118
invalid-parameter-default 118
not-subscriptable 81
invalid-method-override 55
invalid-return-type 34
no-matching-overload 31
call-non-callable 27
unresolved-reference 20
invalid-type-form 13
unused-type-ignore-comment 4
possibly-missing-submodule 3
+6 more rules
First entries
tests/tools/test_mcp_tool_401_handling.py:13: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/gateway/test_weak_credential_guard.py:10: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/hermes_cli/test_kanban_core_functionality.py:1183: [invalid-assignment] invalid-assignment: Object of type `(pid) -> Literal[False]` is not assignable to attribute `_pid_alive` of type `def _pid_alive(pid: int | None) -> bool`
tools/mcp_oauth_manager.py:181: [unresolved-import] unresolved-import: Cannot resolve imported module `mcp.client.auth.utils`
tests/tools/test_vercel_sandbox_environment.py:206: [unresolved-attribute] unresolved-attribute: Unresolved attribute `SandboxStatus` on type `ModuleType`
batch_runner.py:36: [unresolved-import] unresolved-import: Cannot resolve imported module `fire`
gateway/platforms/dingtalk.py:956: [unresolved-attribute] unresolved-attribute: Attribute `DeliverCardRequestImGroupOpenDeliverModel` is not defined on `None` in union `Unknown | None`
tests/hermes_cli/test_ignore_user_config_flags.py:23: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/gateway/test_unknown_command.py:322: [unresolved-attribute] unresolved-attribute: Attribute `args` is not defined on `None` in union `_Call | None`
plugins/memory/hindsight/__init__.py:1216: [unresolved-import] unresolved-import: Cannot resolve imported module `hindsight_embed.daemon_embed_manager`
cli.py:9582: [unsupported-operator] unsupported-operator: Operator `+` is not supported between objects of type `Literal["[Voice input — respond concisely and conversationally, 2-3 sentences max. No code blocks or markdown.] "]` and `(Unknown & ~str) | list[dict[str, Any]] | str`
tests/gateway/test_auth_fallback.py:6: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/gateway/test_telegram_network.py:18: [unresolved-import] unresolved-import: Cannot resolve imported module `httpx`
tests/agent/test_models_dev.py:111: [invalid-argument-type] invalid-argument-type: Argument to function `_extract_context` is incorrect: Expected `dict[str, Any]`, found `Literal["not a dict"]`
hermes_cli/banner.py:21: [unresolved-import] unresolved-import: Cannot resolve imported module `prompt_toolkit`
tests/tools/test_kanban_tools.py:646: [unresolved-attribute] unresolved-attribute: Attribute `id` is not defined on `None` in union `Run | None`
tests/run_agent/test_anthropic_error_handling.py:470: [invalid-assignment] invalid-assignment: Object of type `(messages, history=None) -> None` is not assignable to attribute `_persist_session` of type `def _persist_session(self, messages: list[dict[Unknown, Unknown]], conversation_history: list[dict[Unknown, Unknown]] = None) -> Unknown`
hermes_state.py:511: [unresolved-attribute] unresolved-attribute: Attribute `commit` is not defined on `None` in union `Connection | None`
cli.py:12221: [invalid-parameter-default] invalid-parameter-default: Default value of type `None` is not assignable to annotated parameter type `str | list[str] | tuple[str, ...]`
tests/acp/test_events.py:10: [unresolved-import] unresolved-import: Cannot resolve imported module `acp.schema`
tests/gateway/test_webhook_deliver_only.py:24: [unresolved-import] unresolved-import: Cannot resolve imported module `aiohttp.test_utils`
tests/gateway/test_weixin.py:391: [invalid-assignment] invalid-assignment: Object of type `AsyncMock` is not assignable to attribute `_send_file` of type `def _send_file(self, chat_id: str, path: str, caption: str, force_file_attachment: bool = False) -> CoroutineType[Any, Any, str]`
gateway/mirror.py:172: [invalid-argument-type] invalid-argument-type: Argument to bound method `SessionDB.append_message` is incorrect: Expected `str`, found `Unknown | None`
tests/tools/test_ssh_bulk_upload.py:8: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/gateway/test_teams.py:82: [unresolved-attribute] unresolved-attribute: Unresolved attribute `ClientOptions` on type `ModuleType`
... and 3859 more

✅ Fixed issues: none

Unchanged: 0 pre-existing issues carried over.

Diagnostics are surfaced as warnings — this check never fails the build.

@alt-glitch alt-glitch added P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change labels May 4, 2026
@ethernet8023 ethernet8023 marked this pull request as ready for review May 6, 2026 14:55
@ethernet8023 ethernet8023 merged commit a345f7b into main May 6, 2026
13 of 14 checks passed
@ethernet8023 ethernet8023 deleted the typecheck branch May 6, 2026 18:43
JinyuID pushed a commit to JinyuID/hermes-agent that referenced this pull request May 11, 2026
jsboige pushed a commit to jsboige/hermes-agent that referenced this pull request May 14, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Egavasyug pushed a commit to Egavasyug/hermes-agent that referenced this pull request Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

P3 Low — cosmetic, nice to have type/refactor Code restructuring, no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants