fix: clean up agent workspace directory on delete - #210
Merged
jubaoliang merged 1 commit intoAug 9, 2026
Merged
Conversation
4 tasks
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.
Fix: clean up agent workspace directory on delete
Summary
修复删除 Agent 时工作区残留问题。之前删除 Agent 只移除 harness 运行时和数据库记录,
~/.octop/agents/<agent_id>/目录会残留在磁盘上,随时间积累大量孤儿文件(agent 记忆、会话等)。What does this PR change and why?
Important Note
本次修改不涉及任何记忆层/数据库结构变更,仅补全删除 Agent 时应有的磁盘清理。
Target branch
main(release/* or hotfix/* only)develop(feature / fix - default)Type of change
Detailed change list
src/octop/infra/agents/manager.py
import shutilshutil.rmtree清理~/.octop/agents/<agent_id>/工作区目录src/octop/cli/support/offline_ops.py
import logging、import shutil与模块级 loggertests/unit/agents/test_agent_manager.py
Test plan
运行测试
功能验证
~/.octop/agents/<agent_id>/目录随 Agent 删除一并移除Checklist
Security / Safety Notes