chore: sync from NousResearch/hermes-agent upstream - #17
Conversation
9bd5a51 to
ebd7acb
Compare
🔎 Lint report:
|
| Rule | Count |
|---|---|
unresolved-attribute |
1719 |
unresolved-import |
1648 |
invalid-argument-type |
1199 |
invalid-assignment |
532 |
unsupported-operator |
204 |
not-subscriptable |
149 |
invalid-parameter-default |
132 |
invalid-method-override |
103 |
invalid-return-type |
52 |
no-matching-overload |
34 |
call-non-callable |
29 |
unused-type-ignore-comment |
24 |
invalid-type-form |
18 |
unresolved-reference |
18 |
deprecated |
9 |
| +7 more rules |
First entries
tests/gateway/test_api_server_runs.py:16: [unresolved-import] unresolved-import: Cannot resolve imported module `aiohttp`
tests/gateway/test_session_hygiene.py:18: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
tests/agent/test_save_url_image.py:19: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
plugins/platforms/google_chat/adapter.py:2519: [invalid-method-override] invalid-method-override: Invalid override of method `send_document`: Definition is incompatible with `BasePlatformAdapter.send_document`
tests/test_tui_gateway_server.py:3798: [unresolved-attribute] unresolved-attribute: Unresolved attribute `get_model_context_length` on type `ModuleType`
tests/hermes_cli/test_nous_subscription.py:843: [invalid-argument-type] invalid-argument-type: Argument to function `apply_nous_managed_defaults` is incorrect: Expected `dict[str, object]`, found `dict[str, dict[str, str]]`
tests/run_agent/test_compressor_fallback_update.py:66: [unresolved-attribute] unresolved-attribute: Object of type `AIAgent` has no attribute `context_compressor`
tests/cli/test_cli_provider_resolution.py:92: [unresolved-attribute] unresolved-attribute: Unresolved attribute `ANSI` on type `ModuleType`
agent/curator.py:1633: [invalid-argument-type] invalid-argument-type: Argument to function `_build_rename_summary` is incorrect: Expected `set[str]`, found `set[Any | None]`
tests/agent/test_secret_scope.py:2: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
gateway/platforms/signal.py:1538: [invalid-parameter-default] invalid-parameter-default: Default value of type `None` is not assignable to annotated parameter type `MessageEvent`
tests/gateway/test_session_split_brain_11016.py:22: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
gateway/platforms/wecom_callback.py:134: [unresolved-attribute] unresolved-attribute: Attribute `AsyncClient` is not defined on `None` in union `Unknown | None`
tests/run_agent/test_init_fallback_on_exhausted_pool.py:3: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
skills/productivity/google-workspace/scripts/setup.py:427: [unresolved-import] unresolved-import: Cannot resolve imported module `google.auth.transport.requests`
tests/tools/test_managed_browserbase_and_modal.py:192: [invalid-assignment] invalid-assignment: Invalid subscript assignment with key of type `Literal["tools.environments.modal"]` and value of type `SimpleNamespace` on object of type `dict[str, ModuleType]`
tests/tools/test_web_tools_config.py:486: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `bound method str.__getitem__(key: SupportsIndex | slice[SupportsIndex | None, SupportsIndex | None, SupportsIndex | None], /) -> str` cannot be called with key of type `Literal["required"]` on object of type `str`
gateway/platforms/api_server.py:3760: [invalid-argument-type] invalid-argument-type: Method `__getitem__` of type `bound method Top[dict[Unknown, Unknown]].__getitem__(key: Never, /) -> object` cannot be called with key of type `Literal["content"]` on object of type `Top[dict[Unknown, Unknown]]`
tests/agent/test_set_runtime_main_custom_provider.py:221: [invalid-argument-type] invalid-argument-type: Argument to function `resolve_provider_client` is incorrect: Expected `str`, found `None`
tests/plugins/platforms/photon/test_reactions.py:38: [invalid-assignment] invalid-assignment: Object of type `def _fake_call(path: str, body: dict[str, Any]) -> CoroutineType[Any, Any, dict[str, Any]]` is not assignable to attribute `_sidecar_call` of type `def _sidecar_call(self, path: str, body: dict[str, Any]) -> CoroutineType[Any, Any, dict[str, Any]]`
tests/gateway/test_tts_media_routing.py:111: [invalid-assignment] invalid-assignment: Object of type `AsyncMock` is not assignable to attribute `send_voice` of type `def send_voice(self, chat_id: str, audio_path: str, caption: str | None = None, reply_to: str | None = None, metadata: dict[str, Any] | None = None, **kwargs) -> CoroutineType[Any, Any, SendResult]`
tests/hermes_cli/test_placeholder_usage.py:7: [unresolved-import] unresolved-import: Cannot resolve imported module `pytest`
run_agent.py:4870: [unresolved-attribute] unresolved-attribute: Object of type `Self@_supports_reasoning_extra_body` has no attribute `model`
tests/agent/test_copilot_acp_client.py:29: [invalid-argument-type] invalid-argument-type: Argument to bound method `CopilotACPClient._handle_server_message` is incorrect: Expected `Popen[str]`, found `_FakeProcess`
cli.py:9378: [invalid-argument-type] invalid-argument-type: Argument to bound method `InsightsEngine.generate` is incorrect: Expected `str`, found `None | str`
... and 5865 more
✅ Fixed issues: none
Unchanged: 0 pre-existing issues carried over.
Diagnostics are surfaced as warnings — this check never fails the build.
|
🚨 CRITICAL Supply Chain Risk DetectedThis PR contains a pattern that has been used in real supply chain attacks. A maintainer must review the flagged code carefully before merging. 🚨 CRITICAL: Install-hook file added or modifiedThese files can execute code during package installation or interpreter startup. Files: Scanner only fires on high-signal indicators: .pth files, base64+exec/eval combos, subprocess with encoded commands, or install-hook files. Low-signal warnings were removed intentionally — if you're seeing this comment, the finding is worth inspecting. |
…wns through chokepoint (NousResearch#53829) Follow-up to NousResearch#53791 addressing review feedback: the footgun checker treated capture_output=/stdout=/stderr=/check_output as proof a subprocess can't pop a Windows console. That invariant is false — stream redirection controls where a child's output goes, not whether a console is allocated. From a console-less parent (Desktop/Electron, pythonw.exe, detached gateway/cron) a console-subsystem child still flashes a window even when fully captured. - check-windows-footguns.py: capture/redirect/check_output is no longer a blanket safe-pass. Added _WINDOWS_FLASHING_PROGRAMS (git/gh/npm/node/python/uv/ffmpeg/ docker/powershell/…); calls to those are flagged even when captured. Non-flashing programs keep the capture exemption (no 271-site noise). _subprocess_compat.run/ popen calls are inherently safe (wrapper injects CREATE_NO_WINDOW). - Routed the 35 genuine flashing git/gh/npm/uv/ffmpeg/docker spawns through the _subprocess_compat.run/popen chokepoint (Brooklyn's wrapper from NousResearch#53810) — the durable fix, not per-site annotations. cmd.exe /c start stays # ok (intentional). - Updated tests + CONTRIBUTING.md rule #17 to the corrected invariant.
…wns through chokepoint (NousResearch#53829) Follow-up to NousResearch#53791 addressing review feedback: the footgun checker treated capture_output=/stdout=/stderr=/check_output as proof a subprocess can't pop a Windows console. That invariant is false — stream redirection controls where a child's output goes, not whether a console is allocated. From a console-less parent (Desktop/Electron, pythonw.exe, detached gateway/cron) a console-subsystem child still flashes a window even when fully captured. - check-windows-footguns.py: capture/redirect/check_output is no longer a blanket safe-pass. Added _WINDOWS_FLASHING_PROGRAMS (git/gh/npm/node/python/uv/ffmpeg/ docker/powershell/…); calls to those are flagged even when captured. Non-flashing programs keep the capture exemption (no 271-site noise). _subprocess_compat.run/ popen calls are inherently safe (wrapper injects CREATE_NO_WINDOW). - Routed the 35 genuine flashing git/gh/npm/uv/ffmpeg/docker spawns through the _subprocess_compat.run/popen chokepoint (Brooklyn's wrapper from NousResearch#53810) — the durable fix, not per-site annotations. cmd.exe /c start stays # ok (intentional). - Updated tests + CONTRIBUTING.md rule #17 to the corrected invariant.
Automated upstream sync from NousResearch/hermes-agent into pai-scaffolde/hermes-agent.
This branch is
upstream/mainwith the PAI patch series rebased on top —a linear patch stack, no merge commits. Review the diff and let CI run here.
Policy:
mainto this branch — do NOT use the green"Merge" button (a merge commit reintroduces the dual-history problem).
From a clean checkout:
manual rerun because workflow-created pushes do not always trigger
downstream workflows.
failed job log and force-update
maindirectly.Source: