Commit Graph

49 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
e56c5c5b49 fix: global sandbox environment variables not injected on tool execution (#8310)
* base

* test
2026-01-12 10:57:48 -08:00
jnjpng
25d75d6528 fix: update aysnc get plaintext callsites (#7069)
* base

* resolve

* fix

* fix
2025-12-17 17:31:02 -08:00
jnjpng
4be813b956 fix: migrate sandbox and agent environment variables to encrypted only (#6623)
* base

* remove unnnecessary db migration

* update

* fix

* update

* update

* comments

* fix

* revert

* anotha

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:03:08 -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
jnjpng
e5bda413c0 fix: agent environment variables not using encrypted values (#6520)
* base

* clean up

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Sarah Wooders
86023db9b1 feat: get rid of client injection in args and just make it always available (#6459) 2025-12-15 12:02:19 -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
Sarah Wooders
0a0cf391fc fix: fix client injection code (#6421) 2025-12-15 12:02:18 -08:00
Sarah Wooders
f7ade17c4a feat: support client injection for E2B (#6360) 2025-11-26 14:39:39 -08:00
jnjpng
442b916fa9 feat: connect generated letta api key with modal function wrapper (#6329)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:10:27 -08:00
cthomas
345ea42630 feat: offload all file i/o in server endpoints LET-6252 (#6300)
feat: offload all file i/o in server endpoints
2025-11-24 19:10:26 -08:00
Sarah Wooders
5730f69ecf feat: modal tool execution - NO FEATURE FLAGS USES MODAL [LET-4357] (#5120)
* initial commit

* add delay to deploy

* fix tests

* add tests

* passing tests

* cleanup

* and use modal

* working on modal

* gate on tool metadata

* agent state

* cleanup

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-13 15:36:56 -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
305bb8c8f7 feat: inject letta_client and agent_id into local sandbox (#5192) 2025-10-24 15:12:11 -07:00
Kian Jones
c2e474e03a feat: refactor logs to parse as a single log line each and filter out 404s from sentry (#5242)
* add multiline log auto detect

* implement logger.exception()

* filter out 404

* remove potentially problematic changes
2025-10-24 15:11:31 -07: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
Kian Jones
fecf6decfb chore: migrate to ruff (#4305)
* base requirements

* autofix

* Configure ruff for Python linting and formatting

- Set up minimal ruff configuration with basic checks (E, W, F, I)
- Add temporary ignores for common issues during migration
- Configure pre-commit hooks to use ruff with pass_filenames
- This enables gradual migration from black to ruff

* Delete sdj

* autofixed only

* migrate lint action

* more autofixed

* more fixes

* change precommit

* try changing the hook

* try this stuff
2025-08-29 11:11:19 -07:00
Sarah Wooders
0420f10bab fix: remove trace methods [LET-4059] (#4232)
remove trace methods
2025-08-26 20:47:09 -07:00
Andy Li
81993f23eb feat: tool function arguments passed in at runtime 2025-08-15 16:24:56 -07:00
Andy Li
e2e91c7260 feat: typescript sandbox 2025-08-12 15:39:17 -07:00
Charles Packer
0130e9b6e8 fix: reduce error levels to patch the sentry logging issue (#3835) 2025-08-08 22:15:10 -07:00
cthomas
9a2caeb0bc feat: offload jinja to threadpool LET-3615 (#3787) 2025-08-06 16:34:28 -07:00
Charles Packer
bd56635ba9 feat(desktop): allow specifying a remote letta server in the letta desktop (#3709) 2025-08-05 22:21:07 -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
be1448e729 fix: Add comprehensive testing for tool creation paths (#3255) 2025-07-09 15:51:50 -07:00
cthomas
9974b44ced chore: gate pip install in local venv (#3232) 2025-07-08 16:49:17 -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
eaf5682422 feat: plugin system and backend runtime flags (#2543) 2025-06-05 18:12:44 -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
cthomas
4778180658 fix: async sandbox db writes (#2351) 2025-05-22 19:17:04 -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
Matthew Zhou
59aefc322a feat: Create local sandbox config from env vars for OSS users (#1910) 2025-04-28 13:01:38 -07:00
Matthew Zhou
066e39d118 feat: Adjust local tool execution to always try using venv if exists (#1864) 2025-04-24 11:13:44 -07:00
cthomas
e599610629 feat: add tool execution result object (#1837) 2025-04-22 11:30:36 -07:00
Matthew Zhou
983f750990 feat: Implement resume step after request in new batch agent loop (#1676) 2025-04-15 13:56:22 -07:00
Matthew Zhou
24312d4c6d feat: Factor out database access unless necessary in Tool Sandboxes (#1711) 2025-04-14 18:00:15 -07:00
Charles Packer
4c2fea1f8d fix: rebase #1560 (tool timeout) (#1637) 2025-04-08 17:13:21 -07:00
Matthew Zhou
dc361c5c8e feat: Clean up prints (#1515) 2025-04-01 15:20:43 -07:00
Matthew Zhou
25b106d1cd feat: Support natively async e2b (#1512) 2025-04-01 14:28:24 -07:00