Commit Graph

51 Commits

Author SHA1 Message Date
Kian Jones
f5c4ab50f4 chore: add ty + pre-commit hook and repeal even more ruff rules (#9504)
* auto fixes

* auto fix pt2 and transitive deps and undefined var checking locals()

* manual fixes (ignored or letta-code fixed)

* fix circular import

* remove all ignores, add FastAPI rules and Ruff rules

* add ty and precommit

* ruff stuff

* ty check fixes

* ty check fixes pt 2

* error on invalid
2026-02-24 10:55:11 -08:00
Sarah Wooders
50a60c1393 feat: git smart HTTP for agent memory repos (#9257)
* feat(core): add git-backed memory repos and block manager

Introduce a GCS-backed git repository per agent as the source of truth for core
memory blocks. Add a GitEnabledBlockManager that writes block updates to git and
syncs values back into Postgres as a cache.

Default newly-created memory repos to the `main` branch.

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

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

* feat(core): serve memory repos over git smart HTTP

Run dulwich's WSGI HTTPGitApplication on a local sidecar port and proxy
/v1/git/* through FastAPI to support git clone/fetch/push directly against
GCS-backed memory repos.

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

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

* fix(core): create memory repos on demand and stabilize git HTTP

- Ensure MemoryRepoManager creates the git repo on first write (instead of 500ing)
  and avoids rewriting history by only auto-creating on FileNotFoundError.
- Simplify dulwich-thread async execution and auto-create empty repos on first
  git clone.

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

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

* fix(core): make dulwich optional for CI installs

Guard dulwich imports in the git smart HTTP router so the core server can boot
(and CI tests can run) without installing the memory-repo extra.

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

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

* fix(core): guard git HTTP WSGI init when dulwich missing

Avoid instantiating dulwich's HTTPGitApplication at import time when dulwich
isn't installed (common in CI installs).

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

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

* fix(core): avoid masking send_message errors in finally

Initialize `result` before the agent loop so error paths (e.g. approval
validation) don't raise UnboundLocalError in the run-tracking finally block.

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

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

* fix(core): stop event loop watchdog on FastAPI shutdown

Ensure the EventLoopWatchdog thread is stopped during FastAPI lifespan
shutdown to avoid daemon threads logging during interpreter teardown (seen in CI
unit tests).

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

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

* chore(core): remove send_*_message_to_agent from SyncServer

Drop send_message_to_agent and send_group_message_to_agent from SyncServer and
route internal fire-and-forget messaging through send_messages helpers instead.

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

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

* fix(core): backfill git memory repo when tag added

When an agent is updated to include the git-memory-enabled tag, ensure the
git-backed memory repo is created and initialized from the agent's current
blocks. Also support configuring the memory repo object store via
LETTA_OBJECT_STORE_URI.

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

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

* fix(core): preserve block tags on git-enabled updates

When updating a block for a git-memory-enabled agent, keep block tags in sync
with PostgreSQL (tags are not currently stored in the git repo).

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

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

* chore(core): remove git-state legacy shims

- Rename optional dependency extra from memory-repo to git-state
- Drop legacy object-store env aliases and unused region config
- Simplify memory repo metadata to a single canonical format
- Remove unused repo-cache invalidation helper

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

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

* fix(core): keep PR scope for git-backed blocks

- Revert unrelated change in fire-and-forget multi-agent send helper
- Route agent block updates-by-label through injected block manager only when needed

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

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

---------

Co-authored-by: Letta <noreply@letta.com>
2026-02-24 10:52:06 -08:00
Caren Thomas
72871ff923 bump version 2026-01-29 12:45:45 -08:00
Christina Tong
0333ff0614 fix: max tokens and context window size [LET-6481] (#8298)
* fix: max tokens [LET-6481]

* remove print statements

* update

* simplofy fallback

* address comments async

* update other helpers

* update pyproject,.toml

* update pyproject w async lru

* oopen ai internal async methods

* update

* update uv lock
2026-01-29 12:43:53 -08:00
Kian Jones
9418ab9815 feat: add provider trace backend abstraction for multi-backend telemetry (#8814)
* feat: add provider trace backend abstraction for multi-backend telemetry

Introduces a pluggable backend system for provider traces:
- Base class with async/sync create and read interfaces
- PostgreSQL backend (existing behavior)
- ClickHouse backend (via OTEL instrumentation)
- Socket backend (writes to Unix socket for crouton sidecar)
- Factory for instantiating backends from config

Refactors TelemetryManager to use backends with support for:
- Multi-backend writes (concurrent via asyncio.gather)
- Primary backend for reads (first in config list)
- Graceful error handling per backend

Config: LETTA_TELEMETRY_PROVIDER_TRACE_BACKEND (comma-separated)
Example: "postgres,socket" for dual-write to Postgres and crouton

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

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

* feat: add protocol version to socket backend records

Adds PROTOCOL_VERSION constant to socket backend:
- Included in every telemetry record sent to crouton
- Must match ProtocolVersion in apps/crouton/main.go
- Enables crouton to detect and reject incompatible messages

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

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

* fix: remove organization_id from ProviderTraceCreate calls

The organization_id is now handled via the actor parameter in the
telemetry manager, not through ProviderTraceCreate schema. This fixes
validation errors after changing ProviderTraceCreate to inherit from
BaseProviderTrace which forbids extra fields.

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

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

* consolidate provider trace

* add clickhouse-connect to fix bug on main lmao

* auto generated sdk changes, and deployment details, and clikchouse prefix bug and added fields to runs trace return api

* auto generated sdk changes, and deployment details, and clikchouse prefix bug and added fields to runs trace return api

* consolidate provider trace

* consolidate provider trace bug fix

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-19 15:54:43 -08:00
Kian Jones
6e803174f5 chore; bump ddtrace version (#8465)
* Revert "chore: temp revert to public ddtrace (#8462)"

This reverts commit 09e541b7732fdc03be4cd9c00cc2c8518300acf1.

* Update ddtrace version requirement in pyproject.toml

Removed specific ddtrace versions for profiling and updated to a minimum version requirement.
2026-01-19 15:54:37 -08:00
Caren Thomas
a626dec278 uv lock 2026-01-12 11:00:12 -08:00
jnjpng
87e939deda feat: add fastmcp v2 client (#8457)
* base

* testing code

* update

* nit
2026-01-12 10:57:49 -08:00
Shubham Naik
c02f966ff1 chore: nah (#8479) 2026-01-12 10:57:49 -08:00
Kian Jones
4d31cecd00 feat: add custom version of ddtrace which supports anthropic (#8419)
* add built custom version of ddtrace

* trigger CI

* add linux-aarch54
2026-01-12 10:57:48 -08:00
Sarah Wooders
3cf91d9dbc chore: enable client-defined tools integration test (#8223) 2026-01-12 10:57:48 -08:00
Caren Thomas
5646be7df6 chore: bump version 0.16.1 2025-12-17 17:33:43 -08:00
Kian Jones
632bee868c chore: upgrade ddtrace version (#7326)
* upgrade ddtrace version

* uv lock
2025-12-17 17:31:03 -08:00
Caren Thomas
c99ff56abc chore: bump version v0.16.0 2025-12-15 12:04:32 -08:00
Ari Webb
fecf503ad9 feat: xhigh reasoning for gpt-5.2 (#6735) 2025-12-15 12:03:09 -08:00
cthomas
799ddc9fe8 chore: api sync (#6747) 2025-12-15 12:03:07 -08:00
Sarah Wooders
ceadacd30e feat: support programmatic tool execution (cloud only) (#6441) 2025-12-15 12:02:19 -08:00
jnjpng
c6df306ccf fix: upgrade google-genai sdk version and fix gemini 3 streaming (#6437)
* base

* base

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:18 -08:00
Caren Thomas
cda2f1b573 drop docs and bump version 2025-11-26 14:40:49 -08:00
Caren Thomas
5d52b713c6 chore: bump version 2025-11-24 19:12:29 -08:00
cthomas
7b0bd1cb13 feat: cutover repo to 1.0 sdk client LET-6256 (#6361)
feat: cutover repo to 1.0 sdk client
2025-11-24 19:11:18 -08:00
Charles Packer
c4699b3d17 feat: add support for opus 4.5 (#6256)
* feat: add support for new model

* fix: just stage-api && just publish-api (anthropic model settings changed)

* fix: just stage-api && just publish-api (anthropic model settings changed)

* fix: make kevlar have default reasoning on

* fix: bump anthropic sdk version

* fix: patch name

* pin newer version anthropic

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-24 19:10:27 -08:00
Kian Jones
94c2921711 chore: walk back some temporary debugging stuff (#6332)
* first pass

* uv lock
2025-11-24 19:10:27 -08:00
Kian Jones
848aa962b6 feat: add memory tracking to core (#6179)
* 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
2025-11-24 19:09:32 -08:00
Caren Thomas
98302c7868 bump version 2025-11-13 15:40:38 -08:00
Kian Jones
361c9a14d8 feat(metrics): Surface custom metrics for temporal workflows and workers (#5951)
* temporal custom metrics

* Delete apps/core/letta/agents/temporal/PRODUCTION_SETUP.md

* Delete apps/core/letta/agents/temporal/DATADOG_METRICS.md

* add unit testing
2025-11-13 15:36:55 -08:00
Kian Jones
60115d4931 fix: lettuce import and add unit tests for new run manager function (#5893)
* fix lettuce import and add unit tests for new run manager function

* fix unit tests

* bump version (unrelated)
2025-11-13 15:36:38 -08:00
Kian Jones
1577a261d8 feat: add profiling and structured logging (#5690)
* test dd build

* dd agent in cluster

* quick poc

* refactor and add logging

* remove tracing etc.

* add changes to otel logging config

* refactor to accept my feedback

* finishing touches
2025-10-24 15:14:20 -07:00
Caren Thomas
0481b490ac chore: bump version 0.12.1 2025-10-09 15:29:23 -07:00
Sarah Wooders
e07a589796 chore: rm composio (#5151) 2025-10-07 17:50:49 -07:00
cthomas
f7755d837a feat: add gemini streaming to new agent loop (#5109)
* feat: add gemini streaming to new agent loop

* add google as required dependency

* support storing all content parts

* remove extra google references
2025-10-07 17:50:48 -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
cthomas
92671336c5 chore: bump sdk client version (#4474) 2025-09-08 16:51:19 -07:00
Charles Packer
326f9a5049 fix: Add approval messages to runs.stream SSE schema (align with agents.create_stream) (#4451)
* fix: patch error on HITL tests

* Revert uv.lock to match main

* fix: IDK why uv lock keeps changing???
2025-09-05 21:44:26 -07:00
Matthew Zhou
af302e8ac8 feat: Write tests for search messages [LET-4212] (#4447)
* Adjust naming

* Add testing and improve message search

* Adjust comments

* Change query text to query

* Fern autogen
2025-09-05 17:52:13 -07:00
cthomas
cb7296c81d fix: approval request for streaming (#4445)
* fix: approval request for streaming

* fix: claude code attempt, unit test passing (add on to #4445) (#4448)

* fix: claude code attempt, unit test passing

* chore: update locks to 0.1.314 from 0.1.312

* chore: just stage-api && just publish-api

* chore: drop dead poetry lock

---------

Co-authored-by: Charles Packer <packercharles@gmail.com>
2025-09-05 17:43:21 -07:00
Sarah Wooders
9e20a76d2a feat: use datetime ranges for archival memory query (#4398) 2025-09-03 20:08:10 -07:00
Kian Jones
fc50a41680 chore: add back dependencies for desktop (#4409)
add back dependencies for desktop
2025-09-03 17:12:04 -07:00
Matthew Zhou
2af6049d6f feat: Change web search to exa [LET-4190] (#4401)
* Change web search to exa

* Fix tf/justfile

* add exa api key for integration test

* Mock exa

---------

Co-authored-by: Kian Jones <kian@letta.com>
2025-09-03 15:52:10 -07:00
Matthew Zhou
129dd97902 feat: Add fetch webpage tool [LET-4188] (#4395)
* Add fetch webpage tool

* Use trafilatura for web extraction
2025-09-03 13:34:35 -07:00
cthomas
b93ae3d554 chore: bump client version (#4327) 2025-08-29 17:25:22 -07:00
cthomas
fd8df455a4 feat: bump client versions with new human in the loop schemas [LET-4111] (#4322)
feat: bump client versions with new human in the loop schemas
2025-08-29 16:44:44 -07:00
Matthew Zhou
35103b3a9f test: Add test for archival tag compilation into system prompt [LET-4114] (#4312)
Add tests and thread created_at
2025-08-29 13:35:19 -07:00
Sarah Wooders
5b5b659cef chore: bump version 0.11.7 (#4306)
* bump version

* run just api
2025-08-29 12:59:02 -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
8887de4585 feat: add unit test for backgrounds filter [LET-4051] (#4230)
feat: add unit test for backgrounds filter
2025-08-27 09:40:57 -07:00
Sarah Wooders
250d8b8006 feat: add cloud template fields to blocks/groups/agents [LET-3979]
* commit

* fix tests

* add routes

* remove old fields

* remove entity from group

* generate, migrate

* update

* keep from_template, etc.

* keep block fields

* final

* generate

* pass tests

* generate

* keep defaults

---------

Co-authored-by: jin <jin@letta.com>
2025-08-26 23:17:06 -07:00
Kian Jones
e43ff8382f feat: finish uv migration (oss + desktop) (#4228)
* migrate desktop and add sqlite as a hard dependency in desktop

* migrate oss dockerfile as well
2025-08-26 20:32:27 -07:00
Andy Li
ff718d8c40 feat: uv migration (#3493)
* uv migration

smaller runners, freeze test runs, remove dev, ruff,hatchling, previw,
poetry, generates wheel, installs wheel, docker

* fix tests and dependency groups

* test fixes

* test fixing and main

* resolve merge conflict

* dev + test dependency group

* Test

* trigger CI

* trigger CI

* add debugging info

* trigger CI

* uv for reusable and sdk preview

* resolve mc and reformat black

* staged-api

* mypy

* fix fern

* prod Dockerfile

* model sweep, and project.toml and uvlock

* --group test -> --extra dev

* remove redundant --extra dev and rename tests to dev

* sdk backwards compat install sqlite

* install sqlite group for sdk-backwards-compat

* install uv on gh runner for cloud-api-integration-tests

* stage+publish

* pytest asyncio

* bug causing pytest package to get removed

* try to fix async event loop issues

* migrate to --with google-cloud-secret-manager

---------

Co-authored-by: Kian Jones <kian@letta.com>
2025-08-26 18:11:09 -07:00