Skip to content

Conversation

@jck-bit
Copy link

@jck-bit jck-bit commented Oct 23, 2025

Please describe the purpose of this pull request.
This PR addresses the TODO comments in letta_agent_batch.py by migrating the rethink_memory function to use the native memory_rethink tool.

improvements:
Removed hardcoded special handling for rethink_memory in batch processing
Uses the existing native memory_rethink tool from LettaCoreToolExecutor
Maintains full backward compatibility for existing agents

How to test
-Existing tests pass with the refactoring
-Run existing batch tests: uv run pytest -s tests/test_letta_agent_batch.py -v
-Test parameter conversion logic (old target_block_label → new label)-
-Also, Verify deprecation warning appears when using old rethink_memory function ,.

Have you tested this PR?
YES.
-Deprecation warning is displayed
-No breaking changes for existing agents

Related issues or PRs
No related issues. The purpose of this change is to addresses TODO comment directly in the codebase.

Is your PR over 500 lines of code?
No, 74aadditi0ns, 25 deleltions

Additional context
-The native memory_rethink alraedy existed, it just wasnt being used

- Update batch processing to support both old and new tool names
- Rename _bulk_rethink_memory_async to _bulk_memory_rethink_async
- Add parameter conversion from target_block_label to label
- Add deprecation warning to old rethink_memory function
- Maintain backward compatibility for existing agents

Addresses TODO comments about brittle implementation and need for native tool control
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant