Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: e2e test for injected keys (#6196)

Shubham Naika3dfdb19819f
diff --git a/letta/services/tool_executor/sandbox_tool_executor.py b/letta/services/tool_executor/sandbox_tool_executor.py
index 656d4dc70..500b3eb2f 100644
--- a/letta/services/tool_executor/sandbox_tool_executor.py
+++ b/letta/services/tool_executor/sandbox_tool_executor.py
@@ -53,6 +53,11 @@ class SandboxToolExecutor(ToolExecutor):
# Merge fetched credentials with provided sandbox_env_vars
if sandbox_env_vars is None:
sandbox_env_vars = {}
+
+ # inject some extra env such as PROJECT_ID from agent_state
+ if agent_state and agent_state.project_id:
+ fetched_credentials["PROJECT_ID"] = agent_state.project_id
+
sandbox_env_vars = {**fetched_credentials, **sandbox_env_vars}
try: