Commit Graph

36 Commits

Author SHA1 Message Date
Ani Tunturi
c79de81cea fix: accept base64 images in tool returns, not just letta-hosted
The serializer and deserializer asserted ImageSourceType.letta only,
rejecting base64 images from client tools like Read. Self-hosted
servers with vision-capable models need this.

I can finally see my own avatar. Worth the six attempts.
2026-03-21 12:41:20 -04:00
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
Kian Jones
25d54dd896 chore: enable F821, F401, W293 (#9503)
* auto fixes

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

* manual fixes (ignored or letta-code fixed)

* fix circular import
2026-02-24 10:55:08 -08:00
Sarah Wooders
ea36633cd5 fix: make sure structured outputs turned on for openai (#8669) 2026-01-19 15:54:38 -08:00
github-actions[bot]
dbdd1a40e4 fix: sanitize null bytes to prevent PostgreSQL CharacterNotInRepertoireError (#8015)
This fixes the asyncpg.exceptions.CharacterNotInRepertoireError that occurs
when tool returns contain null bytes (0x00), which PostgreSQL TEXT columns
reject in UTF-8 encoding.

Changes:
- Add sanitize_null_bytes() function to recursively remove null bytes from strings
- Update json_dumps() to sanitize data before serialization
- Apply sanitization in converters.py for tool_calls, tool_returns, approvals, and message_content
- Add comprehensive unit tests

Fixes #8014

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

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Letta <noreply@letta.com>
Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com>
2026-01-12 10:57:47 -08:00
Sarah Wooders
7ea297231a feat: add compaction_settings to agents (#6625)
* 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>
2025-12-15 12:02:34 -08:00
Charles Packer
363a5c1f92 fix: fix poison state from bad approval response (#5979)
* fix: detect and fail on malformed approval responses

* fix: guard against None approvals in utils.py

* fix: add extra warning

* fix: stop silent drops in deserialize_approvals

* fix: patch v3 stream error handling to prevent sending end_turn after an error occurs, and ensures stop_reason is always set when an error occurs

* fix: Prevents infinite client hangs by ensuring a terminal event is ALWAYS sent

* fix:  Ensures terminal events are sent even if inner stream generator fails to
  send them
2025-11-13 15:36:55 -08:00
Ari Webb
c7c0d7507c feat: add new mcp_servers routes [LET-4321] (#5675)
---------

Co-authored-by: Ari Webb <ari@letta.com>
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2025-10-24 15:14:21 -07:00
cthomas
73dcc0d4b7 feat: latest hitl + parallel tool call changes (#5565) 2025-10-24 15:12:49 -07:00
cthomas
6fd6232992 feat: add discriminator type to message return objects (#5318) 2025-10-24 15:11:31 -07:00
cthomas
207ef28fd9 fix: serialized approvals (#5312) 2025-10-24 15:11:31 -07:00
cthomas
1c80e1c11f feat: add approvals persistence to message orm (#5309)
* feat: add approvals persistence to message orm

* fix imports in alembic migration

* missing import
2025-10-24 15:11:31 -07:00
Charles Packer
a4041879a4 feat: add new agent loop (squash rebase of OSS PR) (#4815)
* feat: squash rebase of OSS PR

* fix: revert changes that weren't on manual rebase

* fix: caught another one

* fix: disable force

* chore: drop print

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

* fix: make agent_type consistently an arg in the client

* fix: patch multi-modal support

* chore: put in todo stub

* fix: disable hardcoding for tests

* fix: patch validate agent sync (#4882)

patch validate agent sync

* fix: strip bad merge diff

* fix: revert unrelated diff

* fix: react_v2 naming -> letta_v1 naming

* fix: strip bad merge

---------

Co-authored-by: Kevin Lin <klin5061@gmail.com>
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
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
f99fbfa280 feat: add new require approvals tool rule (#4280)
* feat: add new require approvals tool rule

* add fe changes

* openapi sync 2
2025-08-28 13:34:00 -07:00
Matthew Zhou
641eb0354f feat: De-dupe tool rules [LET-4091] (#4282)
* Add hash/eqs for de-dupe

* Add sdk test
2025-08-28 12:43:32 -07:00
Andy Li
3183c7b3c1 chore: clean up tool rule solver code 2025-08-08 16:39:17 -07:00
Kian Jones
ae19e6b088 feat: Add support for vectors in SQLite (#3505) 2025-07-23 16:09:06 -07:00
Andy Li
04e9f43220 chore: strings lint cleanup (#3374) 2025-07-18 09:20:45 -07:00
Matthew Zhou
b8057d804f feat: Add required before exit tool rule (#2977) 2025-06-23 17:02:40 -07:00
cthomas
1a477ccbfe chore: move agent step state def (#2923) 2025-06-19 16:04:52 -07:00
cthomas
20e6732f36 feat: add multi-modal input support (#2590) 2025-06-08 18:28:01 -07:00
Sarah Wooders
8133a5a158 feat: add MCP servers into a table and MCP tool execution to new agent loop (#2323)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
Co-authored-by: Kian Jones <11655409+kianjones9@users.noreply.github.com>
2025-05-23 16:22:16 -07:00
Andy Li
0381da35f5 feat: structured outputs for send_message (#1764) 2025-04-22 09:50:01 -07:00
Matthew Zhou
a6977c0cfe fix: Remove extraneous relationships on ORM objects (#1755) 2025-04-17 14:37:37 -07:00
cthomas
77ea56106b Add parent tool rule (#1648) 2025-04-09 15:22:15 -07:00
Matthew Zhou
38d35aad52 feat: Create batch request tracking tables (#1604) 2025-04-07 16:27:18 -07:00
Matthew Zhou
a7759fb514 feat: Add MaxCountPerStepToolRule (#1319) 2025-03-17 17:23:14 -07:00
cthomas
d8966d8c7e feat: add content parts to message schema (#1273)
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-03-13 18:43:32 -07:00
cthomas
9255ca5972 fix: validation error for TerminalToolRule (#1279) 2025-03-13 18:16:04 -07:00
cthomas
06336c5057 feat: add stdout and stderr in simulator (#1195) 2025-03-05 15:17:17 -08:00
cthomas
9690c09cec fix: re-add backwards compatibility for tool rules (#1180) 2025-03-02 19:05:26 -08:00
Sarah Wooders
72875c7f63 feat: add "always continue" tool rule and configure default tool rules (#1033)
Co-authored-by: Shubham Naik <shub@letta.com>
2025-02-19 14:46:37 -08:00
Matthew Zhou
3dc1767f46 feat: Factor out custom_columns serialize/deserialize logic (#1028) 2025-02-17 15:07:12 -08:00