fix(plugins): correct sys.path depth in discord/raft platform adapters - #49604
Closed
mojotiger608 wants to merge 1 commit into
Closed
fix(plugins): correct sys.path depth in discord/raft platform adapters#49604mojotiger608 wants to merge 1 commit into
mojotiger608 wants to merge 1 commit into
Conversation
Collaborator
|
Duplicate of #49431 — identical fix ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
plugins/platforms/discord/adapter.pyandplugins/platforms/raft/adapter.pyboth insert the repo root onto
sys.pathvia:This is correct for adapters at
gateway/platforms/<name>.py(3 levelsdeep, where
parents[2]is the repo root), but discord/raft live onelevel deeper at
plugins/platforms/<name>/adapter.py, soparents[2]resolves to the
plugins/directory instead of the repo root.Since
discord-platformandraft-platformarekind: platformandauto-load unconditionally on every
PluginManager.discover_and_load()call (no opt-in required), this silently inserts
plugins/atsys.path[0]on every process that runs plugin discovery — which iseffectively every hermes-agent / hermes-webui startup.
From that point on, any
import cronin the same process resolves toplugins/cron/__init__.py(the bundled cron-provider discovery shim,which has no
jobs.py/scheduler.py) instead of the real top-levelcron/scheduler package — causingModuleNotFoundError: No module named 'cron.jobs'anywhere downstreamthat does
from cron.jobs import ...afterward (e.g.tools/cronjob_tools.py, hermes-webui's/api/cronsendpoint).Fix
Change
parents[2]toparents[3]in both files, matching the actualnesting depth (
plugins/platforms/<name>/adapter.pyis 4 levels belowthe repo root). Verified both files immediately follow with
from gateway.config import .../from gateway.platforms.base import ...,confirming the intent was always the repo root.
Verification
Reproduced and fixed in isolation: