Commit Graph

334 Commits

Author SHA1 Message Date
Sarah Wooders
ae4490c5b3 fix: filter out stop reason from response streaming (#7332) 2025-12-17 17:31:03 -08:00
jnjpng
25d75d6528 fix: update aysnc get plaintext callsites (#7069)
* base

* resolve

* fix

* fix
2025-12-17 17:31:02 -08:00
cthomas
e6a4b3e874 fix: nonetype not iterable (#7216) 2025-12-17 17:31:02 -08:00
Sooty
6f48d4bd48 Correct provider name for openai-proxy in LLMConfig (#3097) 2025-12-16 19:37:54 -08:00
Sarah Wooders
bd9f3aca9b fix: fix prompt_acknowledgement usage and update summarization prompts (#7012) 2025-12-15 12:03:09 -08:00
Sarah Wooders
a731e01e88 fix: use model instead of model_settings (#6834) 2025-12-15 12:03:09 -08:00
Kevin Lin
4b9485a484 feat: Add max tokens exceeded to stop reasons [LET-6480] (#6576) 2025-12-15 12:03:09 -08:00
Sarah Wooders
c9ad2fd7c4 chore: move things to debug logging (#6610) 2025-12-15 12:03:09 -08:00
cthomas
bffb9064b8 fix: step logging error (#6755) 2025-12-15 12:03:08 -08:00
jnjpng
4be813b956 fix: migrate sandbox and agent environment variables to encrypted only (#6623)
* base

* remove unnnecessary db migration

* update

* fix

* update

* update

* comments

* fix

* revert

* anotha

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-12-15 12:03:08 -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
Sarah Wooders
a2dfa5af17 fix: reorder summarization (#6606) 2025-12-15 12:02:34 -08:00
Sarah Wooders
70c57c5072 fix: various patches to summarizer (#6597) 2025-12-15 12:02:34 -08:00
Charles Packer
1c30ad6991 fix(core): patch anthropic context caching busting (#6516)
Co-authored-by: Sarah Wooders <sarahwooders@gmail.com>
2025-12-15 12:02:34 -08:00
Sarah Wooders
bbd52e291c feat: refactor summarization and message persistence code [LET-6464] (#6561) 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
cthomas
109989ac1a fix: tracing for summarizer errors (#6524) 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
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
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
1939a9d185 feat: patch summarizer without changes to AgentState (#6450) 2025-12-15 12:02:19 -08:00
Charles Packer
88a3743cc8 fix(core): distinguish between null and 0 for prompt caching (#6451)
* fix(core): distinguish between null and 0 for prompt caching

* fix: runtime errors

* fix: just publish just sgate
2025-12-15 12:02:19 -08:00
Charles Packer
131891e05f feat: add tracking of advanced usage data (eg caching) [LET-6372] (#6449)
* feat: init refactor

* feat: add helper code

* fix: missing file + test

* fix: just state/publish api
2025-12-15 12:02:19 -08:00
cthomas
db534836e4 feat: allow follow up user message for approvals LET-6272 (#6392)
* feat: allow follow up user message for approvals

* add tests
2025-11-26 14:39:40 -08:00
cthomas
933dbb0830 fix: add fallback for sleeptime agent without group [LET-6255] (#6303)
fix: add fallback for sleeptime agent without group
2025-11-24 19:10:26 -08:00
cthomas
4bb116f17c fix: sync api call in message path (#6291)
* fix: sync api call in message path

* remove unused function

* add new error type
2025-11-24 19:10:26 -08:00
jnjpng
32e4caf0d2 fix: stream return sending full message after yielding chunks (#6295)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:10:26 -08:00
cthomas
6fe0971bfa fix: unexpected kwarg llm config error (#6289) 2025-11-24 19:10:26 -08:00
cthomas
1be2f61f05 feat: add new letta error message stream response type (#6192) 2025-11-24 19:10:11 -08:00
cthomas
1d71468ab2 feat: don't yield tool return message back in hitl [LET-6012] (#6219)
feat: don't yield tool return message back in hitl
2025-11-24 19:10:11 -08:00
jnjpng
52c9abf39b fix: v1 agent message content for anthropic and usage stats tracking [LET-6199] (#6249)
base

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:09:33 -08:00
jnjpng
9ffbfa6d67 feat: base letta v1 agent on temporal (#6208)
* base

* another

* parallel

* update

* rename

* naming

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:09:33 -08:00
cthomas
41392cdb8a test: make hitl testing pass (#6188) 2025-11-24 19:09:32 -08:00
cthomas
284201f6f8 feat: use new agent loop when messaging sleeptime directly (#6107) 2025-11-13 15:36:56 -08:00
Charles Packer
2e721ddc62 fix: various hardening to prevent stale state on background mode runs (#6072)
fix: various hardening to prevent stale state on backgroun
d mode runs
2025-11-13 15:36:56 -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
Sarah Wooders
5b9cac08b6 fix: populate stop_reason [LET-6040] (#5955)
fix: populate stop_reason
2025-11-13 15:36:55 -08:00
Charles Packer
52ff51755c fix: move persistence on message_ids to prevent desync [LET-6011] (#5908)
fix: move persistence on message_ids to prevent desync
2025-11-13 15:36:39 -08:00
Charles Packer
468b47bef5 fix(core): patch sse streaming errors (#5906)
* fix: patch sse streaming errors

* fix: don't re-raise, but log explicitly with sentry

* chore: cleanup comments

* fix: revert change from #5907, also make sure to write out a [DONE] to close the stream
2025-11-13 15:36:39 -08:00
Sarah Wooders
ac599145bb fix: various fixes for runs (#5907)
* 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

* passing tests

* fix: minor patches

* undo

---------

Co-authored-by: cpacker <packercharles@gmail.com>
Co-authored-by: Letta <noreply@letta.com>
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
Charles Packer
a44c05040a fix(core): big context overflow handling patch (#5901) 2025-11-13 15:36:39 -08:00