Commit Graph

22 Commits

Author SHA1 Message Date
Sarah Wooders
7c1da1e9e2 feat: add TypeScript tool support for E2B sandbox execution (#8796)
* feat: add TypeScript tool support for E2B sandbox execution

This change implements TypeScript tool support using the same E2B path as Python tools:

- Add TypeScript execution script generator (typescript_generator.py)
- Modify E2B sandbox to detect TypeScript tools and use language='ts'
- Add npm package installation for TypeScript tool dependencies
- Add validation requiring json_schema for TypeScript tools
- Add comprehensive integration tests for TypeScript tools

TypeScript tools:
- Require explicit json_schema (no docstring parsing)
- Use JSON serialization instead of pickle for results
- Support async functions with top-level await
- Support npm package dependencies via npm_requirements field

Closes #8793

Co-authored-by: Sarah Wooders <sarahwooders@users.noreply.github.com>

* fix: disable AgentState for TypeScript tools & add letta-client injection

Based on Sarah's feedback:
1. AgentState is a legacy Python-only feature, disabled for TS tools
2. Added @letta-ai/letta-client npm package injection for TypeScript
   (similar to letta_client for Python)

Changes:
- base.py: Explicitly set inject_agent_state=False for TypeScript tools
- typescript_generator.py: Inject LettaClient initialization code
- e2b_sandbox.py: Auto-install @letta-ai/letta-client for TS tools
- Added tests verifying both behaviors

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Sarah Wooders <sarahwooders@users.noreply.github.com>
Co-Authored-By: Letta <noreply@letta.com>

* Update core-integration-tests.yml

* fix: convert TypeScript test fixtures to async

The OrganizationManager and UserManager no longer have sync methods,
only async variants. Updated all fixtures to use:
- create_organization_async
- create_actor_async
- create_or_update_tool_async

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* fix: skip Python AST parsing for TypeScript tools in sandbox base

The _init_async method was calling parse_function_arguments (which uses
Python's ast.parse) before checking if the tool was TypeScript, causing
SyntaxError when running TypeScript tools.

Moved the is_typescript_tool() check to happen first, skipping Python
AST parsing entirely for TypeScript tools.

🤖 Generated with [Letta Code](https://letta.com)

Co-Authored-By: Letta <noreply@letta.com>

* letta_agent_id

* skip ast parsing for s

* add tool execution test

---------

Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com>
Co-authored-by: Sarah Wooders <sarahwooders@users.noreply.github.com>
Co-authored-by: Letta <noreply@letta.com>
Co-authored-by: Kian Jones <kian@letta.com>
2026-01-19 15:54:43 -08:00
jnjpng
714c537dc5 chore: change e2b sandbox error logs from debug to warning (#6726)
Update log level for tool execution errors in e2b sandbox from debug
to warning for better visibility when troubleshooting issues.

Co-authored-by: Jin Peng <jinjpeng@users.noreply.github.com>
2025-12-15 12:02:34 -08:00
Sarah Wooders
c4d5c380d6 feat: pass in LETTA_TOOL_ID, LETTA_AGENT_ID, LETTA_PROJECT_ID into tool env (#6439) 2025-12-15 12:02:18 -08:00
Kian Jones
b9f1c6aece fix(e2b): add monitoring and alerting for e2b (#5935)
* add e2b sandbox template variable to env for now. (may need to pull from secrets to have syncing in future)

* upgrade from info to warning

* apps

* e2b execution time
2025-11-13 15:36:50 -08:00
Sarah Wooders
18abcc7025 feat: patch integration test for sandbox [LET-4509] (#4962)
* patch integration test

* create default user and org

* rm

* patch
2025-10-07 17:50:46 -07:00
cthomas
00292363c4 feat: add additional e2b debug logging (#4772) 2025-10-07 17:50:43 -07:00
Kian Jones
b8e9a80d93 merge this (#4759)
* wait I forgot to comit locally

* cp the entire core directory and then rm the .git subdir
2025-09-17 15:47:40 -07:00
Kian Jones
22f70ca07c chore: officially migrate to submodule (#4502)
* remove apps/core and apps/fern

* fix precommit

* add submodule updates in workflows

* submodule

* remove core tests

* update core revision

* Add submodules: true to all GitHub workflows

- Ensure all workflows can access git submodules
- Add submodules support to deployment, test, and CI workflows
- Fix YAML syntax issues in workflow files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

* remove core-lint

* upgrade core with latest main of oss

---------

Co-authored-by: Claude <noreply@anthropic.com>
2025-09-09 12:45:53 -07:00
Charles Packer
0130e9b6e8 fix: reduce error levels to patch the sentry logging issue (#3835) 2025-08-08 22:15:10 -07:00
Andy Li
73e74270f4 feat: modal sandbox 2025-07-30 11:25:40 -07:00
cthomas
41aa8cc63f feat: asyncify jinja templates (#3580) 2025-07-26 23:17:24 -07:00
Matthew Zhou
a197e2376a feat: Add explicit kill statement on e2b (#3462) 2025-07-21 15:15:05 -07:00
Matthew Zhou
7616af9145 feat: Add async support for local/e2b sandbox (#2981) 2025-06-23 19:47:19 -07:00
Matthew Zhou
2e77ea6e76 feat: Add optional pip requirements to tool object (#2793) 2025-06-13 13:20:36 -07:00
Andy Li
d2252f2953 feat: otel metrics and expanded collecting (#2647)
(passed tests in last run)
2025-06-05 17:20:14 -07:00
Andy Li
28c3624a88 fix: numerous tool execution bugs (#2371) 2025-05-23 18:02:15 -07:00
cthomas
6c4c95df1c feat(asyncify): e2b sandbox module (#2360) 2025-05-22 23:37:08 -07:00
Matthew Zhou
8c80eb8475 chore: Add more telemetry and confirm that e2b async latency is acceptable (#2278) 2025-05-20 14:19:51 -07:00
Matthew Zhou
71bc0eabac chore: Add instrumentation to async E2B (#2273) 2025-05-20 11:47:37 -07:00
cthomas
e599610629 feat: add tool execution result object (#1837) 2025-04-22 11:30:36 -07:00
Matthew Zhou
24312d4c6d feat: Factor out database access unless necessary in Tool Sandboxes (#1711) 2025-04-14 18:00:15 -07:00
Matthew Zhou
25b106d1cd feat: Support natively async e2b (#1512) 2025-04-01 14:28:24 -07:00