Commit Graph

55 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
Ari Webb
4092820f3a feat: add project id scoping for tools backend changes (#6529) 2025-12-15 12:02:34 -08:00
Ari Webb
3e02f12dfd feat: add tool embedding and search [LET-6333] (#6398)
* feat: add tool embedding and search

* fix ci

* add env variable for embedding tools

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-26 14:39:40 -08:00
Sarah Wooders
19e6b09da5 docs: remove schemas from docstrings (#6059) 2025-11-13 15:36:56 -08:00
Kian Jones
6fa1a1d6c3 make sure tool return chars within max int range (#5942)
* max

* final

* Set return_char_limit maximum to 1 million in OpenAPI spec (#5946)

* Initial plan

* Set max int range to 1 million for return_char_limit

Co-authored-by: kianjones9 <11655409+kianjones9@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: kianjones9 <11655409+kianjones9@users.noreply.github.com>

* Update tool.py

* fix api

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
2025-11-13 15:36:50 -08:00
Kian Jones
45065297a0 feat: runtime validation for ids for internal managers calls (#5544)
* claude coded first pass

* fix test cases to expect errors instead

* fix this

* let's see how letta-code did

* claude

* fix tests, remove dangling comments, retrofit all managers functions with decorator

* revert to main for these since we are not erroring on invalid tool and block ids

* reorder decorators

* finish refactoring test cases

* reorder agent_manager decorators and fix test tool manager

* add decorator on missing managers

* fix id sources

* remove redundant check

* uses enum now

* move to enum
2025-10-24 15:13:47 -07:00
Matthew Zhou
ddd1686ad1 feat: Add flag to tools to signify if they are race safe [LET-5611] (#5548)
* wip add race unsafe param

* Alembic migration

* Fern autogen

* Set default to True

* Adjust fern

* Rename field

* Run fern autogen

* Add enable_parallel_execution to Tool Create and Update
2025-10-24 15:12:11 -07:00
Ari Webb
54123eb7e4 make tags None into empty list [LET-5558] (#5480)
* make tags None into empty list

* remove log

* data.get, instead of straight read

* further fix

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-10-24 15:12:11 -07:00
Sarah Wooders
e07a589796 chore: rm composio (#5151) 2025-10-07 17:50:49 -07:00
Sarah Wooders
d0d36a4b07 fix: remove json schema generation from tool validation [LET-4509] (#4964)
* patch integration test

* create default user and org

* rm

* patch

* add testing

* remove validation for schemas from pydantic object

* add file

* patch tests

* fix more tests

* fix managers

* fix sdk test

* patch schema tests

* Comment out name in update

* patch test

* patch

* add another test
2025-10-07 17:50:46 -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
cthomas
e3d3bc09eb feat: add new default_requires_approval flag on tools (#4287) 2025-08-28 15:38:59 -07:00
Sarah Wooders
58be205098 chore: patch update tools (#4090)
* patch update tools

* update tool patch

* fallback to generation for legacy tools

* avoid re-parsing source if json schema exists

* fix more tests

* remove asssert

* fix

* update

* update

* update

* Fix tests

---------

Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-08-28 11:34:36 -07:00
Charles Packer
773a6452d1 fix: handle faulty schemas from bad mcp servers better
Co-authored-by: jnjpng <jin@letta.com>
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-08-15 16:08:52 -07:00
Andy Li
1ff2434598 feat: typescript deps in ade 2025-08-15 15:49:57 -07:00
Andy Li
e2e91c7260 feat: typescript sandbox 2025-08-12 15:39:17 -07:00
Andy Li
7a504c2702 feat: npm requirements for tools 2025-08-04 14:15:10 -07:00
cthomas
b4810633af chore: deprecate orm enum file (#3724) 2025-08-04 11:59:55 -07:00
cthomas
2b0dc4a1f9 feat: remove organization from tool pydantic schema (#3430) 2025-07-20 00:00:31 -07:00
Matthew Zhou
5337c7a009 feat: Establish agent file schema v2 and achieve feature parity with v1 (#3235) 2025-07-16 14:49:20 -07:00
Andy Li
2ddd048e5c chore: sentry log grouping and file upload stats 2025-07-09 10:29:23 -07:00
Matthew Zhou
95d8a7d496 hotfix: Patch schema generation (#3134) 2025-07-01 22:49:50 -07:00
Matthew Zhou
96e8c292cd fix: Change to only derive json_schema for custom tools if missing (#3129) 2025-07-01 17:13:31 -07:00
Matthew Zhou
2e77ea6e76 feat: Add optional pip requirements to tool object (#2793) 2025-06-13 13:20:36 -07:00
Matthew Zhou
470b13f4b9 feat: Add tools for opening and closing files (#2638) 2025-06-04 17:33:18 -07:00
Andy Li
70a2b1de79 feat: insert heartbeat dynamically and remove from stored json (#2501) 2025-05-29 10:29:05 -07:00
Andy Li
28c3624a88 fix: numerous tool execution bugs (#2371) 2025-05-23 18:02:15 -07:00
Sarah Wooders
8133a5a158 feat: add MCP servers into a table and MCP tool execution to new agent loop (#2323)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com>
2025-05-23 16:22:16 -07:00
Matthew Zhou
26ffd19e1f feat: Add built in code interpreter tool (#2252) 2025-05-19 16:01:40 -07:00
Andy Li
5734df54d0 feat: composio async execution (#1941) 2025-04-30 16:05:03 -07:00
Matthew Zhou
e6eea9450b feat: Add Letta voice tools (#1922) 2025-04-29 10:46:29 -07:00
cthomas
860f8707cf feat: enable sleeptime agent creation (#1523) 2025-04-02 14:12:11 -07:00
Shubham Naik
c80df1329b chore: do no brick list endpoint if jsons chema is invalid (#1380)
Co-authored-by: Shubham Naik <shub@memgpt.ai>
2025-03-24 11:09:42 -07:00
Sarah Wooders
be0f239618 chore: update desktop dependencies (#1330)
Co-authored-by: cpacker <packercharles@gmail.com>
Co-authored-by: Shubham Naik <shub@letta.com>
2025-03-19 17:48:48 -07:00
Matthew Zhou
3e0c865d0e feat: Make the tool runner take a schema (#1328) 2025-03-18 12:06:02 -07:00
Matthew Zhou
8f91a19332 feat: Add metadata_ field to Tool (#1321) 2025-03-17 17:14:08 -07:00
Matthew Zhou
40c70b46cf feat: Refactor mcp client and make stdio errors more manageable (#1291) 2025-03-14 14:58:30 -07:00
Charles Packer
7789da21c8 feat: initial MCP support (#1229)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-03-12 17:33:24 -07:00
cthomas
808ea9e188 feat: add args schema for tool object (#1160) 2025-03-01 14:53:10 -08:00
Matthew Zhou
1d8cf3f64a fix: Don't refresh Composio schemas (#1099) 2025-02-21 16:58:12 -08:00
Matthew Zhou
48089bbc87 feat: Support Langchain tools (#881) 2025-01-31 16:36:35 -08:00
Matthew Zhou
03fe297846 fix: Remove name from Create/Update tool (#741)
Co-authored-by: Caren Thomas <caren@letta.com>
2025-01-24 10:55:23 -08:00
Matthew Zhou
90ccc29359 feat: Identify Composio tools (#721)
Co-authored-by: Caren Thomas <caren@letta.com>
Co-authored-by: Shubham Naik <shubham.naik10@gmail.com>
Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: mlong93 <35275280+mlong93@users.noreply.github.com>
Co-authored-by: Mindy Long <mindy@letta.com>
2025-01-22 16:37:37 -08:00
Matthew Zhou
2a31a7fbd5 feat: Native agent to agent messaging (#668) 2025-01-16 10:36:15 -08:00
Matthew Zhou
1cc7dd1747 chore: Deprecate module field on tool (#600) 2025-01-13 10:42:23 -08:00
Matthew Zhou
2856dcd679 fix: Adjust type of args to any for ToolRunFromSource (#593) 2025-01-10 16:04:47 -08:00
Matthew Zhou
6f782b2613 feat: Add tool_type column (#576) 2025-01-10 14:52:15 -08:00
Matthew Zhou
b7d3ae2a65 feat: Add return_char_limit to ToolUpdate (#557) 2025-01-08 16:30:31 -08:00