Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: avoid unnecessary database operations for non-server cli commands #2383

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

tevino
Copy link

@tevino tevino commented Jan 23, 2025

Avoid unnecessary database operations while running non-server commands like letta version, letta benchmark, etc.

letta version has been fixed as well, it prints out Creating engine and no version before this PR.

How to test

A test case has been added to ensure that letta version prints out version number and nothing else.

For manual validation run:

  • letta version should show prints out the version
  • poetry run pytest -v tests/test_cli.py -k test_letta_version_prints_only_version should pass
  • and definitely all other existing tests

Have you tested this PR?

root@42a43c02:/app# poetry run pytest -v tests/test_cli.py -k test_letta_version_prints_only_version
=========================================================================================================================================================================== test session starts ============================================================================================================================================================================
platform linux -- Python 3.11.2, pytest-8.3.4, pluggy-1.5.0 -- /app/.venv/bin/python
cachedir: .pytest_cache
rootdir: /app/tests
configfile: pytest.ini
plugins: asyncio-0.23.8, anyio-4.8.0, order-1.3.0, mock-3.14.0, langsmith-0.3.1
asyncio: mode=Mode.AUTO
collected 2 items / 1 deselected / 1 selected

tests/test_cli.py::test_letta_version_prints_only_version PASSED

@tevino tevino changed the title Avoid unnecessary database operations for non-server cli commands fix: avoid unnecessary database operations for non-server cli commands Jan 31, 2025
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