Commit Graph

6812 Commits

Author SHA1 Message Date
jnjpng
e56c5c5b49 fix: global sandbox environment variables not injected on tool execution (#8310)
* base

* test
2026-01-12 10:57:48 -08:00
Charles Packer
e57adc0a6e chore: mark agent.messages.stream endpoint as deprecated (#8227) 2026-01-12 10:57:48 -08:00
Cameron
7c44375cce feat: add message_types filter to list messages endpoint (#8280)
* feat: add message_types filter to list messages endpoint

Add the ability to filter messages by type when listing message history
via GET /v1/agents/{agent_id}/messages. This brings parity with the
create message endpoint which already supports include_return_message_types.

Changes:
- Add message_types query parameter to list_messages endpoint in agents.py
- Add message_types parameter to get_agent_recall_async in server.py
- Filter messages by message_type after LettaMessage conversion
- Add test for message_types filtering

Closes #8277

Written by Cameron ◯ Letta Code

> "Simplicity is the ultimate sophistication." - Leonardo da Vinci

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

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

* chore: regenerate OpenAPI spec and SDK for message_types filter

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

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

Written by Cameron ◯ Letta Code

"The only way to do great work is to love what you do." - Steve Jobs

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-12 10:57:48 -08:00
Sarah Wooders
87d920782f feat: add conversation and conversation_messages tables for concurrent messaging (#8182) 2026-01-12 10:57:48 -08:00
cthomas
c66b852978 feat: add more data to event loop logging (#8299) 2026-01-12 10:57:48 -08:00
cthomas
1b25154c39 fix: unbounded gather for agents listing (#8297)
* fix: unbounded gather for agents listing

* more callsites
2026-01-12 10:57:48 -08:00
cthomas
3aaab90b4c feat: use bounded concurrency for decryption (#8296) 2026-01-12 10:57:48 -08:00
cthomas
3b0b2cbee1 fix: unbounded file to pydantic conversion (#8292)
* fix: unbounded file to pydantic conversion

* remove var name
2026-01-12 10:57:48 -08:00
Shubham Naik
6e0bf69ed8 feat: pipelines backend (#8218)
* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore; udpate secrets
2026-01-12 10:57:48 -08:00
cthomas
cfde955313 feat: prevent unbounded file queries (#8285) 2026-01-12 10:57:48 -08:00
cthomas
c73a9579a4 feat: yield to event loop in file bulk operation (#8281) 2026-01-12 10:57:48 -08:00
Ari Webb
cc825b4f5c Revert "Revert "feat: enable provider models persistence" (#6590)" (#6595) 2026-01-12 10:57:48 -08:00
Charles Packer
64a1a8b14e feat: expose agent_id to the messages search api endpoint (#8252) 2026-01-12 10:57:48 -08:00
Sarah Wooders
2d84af11c3 fix: override with client-side tools is overlapping (#8232) 2026-01-12 10:57:48 -08:00
Charles Packer
3cdee2e78f fix: include client_tools in streaming requires_approval_tools (#8230)
When streaming, the LLM adapter needs to know which tools require
approval so it can emit ApprovalRequestMessage instead of ToolCallMessage.
Client-side tools were being passed to the agent but not included in
the requires_approval_tools list passed to the streaming interface.

This caused the streaming interface to emit tool_call_message for
client tools, but the stop_reason was still requires_approval,
resulting in empty approvals arrays on the client side.

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

Co-authored-by: Letta <noreply@letta.com>
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
Sarah Wooders
7669896184 feat: allow client-side tools to be specified in request (#8220)
* feat: allow client-side tools to be specified in request

Add `client_tools` field to LettaRequest to allow passing tool schemas
at message creation time without requiring server-side registration.
When the agent calls a client-side tool, execution pauses with
stop_reason=requires_approval for the client to provide tool returns.

- Add ClientToolSchema class for request-level tool schemas
- Merge client tools with agent tools in _get_valid_tools()
- Treat client-side tool calls as requiring approval
- Add integration tests for client-side tools flow

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

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

* test: add comprehensive end-to-end test for client-side tools

Update integration test to verify the complete flow:
- Agent calls client-side tool and pauses
- Client provides tool return with secret code
- Agent processes and responds
- User asks about the code, agent recalls it
- Validate full conversation history makes sense

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

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

* update apis

* fix: client-side tools schema format and test assertions

- Use flat schema format for client tools (matching t.json_schema)
- Support both object and dict access for client tools
- Fix stop_reason assertions to access .stop_reason attribute

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

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

* refactor: simplify client_tools access pattern

ClientToolSchema objects always have .name attribute

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

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

* fix: add client_tools parameter to LettaAgentV2 for API compatibility

V2 agent doesn't use client_tools but needs the parameter
to match the base class signature.

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

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

* revert: remove client_tools from LettaRequestConfig

Client-side tools don't work with background jobs since
there's no client present to provide tool returns.

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

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

* fix: add client_tools parameter to SleeptimeMultiAgent classes

Add client_tools to step() and stream() methods in:
- SleeptimeMultiAgentV3
- SleeptimeMultiAgentV4

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

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

* chore: regenerate API specs for client_tools support

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

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

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-12 10:57:48 -08:00
github-actions[bot]
76008c61f4 fix: handle httpx.RemoteProtocolError during LLM streaming (#8206) 2026-01-12 10:57:48 -08:00
github-actions[bot]
abb325f32d fix: prevent ForeignKeyViolationError on messages table (#8202)
Add validation in `create_many_messages_async` to check if run_ids exist
before attempting to insert messages. If a run has been deleted (e.g.,
during cancellation or cleanup) while messages are still being created,
the run_id is set to NULL instead of causing a ForeignKeyViolationError.

This handles the race condition where:
1. A run is created and workflow is started
2. The run is deleted before the workflow's message creation completes
3. The message insert fails with FK violation

Fixes #8201, #8119, #8091, #8025

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

Co-authored-by: letta-code <248085862+letta-code@users.noreply.github.com>
Co-authored-by: Letta <noreply@letta.com>
2026-01-12 10:57:48 -08:00
cthomas
8f4074d2fc feat: dump traces on event loop saturation (#8185) 2026-01-12 10:57:48 -08:00
cthomas
9fbefb62a0 fix: json parse error in middleware (#8187) 2026-01-12 10:57:48 -08:00
cthomas
a6dd98d843 feat: add event loop saturation detection (#8177)
Co-authored-by: jnjpng <jin@letta.com>
2026-01-12 10:57:48 -08:00
cthomas
9c986c6e6f fix: remove duplicate seralization in block creation (#8173) 2026-01-12 10:57:48 -08:00
cthomas
449e23a265 fix: ssl connection requried db error [LET-6720] (#8172)
fix: ssl connection requried db error
2026-01-12 10:57:48 -08:00
cthomas
9be2ab2c3d fix: skip additional query in stale data error handling (#8171) 2026-01-12 10:57:48 -08:00
jnjpng
ca0c2a5370 chore: add more tracing to logging middleware (#8175)
* base

* logging

* more
2026-01-12 10:57:48 -08:00
jnjpng
9d07a1a370 chore: remove stale TODO comments in app.py (#8176)
Remove outdated NOTE and TODO comments that are no longer relevant.
2026-01-12 10:57:47 -08:00
cthomas
f6d37eb315 fix: span name normalization for logging (#8170) 2026-01-12 10:57:47 -08:00
cthomas
6c19192413 fix: validation failure on blocks retrieve [LET-6709] (#8146)
* fix: validation failure on blocks retrieve

* api sync
2026-01-12 10:57:47 -08:00
cthomas
b83e7c1cf9 fix: sanitize null bytes before persisting in db [LET-6710] (#8147)
fix: sanitize null bytes before persisting in db
2026-01-12 10:57:47 -08:00
Shubham Naik
c192600e8c Feeds v0 (#8034)
* feeds v0

* wow

* chore: add functions

* chore: add functions

* chore: add apis

* chore: add apis

* chore: add apis

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: next

* chore: regenerate api

* chore: regenerate api

* chore: regenerate api

* chore: regenerate api

---------

Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: Shubham Naik <shubhamnaik@Shubhams-MacBook-Pro.local>
2026-01-12 10:57:47 -08:00
jnjpng
7e8088adc5 chore: add tracing for request middleware (#8142)
* base

* update

* more
2026-01-12 10:57:47 -08:00
Sarah Wooders
190dbfa93b fix: remove error thrown if parallel tool calling and tool rules are both enabled (#8143) 2026-01-12 10:57:47 -08:00
cthomas
e904330dde fix: step metrics db timeouts [LET-6697] (#8136)
fix: step metrics db timeouts
2026-01-12 10:57:47 -08:00
cthomas
a7b3f469ac fix: more user friendly error for tpuf namespace not found [LET-6707] (#8141)
fix: more user friendly error for tpuf namespace not found
2026-01-12 10:57:47 -08:00
cthomas
442d9accae fix: return 404 for file not found [LET-6698] (#8137)
fix: return 404 for file not found
2026-01-12 10:57:47 -08:00
cthomas
d489d8837f fix: broken pagination for objects with missing created_at [LET-6699] (#8139)
fix: broken pagination for objects with missing created_at
2026-01-12 10:57:47 -08:00
cthomas
39dc1d9736 fix: image fetching timeouts [LET-6700] (#8140)
fix: image fetching timeouts
2026-01-12 10:57:47 -08:00
github-actions[bot]
21df642a43 fix: add URL validation for MCP server URLs to prevent malformed protocol errors (#8079)
Adds field validators to CreateSSEMCPServer, CreateStreamableHTTPMCPServer,
and their Update counterparts to validate that server_url fields:
- Start with 'http://' or 'https://'
- Have a valid host

This prevents errors like 'httpx.UnsupportedProtocol: Request URL has an
unsupported protocol 'hthttps://'' caused by user input typos.

Fixes #8078

👾 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
jnjpng
700409d943 fix: sanitize null bytes test (#8135)
base
2026-01-12 10:57:47 -08:00
cthomas
0dd1df306a fix: concurrent block update rollback [LET-6695] (#8133)
fix: concurrent block update rollback
2026-01-12 10:57:47 -08:00
jnjpng
fa9a98351d fix: add redis tracing (#8132)
base
2026-01-12 10:57:47 -08:00
cthomas
b6535b7590 fix: agent-runs relationship load causing timeouts [LET-6694] (#8129)
fix: agent-runs relationship load causing timeouts
2026-01-12 10:57:47 -08:00
cthomas
b08e55c0ee fix: sleeptime db timeout [LET-6692] (#8126)
fix: sleeptime db timeout
2026-01-12 10:57:47 -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
d5decc2a27 fix: persist streaming errors in run metadata (#8062) 2026-01-12 10:57:47 -08:00
Sarah Wooders
c5c633285b fix: pass in stop_reason for sleeptime loop (#8086) 2026-01-12 10:57:47 -08:00
Sarah Wooders
0722877423 fix: validate parallel tool calls with tool rules at create/update time (#8060)
* fix: validate parallel tool calls with tool rules at create/update time

Move validation from runtime to agent create/update time for better UX.
Add client-side enforcement to truncate parallel tool calls when disabled
(handles providers like Gemini that ignore the setting).

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

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

* update apis

* undo

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-12 10:57:47 -08:00
Sarah Wooders
28b2f8b03f fix: just api generation (#8063) 2026-01-12 10:57:47 -08:00
cthomas
6f1ead8ba9 fix: remove sync api calls for byok (#8031)
* fix: remove sync api calls for byok

* fix import
2026-01-12 10:57:47 -08:00