@@ -159,26 +159,11 @@ def __init__(self, config: WorkspaceConfigType):
159
159
super ().__init__ ()
160
160
self .id = generate_id ()
161
161
self .access_token = uuid4 ().hex .replace ("-" , "" )
162
- self .composio_api_key = _read_env_var (
163
- name = ENV_COMPOSIO_API_KEY ,
164
- default = config .composio_api_key ,
165
- )
166
- self .composio_base_url = _read_env_var (
167
- name = ENV_COMPOSIO_BASE_URL ,
168
- default = config .composio_base_url ,
169
- )
170
- self .github_access_token = config .github_access_token or os .environ .get (
171
- ENV_GITHUB_ACCESS_TOKEN , "NO_VALUE"
172
- )
162
+ self .persistent = config .persistent
173
163
self .environment = {
174
164
** (config .environment or {}),
175
- ENV_COMPOSIO_API_KEY : self .composio_api_key ,
176
- ENV_COMPOSIO_BASE_URL : self .composio_base_url ,
177
- ENV_GITHUB_ACCESS_TOKEN : self .github_access_token ,
178
- f"_COMPOSIO_{ ENV_GITHUB_ACCESS_TOKEN } " : self .github_access_token ,
179
165
ENV_ACCESS_TOKEN : self .access_token ,
180
166
}
181
- self .persistent = config .persistent
182
167
183
168
def __str__ (self ) -> str :
184
169
"""String representation."""
@@ -220,6 +205,31 @@ def teardown(self) -> None:
220
205
class RemoteWorkspace (Workspace ):
221
206
"""Remote workspace client."""
222
207
208
+ def __init__ (self , config : WorkspaceConfigType ):
209
+ super ().__init__ (config )
210
+ self .composio_api_key = _read_env_var (
211
+ name = ENV_COMPOSIO_API_KEY ,
212
+ default = config .composio_api_key ,
213
+ )
214
+ self .composio_base_url = _read_env_var (
215
+ name = ENV_COMPOSIO_BASE_URL ,
216
+ default = config .composio_base_url ,
217
+ )
218
+ self .github_access_token = (
219
+ config .github_access_token
220
+ if config .github_access_token is not None
221
+ else os .environ .get (ENV_GITHUB_ACCESS_TOKEN , "NO_VALUE" )
222
+ )
223
+ self .environment .update (
224
+ {
225
+ ENV_COMPOSIO_API_KEY : self .composio_api_key ,
226
+ ENV_COMPOSIO_BASE_URL : self .composio_base_url ,
227
+ ENV_GITHUB_ACCESS_TOKEN : self .github_access_token ,
228
+ f"_COMPOSIO_{ ENV_GITHUB_ACCESS_TOKEN } " : self .github_access_token ,
229
+ ENV_ACCESS_TOKEN : self .access_token ,
230
+ }
231
+ )
232
+
223
233
def _request (
224
234
self ,
225
235
endpoint : str ,
0 commit comments