Commit Graph

1977 Commits

Author SHA1 Message Date
Christina Tong
8468ef3cd7 chore: migrate test sdk client to v1 [LET-5981] (#5887)
* chore: migrate test sdk client to v1 [LET-5981]

* simplify

* simplify
2025-11-13 15:36:39 -08:00
Charles Packer
a6077f3927 fix(core): Fix agent loop continuing after cancellation in letta_agent_v3 [LET-6006] (#5905)
* Fix agent loop continuing after cancellation in letta_agent_v3

Bug: When a run is cancelled, _check_run_cancellation() sets
self.should_continue=False and returns early from _step(), but the outer
for loop (line 245) continues to the next iteration, executing subsequent
steps even though cancellation was requested.

Symptom: User hits cancel during step 1, backend marks run as cancelled,
but agent continues executing steps 2, 3, etc.

Root cause: After the 'async for chunk in response' loop completes (line 255),
there was no check of self.should_continue before continuing to the next
iteration of the outer step loop.

Fix: Added 'if not self.should_continue: break' check after the inner loop
to exit the outer step loop when cancellation is detected. This makes v3
consistent with v2 which already had this check (line 306-307).

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

Co-authored-by: Letta <noreply@letta.com>

* add integration tests

* fix: misc fixes required to get cancellations to work on letta code localhost

---------

Co-authored-by: Letta <noreply@letta.com>
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2025-11-13 15:36:39 -08:00
Ari Webb
7427c0998e feat: gemini parallel tool calling non streaming [LET-5993] (#5889)
* first hack

* just test non streaming

* stream_steps should pass too

* clean up

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:39 -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
Sarah Wooders
57bb051ea4 feat: add tool return truncation to summarization as a fallback [LET-5970] (#5859) 2025-11-13 15:36:30 -08:00
Christina Tong
381ca5bde8 chore: migrate built in tools integration test to sdk v1 [LET-5980] (#5883)
* chore: migrate built in tools integration test to sdk v1

* fix

* remove trialing commas
2025-11-13 15:36:20 -08:00
Christina Tong
255fdfecf2 feat: migrate integration_test_human_in_the_loop to sdk v1 [LET-5979] (#5878)
* feat: migrate integration_test_human_in_the_loop to sdk v1

* update modify

* parallel tool calling fixes

* fix

* updat aparallel tool calling

* remove regex matching
2025-11-13 15:36:20 -08:00
Kian Jones
185031882a fix: prevent huge otel spans causing pods to be OOMKilled (#5871)
* otel fix

* add unit test

* log the resource id

* iterables support and fix unittest

* fix some edge cases
2025-11-13 15:36:20 -08:00
Sarah Wooders
cfeed463a9 Revert "feat: provider-specific model configuration " (#5873)
Revert "feat: provider-specific model configuration  (#5774)"

This reverts commit 34a334949a3ef72cd49ff0ca3da9e85d16daa57c.
2025-11-13 15:36:20 -08:00
Matthew Zhou
ff81f4153b feat: Support parallel tool calling streaming for OpenAI chat completions [LET-4594] (#5865)
* Finish chat completions parallel tool calling

* Undo comments

* Add comments

* Remove test file
2025-11-13 15:36:14 -08:00
Christina Tong
599adb4c26 chore: migrate integration test send message to v1 sdk [LET-5940] (#5794)
* chore: migrate integration test send message to v1 sdk

* new folder

* set up new workflows for integration test

* remove file

* update stainless workflow

* fix import err

* add letta-client version logging

* fix: SDK cache miss should fall back to PyPI instead of failing

When the Stainless SDK cache is not available, the workflow should
fall back to installing the published SDK from PyPI rather than
failing the CI build. The workflow already has this fallback logic
in the "Install Stainless SDK" step, but the "Check SDK cache"
step was failing before it could reach that point.

This change converts the hard failure (exit 1) to a warning message,
allowing the workflow to continue and use the PyPI fallback.

Co-Authored-By: Claude <noreply@anthropic.com>

* force upgrade

* remove frozen

* install before running

* add no sync

* use upgrade instead of upgrade package

* update

* fix llm config

* fix

* update

* update path

* update workflow

* see installed version

* add fallback

* update

* fix mini

* lettaping

* fix: handle o1 token streaming and LettaPing step_id validation

- Skip LettaPing messages in step_id validation (they don't have step_id)
- Move o1/o3/o4 token streaming check before general assertion in assert_tool_call_response
- o1 reasoning models omit AssistantMessage in token streaming mode (6 messages instead of 7)

---------

Co-authored-by: Kian Jones <kian@letta.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-13 15:36:14 -08:00
Sarah Wooders
aaa12a393c feat: provider-specific model configuration (#5774)
* initial code updates

* add models

* cleanup

* support overriding

* add apis

* cleanup reasoning interfaces to match models

* update schemas

* update apis

* add new field

* remove parallel

* various fixes

* modify schemas

* fix

* fix

* make model optional

* undo model schema change

* update schemas

* update schemas

* format

* fix tests

* attempt to patch web

* fic docs

* change schemas

* update error

* fix tests

* delete tests

* clean up undefined matching conditional

---------

Co-authored-by: jnjpng <jin@letta.com>
Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-13 15:36:14 -08:00
Ari Webb
48cc73175b feat: parallel tool calling for openai non streaming [LET-4593] (#5773)
* first hack

* clean up

* first implementation working

* revert package-lock

* remove openai test

* error throw

* typo

* Update integration_test_send_message_v2.py

* Update integration_test_send_message_v2.py

* refine test

* Only make changes for openai non streaming

* Add tests

---------

Co-authored-by: Ari Webb <ari@letta.com>
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-11-13 15:36:14 -08:00
Sarah Wooders
6654473514 fix: handle block race conditions (#5819) 2025-11-13 15:36:14 -08:00
Shubham Naik
95816b9b28 Shub/let 5962 add perfomranceduration search to runs [LET-5962] (#5850)
* feat: add perfomrance/search to list internal runs

* chore: add tests

* chore: fix ui

* feat: support UI for this

* chore: update tests

* chore: update types

---------

Co-authored-by: Shubham Naik <shub@memgpt.ai>
2025-11-13 15:36:14 -08:00
jnjpng
bd61ba85dd chore: update stainless mcp config (#5830)
* base

* try

* client no token

* session

* try tests

* fix mcp_servers_test

* remove deprecated test

* remove reference to mcp_serverS

* use fastmcp for mocking

* uncomment

---------

Co-authored-by: Letta Bot <noreply@letta.com>
Co-authored-by: Ari Webb <ari@letta.com>
Co-authored-by: Ari Webb <arijwebb@gmail.com>
2025-11-13 15:36:14 -08:00
Sarah Wooders
24a14490d8 fix: add more error logging and tests for streaming LLM errors (#5844) 2025-11-13 15:36:14 -08:00
Ari Webb
9d5fdc6de7 feat: migrate integration test mcp serverspy to use 1.0 client [LET-5945] (#5814)
* new test first hack, should still break

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:14 -08:00
Ari Webb
0596a66c04 feat: new stainless sdk tests working locally [LET-5939] (#5793)
* new stainless sdk tests working locally

* Update conftest.py

* Update conftest.py

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:02 -08:00
Sarah Wooders
a566900533 chore: add back test_server.py (#5783) 2025-11-13 15:36:00 -08:00
Ari Webb
9cab61fe3f feat: create sdk_v1 test folder [LET-5937] (#5790)
create sdk_v1 test folder

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:35:41 -08:00
Kian Jones
60226ad203 fix: missing cursor kwargs (#5763)
* accept cursor logic

* add test
2025-11-13 15:35:34 -08:00
Kian Jones
1059452c11 fix: expect raise on detach to deleted agent (#5770)
just expect raise
2025-11-13 15:35:34 -08:00
Ari Webb
f3a40a41f5 feat: updated backend to not allow minimal for codex [LET-5883] (#5760)
* updated backend

* add function in openai_client

* remove values before error

* remove test

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:35:34 -08:00
Sarah Wooders
e7fff12da0 feat: patch model listing to actually match handle [LET-5888] (#5754) 2025-11-13 15:35:34 -08:00
Christina Tong
5fddf94ac3 fix: pagination broken in runs table [LET-5790] (#5759)
* fix: pagination broken in runs table [LET-5790]

* update pagination test

* fix test
2025-11-13 15:35:34 -08:00
jnjpng
6e2c002af3 feat: add stainless pagination for top level arrays with order by [LET-5800] (#5687)
* base

* revert openapi

* union

* simplify

* stainless

* stainless

* fix

* fix test

* generate

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:14:31 -07:00
Matthew Zhou
e7e86124f9 feat: Support embedding config on the archive [LET-5832] (#5714)
* Add embedding config field to archives

* Fix alembic script

* Simplify archive manager

* Fern autogen

* Fix failing tests

* Fix alembic
2025-10-24 15:14:21 -07: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
Matthew Zhou
69343bf5f2 feat: Add delete endpoint [LET-4400] (#5711)
* Add delete endpoint

* Fern autogen
2025-10-24 15:14:20 -07:00
Ari Webb
6b5c3a7130 feat: list_agents_for_archive endpoint [LET-4407] (#5684)
* list_archives_for_agent

* use pattern from blocks instead

* use new parameter include

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-10-24 15:14:20 -07:00
cthomas
ee7f2b9e84 feat: add helper to verify sdk version [ADD-1] (#5698)
feat: add helper to verify sdk version
2025-10-24 15:14:17 -07:00
cthomas
afdf0f80e3 feat: add backend support for agent relationship loads (#5693) 2025-10-24 15:14:09 -07:00
Ari Webb
e54df7f3a4 feat: add attach and detach archive to agent [LET-4402] (#5679)
* add attach and detach

Co-authored-by: Ari Webb <ari@letta.com>
2025-10-24 15:13:47 -07:00
cthomas
c3c38f2713 feat: rename multi agent group to managed group [LET-5799] (#5672)
feat: rename multi agent group to managed group
2025-10-24 15:13:47 -07:00
cthomas
14faa27869 feat: replace agent.identity_ids with agent.identities [LET-5803] (#5673)
feat: replace agent.identity_ids with agent.identities
2025-10-24 15:13:47 -07:00
Kian Jones
45065297a0 feat: runtime validation for ids for internal managers calls (#5544)
* claude coded first pass

* fix test cases to expect errors instead

* fix this

* let's see how letta-code did

* claude

* fix tests, remove dangling comments, retrofit all managers functions with decorator

* revert to main for these since we are not erroring on invalid tool and block ids

* reorder decorators

* finish refactoring test cases

* reorder agent_manager decorators and fix test tool manager

* add decorator on missing managers

* fix id sources

* remove redundant check

* uses enum now

* move to enum
2025-10-24 15:13:47 -07:00
cthomas
0a083459c6 feat: add new blocks field to agent state schema test (#5668) 2025-10-24 15:13:47 -07:00
Christina Tong
12185c8601 feat: add tools used filtering to internal runs [LET-5415] (#5557)
* feat: add tool_used field to run_metrics [LET-5419]

* change to tool name

* use tool ids over names

* feat: add internal runs route with template_family filtering

* feat: add step count filtering to internal runs [LET-5417]

* remove import

* add auto generated

* feat: add tools used filtering to internal runs [LET-5415]

* add test

* add test

* fix snippets
2025-10-24 15:13:47 -07:00
Ari Webb
abbd1b5595 Revert "feat: revise mcp tool routes [LET-4321]" (#5652)
Revert "feat: revise mcp tool routes [LET-4321] (#5631)"

This reverts commit e15f120078652b2160d64a1e300317b95eccb163.
2025-10-24 15:13:47 -07:00
Ari Webb
747e7eae0e feat: revise mcp tool routes [LET-4321] (#5631)
* start adding tools mapping

* ready to start testing new table migration

* alembic generated code

* just stage api

* small update

* integration tests

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-10-24 15:13:47 -07:00
Christina Tong
77c797c752 feat: add step count filtering to internal runs [LET-5417] (#5547)
* feat: add tool_used field to run_metrics [LET-5419]

* change to tool name

* use tool ids over names

* feat: add internal runs route with template_family filtering

* feat: add step count filtering to internal runs [LET-5417]

* remove import

* add auto generated

* add test

* fix snippets
2025-10-24 15:13:47 -07:00
Christina Tong
44574ec264 feat: add internal runs route with template_family filtering [LET-5416] (#5543)
* feat: add tool_used field to run_metrics [LET-5419]

* change to tool name

* use tool ids over names

* feat: add internal runs route with template_family filtering

* remove import

* add auto generated

* restrict internal runs

* add test, address comments

* add docs and auto generated fields

* remove unused template mixins

* update openapi

* add generated
2025-10-24 15:13:15 -07:00
cthomas
7b2e7e2f4c feat: remove un-paginated message list on usage stats [LET-5747] (#5599)
feat: remove un-paginated message list on usage stats
2025-10-24 15:13:15 -07:00
Kevin Lin
35b5383724 feat: match line number rendering to Anthropic / OAI defaults (#5492) 2025-10-24 15:13:15 -07:00
jnjpng
39a23e5960 fix: mcp schema generation test (#5608)
* base

* base

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:13:15 -07:00
jnjpng
b0c0c8752b feat: support anyOf for structured output tools [LET-5615] (#5556)
* base

* works?

* update tests

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:13:15 -07:00
jnjpng
8275bdd7e3 feat: add agent state schema change test (#5573)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:13:15 -07:00
cthomas
73dcc0d4b7 feat: latest hitl + parallel tool call changes (#5565) 2025-10-24 15:12:49 -07:00
cthomas
f8437d47e2 feat: add support for hitl parallel tool calling (#5549)
* feat: add support for hitl parallel tool calling

* rename to requested_tool_calls
2025-10-24 15:12:11 -07:00