Dispose 清理资源
()
| 158 | |
| 159 | // Dispose 清理资源 |
| 160 | func (vs *VolcengineSandbox) Dispose() error { |
| 161 | if vs.sessionID == "" { |
| 162 | return nil |
| 163 | } |
| 164 | |
| 165 | // 终止沙箱会话 |
| 166 | _, err := vs.mcpClient.CallTool(context.Background(), "computer_terminate", map[string]any{ |
| 167 | "session_id": vs.sessionID, |
| 168 | }) |
| 169 | |
| 170 | return err |
| 171 | } |
| 172 | |
| 173 | // initSession 初始化沙箱会话 |
| 174 | func (vs *VolcengineSandbox) initSession(ctx context.Context) error { |
no test coverage detected