Commit Graph

6642 Commits

Author SHA1 Message Date
Kian Jones
86fbd39a16 feat: add dd instrumentation to web (#6531)
* add dd instrumentation to web

* instrument web fully

* omit dd

* add error handling for dd-trace initialization

* use logger instead of console in dd-trace error handling

* exception replay

* fix dd-trace native module bundling and error serialization
2025-12-15 12:02:34 -08:00
Kevin Lin
1ca9df0626 feat: Add memory_apply_patch to base tools (#6491)
add memory apply patch
2025-12-15 12:02:34 -08:00
Ari Webb
4092820f3a feat: add project id scoping for tools backend changes (#6529) 2025-12-15 12:02:34 -08:00
Sarah Wooders
4f1fbe45aa feat: add index and concurrency control for tools (fixed alembic) (#6552) 2025-12-15 12:02:34 -08:00
Sarah Wooders
c8c06168e2 Revert "feat: add index and concurrency control for tools " (#6551)
Revert "feat: add index and concurrency control for tools  (#6547)"

This reverts commit f4abf8e061bc2f5e08853b5ce5775a7f8626463a.
2025-12-15 12:02:34 -08:00
Sarah Wooders
a2d3011d84 feat: add index and concurrency control for tools (#6547) 2025-12-15 12:02:34 -08:00
Kian Jones
09c027692f tests: assistant msg validation error (#6536)
* add regression test for dict content in AssistantMessage

Tests the fix for pydantic validation error when send_message tool
returns dict content like {'tofu': 1, 'mofu': 1, 'bofu': 1}.

The test verifies that dict content is properly serialized to JSON
string before creating AssistantMessage.

* improve type annotation for validate_function_response

Changed return type from Any to str | dict[str, Any] to match actual
behavior. This enables static type checkers (pyright, mypy) to catch
type mismatches like the AssistantMessage bug.

With proper type annotations, pyright would have caught:
  error: Argument of type "str | dict[str, Any]" cannot be assigned
  to parameter "content" of type "str"

This prevents future bugs where dict is passed to string-only fields.

* add regression test for dict content in AssistantMessage

Moved test into existing test_message_manager.py suite alongside other
message conversion tests.

Tests the fix for pydantic validation error when send_message tool
returns dict content like {'tofu': 1, 'mofu': 1, 'bofu': 1}.

The test verifies that dict content is properly serialized to JSON
string before creating AssistantMessage.
2025-12-15 12:02:34 -08:00
Sarah Wooders
a18caf69f7 fix: undo tool manager changes (#6546) 2025-12-15 12:02:34 -08:00
cthomas
2116a07706 fix: incorrect stop reasons (#6539) 2025-12-15 12:02:34 -08:00
cthomas
77d1c3365e fix: granular cancellation check (#6540) 2025-12-15 12:02:34 -08:00
cthomas
b67347dff2 fix: remove redundant letta message conversion (#6538) 2025-12-15 12:02:33 -08:00
cthomas
4916d281ce fix: dont let message ids diverge in memory vs db (#6537) 2025-12-15 12:02:33 -08:00
Kian Jones
74e0172efe fix: AssistantMessage validation error when content is dict (#6533)
fix AssistantMessage validation error when content is dict

validate_function_response can return either a string or dict, but
AssistantMessage.content expects a string. When a tool returns a dict
like {'tofu': 1, 'mofu': 1, 'bofu': 1}, it needs to be JSON-serialized
before passing to AssistantMessage.

Fixes: pydantic_core._pydantic_core.ValidationError: 2 validation errors for AssistantMessage
2025-12-15 12:02:33 -08:00
jnjpng
0c21d20914 fix: redundant tool fetch on no op update and fix tool manager tracing (#6535)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
cthomas
6fd73d4dcf chore: add more summarize tracing (#6532) 2025-12-15 12:02:33 -08:00
Kian Jones
edeac2c679 fix: fix gemini otel bug and add tracing for tool upsert (#6523)
add tracing for tool upsert, and fix gemini otel bug
2025-12-15 12:02:33 -08:00
jnjpng
7058d63bd8 fix: update tool check and add tracing to update tool logic (#6530)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Charles Packer
d3f4d00113 feat(core): add support for gpt-5.1-codex-max (#6528) 2025-12-15 12:02:33 -08:00
cthomas
864415532e fix: list index error for sleeptime due to summarization failure (#6525)
fix: list index error for sleeptime
2025-12-15 12:02:33 -08:00
cthomas
109989ac1a fix: tracing for summarizer errors (#6524) 2025-12-15 12:02:33 -08:00
cthomas
0d18ecc2ec feat: add placeholder for image inputs in Anthropic proxy [LET-6449] (#6522)
- Add [IMAGE] placeholder when extracting user messages with image content blocks
- Allows LLM to know images were present in conversation history
- LLM can infer context from surrounding text and conversation flow

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

Co-authored-by: Letta <noreply@letta.com>
2025-12-15 12:02:33 -08:00
jnjpng
e5bda413c0 fix: agent environment variables not using encrypted values (#6520)
* base

* clean up

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
cthomas
08772c3f46 feat: improve Anthropic proxy memory injection and message capture (#6519)
- Add Letta memory capability notice in memory blocks prompt
- Fix duplicate message persistence by only capturing latest user message
- Append memory blocks to end of system prompt instead of prepending
- Skip empty description tags in memory block formatting

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

Co-authored-by: Letta <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Kian Jones
0bac88d88a feat: run id correlation for core logs (#6518)
run-id correlation
2025-12-15 12:02:33 -08:00
Ari Webb
eb547bb96e fix: clear message history no longer deletes messages (#6515)
* fix: clear message history no longer deletes messages

* toast and make it stay for 8 secs

* fix test

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-12-15 12:02:33 -08:00
cthomas
b486d7b472 feat: forward all client headers in Anthropic proxy (#6517)
- Forward all incoming headers from client to Anthropic API
- Extract header preparation logic into prepare_anthropic_headers() helper
- Filter out hop-by-hop headers and authorization header
- Only add fallback API key if client doesn't provide one

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

Co-authored-by: Letta <noreply@letta.com>
2025-12-15 12:02:33 -08:00
cthomas
7b5d03a714 feat: use Letta XML memory format in Anthropic proxy (#6514)
- Update memory injection to use Letta XML format with memory_blocks tags
- Extract memory formatting into format_memory_blocks() helper function

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

Co-authored-by: Letta <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Christina Tong
972c61d0b8 chore: fallback to timestamp retrieval for message search [LET-6429] (#6510) 2025-12-15 12:02:33 -08:00
Sarah Wooders
3569721fd4 fix: avoid infinite summarization loops (#6506) 2025-12-15 12:02:33 -08:00
Kian Jones
a38475f23d fix: safely load span attributes for provider traces (#6508)
json.dumps on request data. Also remove step and actor since they are already present in the span
2025-12-15 12:02:33 -08:00
Sarah Wooders
9cbb8fa42a feat: add .skills/db-migrations-schema-changes (#6476) 2025-12-15 12:02:33 -08:00
jnjpng
cf30e8f910 chore: add stack info to migration warning log (#6500)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
jnjpng
89ca8fe8b0 feat: read from encrypted values with error on fallback [LET-4250] (#6484)
* base

* warning

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:33 -08:00
Kian Jones
647e271c2a fix: add more logging for stream error (#6490)
* trying tout gpt-5.1-codex

* add unit test for message content

* try to support multimodal

* remove ValueError and add logging on stream error

* prevent stream termination from api spec implementation errors

* fix: remove final_response references from non-Responses API interfaces

* fix: add diagnostic attributes to SimpleOpenAIResponsesStreamingInterface

* fix: remove final_response from SimpleOpenAIStreamingInterface (Chat Completions API)
2025-12-15 12:02:33 -08:00
Kian Jones
5165d60881 feat: add a new span and log the provider request and response data objects (#6492)
add a new span and log the provider request and response data objects
2025-12-15 12:02:33 -08:00
Kian Jones
d6292b6eb6 fix: bug which causes unrecoverable state if previous message was an image (#6486)
* trying tout gpt-5.1-codex

* add unit test for message content

* try to support multimodal
2025-12-15 12:02:33 -08:00
cthomas
5109ba1384 feat: add source param to logging (#6473)
* feat: add source param to logging

* api sync
2025-12-15 12:02:32 -08:00
Kian Jones
964fc05cb9 chore: add more tracing to tool upsert endpoint (#6471)
* add tracing

* fix hallucination
2025-12-15 12:02:19 -08:00
jnjpng
c90eacdcbb fix: step metrics not found (#6472)
* base

* comment

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:02:19 -08:00
Sarah Wooders
90e2030f41 fix: fix manual summarization (#6466) 2025-12-15 12:02:19 -08:00
Sarah Wooders
bd97b23025 feat: fallback to all mode for summarizer if error (#6465) 2025-12-15 12:02:19 -08:00
Sarah Wooders
7fa141273d fix: dont run summarizer if pending approval (#6464) 2025-12-15 12:02:19 -08:00
Sarah Wooders
91e3dd8b3e feat: fix new summarizer code and add more tests (#6461) 2025-12-15 12:02:19 -08:00
Sarah Wooders
86023db9b1 feat: get rid of client injection in args and just make it always available (#6459) 2025-12-15 12:02:19 -08:00
Sarah Wooders
f417e53638 fix: fix cancellation issues without making too many changes to message_ids persistence (#6442) 2025-12-15 12:02:19 -08:00
Charles Packer
1f7165afc4 fix: patch counting of tokens for anthropic (#6458)
* fix: patch counting of tokens for anthropic

* fix: patch ui to be simpler

* fix: patch undercounting bug in anthropic when caching is on
2025-12-15 12:02:19 -08:00
Sarah Wooders
c0b422c4c6 fix: patch summarizer and add tests (#6457) 2025-12-15 12:02:19 -08:00
Charles Packer
e67c98eedb feat: add tests for prompt caching + fix anthropic prompt caching [LET-6373] (#6454)
* feat: add tests for prompt caching

* fix: add cache control breakpoints for anthropic + fix tests

* fix: silence logging

* fix: patch token counting error

* fix: same patch on non-streaming path
2025-12-15 12:02:19 -08:00
Sarah Wooders
e862bae524 feat: patch tool calling endpoint and add SDK testing (#6456) 2025-12-15 12:02:19 -08:00
Sarah Wooders
ceadacd30e feat: support programmatic tool execution (cloud only) (#6441) 2025-12-15 12:02:19 -08:00