Commit Graph

90 Commits

Author SHA1 Message Date
Sarah Wooders
812bfd16dd Revert "feat: project_id uniqueness for tools" (#7007)
Revert "feat: project_id uniqueness for tools (#6604)"

This reverts commit 2c4b6397041e2c965493525fc52e056f10d1bdb6.
2025-12-15 12:03:09 -08:00
Ari Webb
c1aa01db6f feat: project_id uniqueness for tools (#6604)
* feat: project_id uniqueness for tools

* prevent double upsert of global tools

* use default project if no header for sdk

* reorder unique constraint for performance

* use separate session for check conflict

* feature flag adding project id header in cloud api

* add my migration after one on main

* remove comment

* stage and publish api

* web set project id just for tools

* includes instead of startswith
2025-12-15 12:03:09 -08:00
Kian Jones
fbd89c9360 fix: replace all 'PRODUCTION' references with 'prod' for consistency (#6627)
* fix: replace all 'PRODUCTION' references with 'prod' for consistency

Problem: Codebase had 11 references to 'PRODUCTION' (uppercase) that should
use 'prod' (lowercase) for consistency with the deployment workflows and
environment normalization.

Changes across 8 files:

1. Source files (using settings.environment):
   - letta/functions/function_sets/multi_agent.py
   - letta/services/tool_manager.py
   - letta/services/tool_executor/multi_agent_tool_executor.py
   - letta/services/helpers/agent_manager_helper.py
   All checks changed from: settings.environment == "PRODUCTION"
   To: settings.environment == "prod"

2. OTEL resource configuration:
   - letta/otel/resource.py
     - Updated _normalize_environment_tag() to handle 'prod' directly
     - Removed 'PRODUCTION' -> 'prod' mapping (no longer needed)
     - Updated device.id check from _env != "PRODUCTION" to _env != "prod"

3. Test files:
   - tests/managers/conftest.py
     - Fixture parameter changed from "PRODUCTION" to "prod"
   - tests/managers/test_agent_manager.py (3 occurrences)
   - tests/managers/test_tool_manager.py (2 occurrences)
   All test checks changed to use "prod"

Result: Complete consistency across the codebase:
- All environment checks use "prod" instead of "PRODUCTION"
- Normalization function simplified (no special case for PRODUCTION)
- Tests use correct "prod" value
- Matches deployment workflow configuration from PR #6626

This completes the environment naming standardization effort.

* fix: update settings.py environment description to use 'prod' instead of 'PRODUCTION'

The field description still referenced PRODUCTION as an example value.
Updated to use lowercase 'prod' for consistency with actual usage.

Before: "Application environment (PRODUCTION, DEV, CANARY, etc. - normalized to lowercase for OTEL tags)"
After: "Application environment (prod, dev, canary, etc. - lowercase values used for OTEL tags)"
2025-12-15 12:02:34 -08:00
jnjpng
2536942be2 fix: combined tool manager improvements - tracing and redundant fetches (#6570)
* fix: combined tool manager improvements - tracing and redundant fetches

This PR combines improvements from #6530 and #6535:

- Add tracer import to enable proper tracing spans
- Improve update check logic to verify actual field changes before updating
- Return current_tool directly when no update is needed (avoids redundant fetch)
- Add structured tracing spans to update_tool_by_id_async for better observability
- Fix decorator order for better error handling (raise_on_invalid_id before trace_method)
- Remove unnecessary tracing spans in create_or_update_tool_async

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

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

* revert: remove tracing spans from update_tool_by_id_async

Remove the tracer span additions from update_tool_by_id_async while keeping
all other improvements (decorator order fix, redundant fetch removal, and
improved update check logic).

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

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

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:34 -08:00
Ari Webb
4092820f3a feat: add project id scoping for tools backend changes (#6529) 2025-12-15 12:02:34 -08:00
Sarah Wooders
4f1fbe45aa feat: add index and concurrency control for tools (fixed alembic) (#6552) 2025-12-15 12:02:34 -08:00
Sarah Wooders
c8c06168e2 Revert "feat: add index and concurrency control for tools " (#6551)
Revert "feat: add index and concurrency control for tools  (#6547)"

This reverts commit f4abf8e061bc2f5e08853b5ce5775a7f8626463a.
2025-12-15 12:02:34 -08:00
Sarah Wooders
a2d3011d84 feat: add index and concurrency control for tools (#6547) 2025-12-15 12:02:34 -08:00
Sarah Wooders
a18caf69f7 fix: undo tool manager changes (#6546) 2025-12-15 12:02:34 -08:00
jnjpng
0c21d20914 fix: redundant tool fetch on no op update and fix tool manager tracing (#6535)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Kian Jones
edeac2c679 fix: fix gemini otel bug and add tracing for tool upsert (#6523)
add tracing for tool upsert, and fix gemini otel bug
2025-12-15 12:02:33 -08:00
jnjpng
7058d63bd8 fix: update tool check and add tracing to update tool logic (#6530)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Kian Jones
964fc05cb9 chore: add more tracing to tool upsert endpoint (#6471)
* add tracing

* fix hallucination
2025-12-15 12:02:19 -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
cthomas
6a4c9d7514 test: fix validation errors preventing tool deletion [LET-6323] (#6372)
test: fix validation errors preventing tool deletion
2025-11-26 14:39:39 -08:00
jnjpng
ccafb25268 feat: launch darkly modal flag (#6345)
* base

* update

* update

* update

* generate

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:10:27 -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
jnjpng
099da97e7b fix: remove modal image creation logging and fix base imports (#6197)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:09:32 -08:00
jnjpng
3b030d1bb0 fix: set default python version for modal (#6180)
update

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:09:32 -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
6c377cdc81 chore(logs): Add resource usage logging to streaming, file uploads, mcp client, and model caches (#5925)
* adding log messages to track memory consumption

* add logging to sources, folders, agentfiles, and mcp clients

* memory logging for tool creation paths
2025-11-13 15:36:50 -08:00
Kian Jones
704d3b2d79 chore: refactor not to use warnings.warn (#5730)
* refactor not to use warnings.warn

* temp circular import fix maybe unecessary/bnad

* fix Deprecation warning

* fix deprecation warning and mcp thing?

* revert changes to mcp server test

* fix deprecation warning
2025-10-24 15:14:31 -07: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
de7011e4de feat: Mark certain internal tools as safe to execute concurrently [LET-5614] (#5553)
* Change execution pattern depending on

* Increase efficiency

* Mark certain tools as parallel safe
2025-10-24 15:12:26 -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
Sarah Wooders
53786ee102 feat: asyncify test_manager.py [LET-4494] (#4890)
* add test_agent_manager.py

* created shared conftest

* add test_tool_manager.py

* add tag tests

* add message manager tests

* add blocks

* add org

* add passage tests

* add archive manager

* add user manager

* add identity

* add job manager tests

* add sandbox manager

* add file manager

* add group managers

* add mcp manager

* fix batch tests

* update workflows

* fix test_managers.py

* more tests

* comment out old test and add file

---------

Co-authored-by: Matthew Zhou <mattzh1314@gmail.com>
2025-10-07 17:50:46 -07:00
Sarah Wooders
4df0a27eb0 chore: remove sync db (#4873) 2025-10-07 17:50:45 -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
Shubham Naik
98e8fcdee6 feat: allow list tools by tool type [PRO-870] (#4036)
* feat: allow list tools by tool type

* chore: update list

* chore: respond to comments

* chore: refactor tools hella

* Add tests to managers

* chore: branch

---------

Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-09-02 15:53:36 -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
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
Matthew Zhou
13d8eae9ef chore: Move environment to settings [LET-4080] (#4265)
Move environment to settings
2025-08-27 14:52:35 -07:00
Matthew Zhou
1be8b89031 feat: Support override tool functionality to agent file v2 (#4092) 2025-08-21 16:58:19 -07:00
Andy Li
1ff2434598 feat: typescript deps in ade 2025-08-15 15:49:57 -07:00
Andy Li
49f7216a14 docs: update for manager funcs 2025-08-15 13:55:10 -07:00
Charles Packer
d3aadd2714 fix: patch mcp attach bug (#3844) 2025-08-10 17:24:33 -07:00
Andy Li
ca6f474c4e feat: track metrics for runs in db 2025-08-06 15:46:50 -07:00
Matthew Zhou
47d8650f09 fix: Fix tool renaming if json schema is passed in (#3745) 2025-08-05 11:36:23 -07:00
cthomas
b4810633af chore: deprecate orm enum file (#3724) 2025-08-04 11:59:55 -07:00
Matthew Zhou
37fdecb433 feat: Improve tool renaming based on json schema (#3676) 2025-07-31 12:57:22 -07:00
Andy Li
73e74270f4 feat: modal sandbox 2025-07-30 11:25:40 -07:00
jnjpng
df738ba34a feat: support mcp server export/import with agent files
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-24 18:17:08 -07:00
Matthew Zhou
84b27d6a07 feat: Improve attach/detach missing file tools performance (#3486) 2025-07-22 15:35:42 -07:00
Matthew Zhou
45f09b1dfb feat: Reduce database calls in import/export agent file (#3455) 2025-07-21 11:27:21 -07:00
cthomas
2b0dc4a1f9 feat: remove organization from tool pydantic schema (#3430) 2025-07-20 00:00:31 -07:00
Matthew Zhou
c545311cd8 fix: Fix set comparison in tool manager (#3420) 2025-07-18 21:00:41 -07:00
Matthew Zhou
4a72d1c8c4 fix: Bulk insert base tools if using postgres (#3419)
Test failures here are time out flakes
2025-07-18 20:04:52 -07:00
cthomas
b6eb204bc2 fix: list tools latency regression (#3282) 2025-07-16 14:01:30 -07:00