Skip to content

fix(octop): guard rglob with OSError in plugin manager fingerprint and skill upload - #2662

Closed
TrueFurina wants to merge 1 commit into
TencentCloud:mainfrom
TrueFurina:r74-manager-rglob-oserror
Closed

TrueFurina wants to merge 1 commit into
TencentCloud:mainfrom
TrueFurina:r74-manager-rglob-oserror

Conversation

@TrueFurina

Copy link
Copy Markdown

Summary

Wrap two Path.rglob() calls in infra/agents/plugins/manager.py with try/except OSError. One file, one commit.

Changes

_channel_fingerprint() - rglob(*) on a plugin directory

Computes a SHA-256 hash of every file under the plugin dir to detect changes. Previously crashed if the plugin dir passed is_dir() but raised OSError during recursive traversal. Now returns the hash of an empty input (e3b0c442...) on failure, which means the plugin is treated as unchanged - a safe degradation.

Plugin install skill upload - rglob(*) on a skill directory

Iterates all files under a skill_dir to build the workspace upload pairs list (SKILL.md, references/, scripts/, etc.). Previously crashed during plugin install if a skill dir was unreadable. Now degrades to an empty pairs list on OSError; the skill install proceeds with whatever other data was already collected.

Pattern

Extends the round 73 glob/rglob sweep. Next targets: system_archive.py (backup pack + extract rglob), ollama_manager.py manifest rglob, setup.py chromium cache glob, and the harness fastmcp scaffold glob.

…d upload

Two Path.rglob() calls on plugin/skill directories that may pass is_dir() checks yet fail on Windows due to ACL restrictions, antivirus locks, or transient handles.

1. _channel_fingerprint(): recursively walks a plugin directory to compute a content hash. On OSError return a deterministic empty fingerprint (hash of nothing = e3b0c442...), so the plugin is treated as unchanged rather than crashing the plugin manager.

2. Plugin install skill upload loop: iterates skill_dir.rglob(*) to pack all skill files into the workspace upload pairs list. On OSError fall back to an empty list (no skill files to upload).

Continues the Path.glob()/rglob() defensive sweep started in round 73.
@jubaoliang jubaoliang closed this Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants