Skip to content

Commit 0cce3d8

Browse files
fix: use App.lookup for Modal sandbox from Cloud Run
1 parent 4a8c973 commit 0cce3d8

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/policyengine_api/agent_sandbox.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ def run_claude_code_in_sandbox(
5050
}}
5151
}}"""
5252

53+
# Get reference to deployed app (required when calling from outside Modal)
54+
sandbox_app = modal.App.lookup("policyengine-sandbox", create_if_missing=True)
55+
5356
sb = modal.Sandbox.create(
57+
app=sandbox_app,
5458
image=sandbox_image,
5559
secrets=[anthropic_secret, logfire_secret],
5660
timeout=600,

0 commit comments

Comments
 (0)