fix(skills): use profile-aware skills dir in skill_utils normalization - #60231
Closed
isheng-eqi wants to merge 6 commits into
Closed
fix(skills): use profile-aware skills dir in skill_utils normalization#60231isheng-eqi wants to merge 6 commits into
isheng-eqi wants to merge 6 commits into
Conversation
The gateway already strips stale dangerous-confirmation text from replayed history (NousResearch#60110, NousResearch#60117 — fix for NousResearch#59607). The TUI gateway has two session resume paths that sanitize replay history but do not strip stale dangerous confirmations, leaving the same vulnerability unaddressed in TUI sessions. Add strip_stale_dangerous_confirmations() after sanitize_replay_history() in both TUI resume paths (resume_session and the WebUI resume path). Refs: NousResearch#59607, NousResearch#60110, NousResearch#60117
The recent Discord resource-bounding pass (NousResearch#60122, NousResearch#60112, NousResearch#60113) added limits for REST JSON/error response bodies and component label UTF-16 lengths. Four HTTP response reads for image/animation/attachment downloads were left unbounded — an oversized response from a CDN or external URL could OOM the bot. Add _DISCORD_IMAGE_DOWNLOAD_MAX_BYTES (50 MB) and _DISCORD_ATTACHMENT_DOWNLOAD_MAX_BYTES (100 MB) constants, a shared _read_response_bytes_bounded() helper, and apply bounds to: - Batch image download (adapter.py ~2467) - Single image download (adapter.py ~3555) - Animation/GIF download (adapter.py ~3634) - Attachment download (adapter.py ~5799) Refs: NousResearch#60122, NousResearch#60112
The profile-aware skills resolution fix (NousResearch#60180) added _skills_dir() to tools/skills_tool.py and tools/skill_manager_tool.py so that long-lived multi-profile runtimes always resolve the live profile-scoped HERMES_HOME. agent/skill_utils.py still referenced the module-level SKILLS_DIR constant, which would return stale import-time paths in the same long-lived runtimes. Replace _skills_tool.SKILLS_DIR with _skills_tool._skills_dir() in the normalize_skill_identifier() path, matching the pattern established in NousResearch#60180. Tests that patch SKILLS_DIR are unaffected — _skills_dir() falls back to the patched value when it differs from _SKILLS_DIR_AT_IMPORT. Refs: NousResearch#60180, NousResearch#40677
1 task
Closed
2 tasks
Contributor
Author
|
Consolidating into one comprehensive profile-awareness 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.
What does this PR do?
agent/skill_utils.pystill references the module-levelSKILLS_DIRconstant, while #60180 added_skills_dir()for call-time resolution. Skill path normalization in long-lived multi-profile runtimes uses the wrong profile's skills directory.Related Issue
Fixes sibling path of #60180 (profile-aware skills resolution, #40677).
Type of Change
Changes Made
agent/skill_utils.py: Replace_skills_tool.SKILLS_DIRwith_skills_tool._skills_dir()innormalize_skill_identifier()