Swap the order of @trace_method and @raise_on_invalid_id decorators
across all service managers so that @trace_method is always the first
wrapper applied to the function (positioned directly above the method).
This ensures the ID validation happens before tracing begins, which is
the intended execution order.
Files modified:
- agent_manager.py (23 occurrences)
- archive_manager.py (11 occurrences)
- block_manager.py (7 occurrences)
- file_manager.py (6 occurrences)
- group_manager.py (9 occurrences)
- identity_manager.py (10 occurrences)
- job_manager.py (7 occurrences)
- message_manager.py (2 occurrences)
- provider_manager.py (3 occurrences)
- sandbox_config_manager.py (7 occurrences)
- source_manager.py (5 occurrences)
- step_manager.py (13 occurrences)
* initial commit
* Add database migration for compaction_settings field
This migration adds the compaction_settings column to the agents table
to support customized summarization configuration for each agent.
🐾 Generated with [Letta Code](https://letta.com)
Co-Authored-By: Letta <noreply@letta.com>
* fix
* rename
* update apis
* fix tests
* update web test
---------
Co-authored-by: Letta <noreply@letta.com>
Co-authored-by: Kian Jones <kian@letta.com>
* fix: clear message history no longer deletes messages
* toast and make it stay for 8 secs
* fix test
---------
Co-authored-by: Ari Webb <ari@letta.com>
* claude code first pass
* rename routes
* search_messages and list_messages
* revert agents messagesearch
* generate api
* fix backend for list all messages
* request for message search
* return list of letta message
* add tests
* error in archive endpoint
* archive delete return type wrong
* optional params for archive creation
* add passage to tpuf on create
* fix archive manager
* support global passage search
* search by agent
* just do basic org wide search for now
* change message test to be about fresh data, cleanup after
---------
Co-authored-by: Ari Webb <ari@letta.com>
* Revert "Revert "feat: make attach/detach routes return None if version is 1.0 [LET-5844]" (#6201)"
This reverts commit bb0d10725f5889306de61e1758f061d6c1041c52.
* fix type checking
* revert
* return state for blocks and sources
* func signatures
* create memgpt_agent for cloud-e2e-tests
* Revert "create memgpt_agent for cloud-e2e-tests"
This reverts commit f279e5897b0942b1006a5f8527713dd801064c63.
* fix
---------
Co-authored-by: Ari Webb <ari@letta.com>
* add memory tracking to core
* move to asyncio from threading.Thread
* remove threading.thread all the way
* delay decorator monitoring initialization until after event loop is registered
* context manager to decorator
* add psutil
* 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
* 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
* change my PR to match Caren's
* add path parameter validation for agent id first
* remove old import
* remove old agent_id_pattern pattern
* add example and fix max/min calculation to include hyphen
* fix regex string interpolation
* example deprecated in favour of examples
* openapi autogen
* change template test to expect 422
* fix 422 swallow
* expect 422 or 400
* rewrite error codes
* fix hallucinated uuid
* tweaked error message test
* print docker logs on failure
* feat: ignore bad tools when creating agents for template
* chore: use paramater
* chore: next
* chore: next
---------
Co-authored-by: Shubham Naik <shub@memgpt.ai>
* feat: add pagination to agent folders endpoint
* chore: regenerate API client with pagination parameters
* feat: add pagination parameters to agent folders and sources endpoints
- Add pagination parameters (before, after, limit, order, order_by) to list_agent_folders endpoint
- Add pagination parameters to list_agent_sources endpoint
- Update list_attached_sources_async method to support pagination with cursor-based filtering
- Regenerate API client with new pagination parameters
* feat: add pagination to agent blocks endpoint
* chore: regenerate API client with pagination parameters
* feat: implement pagination logic in list_blocks endpoint
- Fix list_blocks implementation to use pagination parameters that were already in the route signature
- Add in-memory pagination logic for core memory blocks (sorting, cursor filtering, limit)
- Sort blocks by created_at timestamp with proper asc/desc ordering
- Apply cursor-based pagination with before/after filters
- Apply limit to results
- Regenerate API client code to reflect pagination functionality
* fix: correct sorting logic in list_blocks endpoint
- Fix AttributeError where blocks don't have created_at attribute
- Sort blocks by id instead of created_at (core memory blocks don't have timestamps)
- Maintains consistent pagination behavior while fixing runtime error
* feat: implement database-level pagination for list_blocks endpoint
- Replace inefficient in-memory filtering with proper SQLAlchemy query
- Use BlocksAgents join table to filter blocks by agent_id at database level
- Apply pagination filters (before, after, limit) in SQL query for better performance
- Sort by BlockModel.created_at instead of in-memory sorting
- Add necessary imports: select from sqlalchemy, db_registry from letta.server.db
- Verify agent access before querying blocks
* refactor: move database logic from route to agent manager service layer
- Add list_agent_blocks_async method to AgentManager for proper separation of concerns
- Move SQLAlchemy query logic from REST route to service layer
- Keep routes focused on request/response handling
- Remove unnecessary imports from router (select, db_registry)
- Database pagination logic now properly encapsulated in service layer
feat: convert list_groups to async in agent manager
- Add list_groups_async method to AgentManager to replace sync version
- Method filters groups by agent_id using join with GroupsAgents table
- Supports optional manager_type filtering
- Update list_agent_groups endpoint to use new async method
- No functional changes to endpoint behavior or parameters
* add anthropic memory tools
* memory view working
* update memory examples
* tools
* feat: some changes (#5003)
* feat: added the ability to modify and add descriptions on creation
* fix: kill dead code & write into core_tool_executor instead
* fix: use block_manager not agent_manager where possible, also turn the return string errors into raising exceptions
* fix: cleanup, get rid of more return string errors replaced with valueerror, also drop deadcode
---------
Co-authored-by: Charles Packer <packercharles@gmail.com>