Commit Graph

103 Commits

Author SHA1 Message Date
Kian Jones
a92e868ee6 feat: centralize telemetry logging at LLM client level (#8815)
* feat: centralize telemetry logging at LLM client level

Moves telemetry logging from individual adapters to LLMClientBase:
- Add TelemetryStreamWrapper for streaming telemetry on stream close
- Add request_async_with_telemetry() for non-streaming requests
- Add stream_async_with_telemetry() for streaming requests
- Add set_telemetry_context() to configure agent_id, run_id, step_id

Updates adapters and agents to use new pattern:
- LettaLLMAdapter now accepts agent_id/run_id in constructor
- Adapters call set_telemetry_context() before LLM requests
- Removes duplicate telemetry logging from adapters
- Enriches traces with agent_id, run_id, call_type metadata

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

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

* fix: accumulate streaming response content for telemetry

TelemetryStreamWrapper now extracts actual response data from chunks:
- Content text (concatenated from deltas)
- Tool calls (id, name, arguments)
- Model name, finish reason, usage stats

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

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

* refactor: move streaming telemetry to caller (option 3)

- Remove TelemetryStreamWrapper class
- Add log_provider_trace_async() helper to LLMClientBase
- stream_async_with_telemetry() now just returns raw stream
- Callers log telemetry after processing with rich interface data

Updated callers:
- summarizer.py: logs content + usage after stream processing
- letta_agent.py: logs tool_call, reasoning, model, usage

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

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

* fix: pass agent_id and run_id to parent adapter class

LettaLLMStreamAdapter was not passing agent_id/run_id to parent,
causing "unexpected keyword argument" errors.

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

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

---------

Co-authored-by: Letta <noreply@letta.com>
2026-01-19 15:54:43 -08:00
jnjpng
979062114c chore: fix typo and improve MCP OAuth comments (#8629)
- Fix typo "upate" -> "update" in TODO comments (mcp_manager.py, mcp_server_manager.py)
- Improve comments in OAuth callback handler to explain why MCPOAuthSession
  is used directly (callback is unauthenticated, manager requires actor)
- Clean up variable naming in callback handler

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

Co-authored-by: Letta <noreply@letta.com>
2026-01-19 15:54:38 -08:00
jnjpng
c550457b60 feat: static redirect callback for mcp server oauth (#8611)
* base

* base

* more

* final

* remove

* pass
2026-01-19 15:54:38 -08:00
jnjpng
87e939deda feat: add fastmcp v2 client (#8457)
* base

* testing code

* update

* nit
2026-01-12 10:57:49 -08:00
jnjpng
25d75d6528 fix: update aysnc get plaintext callsites (#7069)
* base

* resolve

* fix

* fix
2025-12-17 17:31:02 -08:00
cthomas
9bc872a350 fix: add gen tool error handling (#7209) 2025-12-17 17:31:02 -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
91e3dd8b3e feat: fix new summarizer code and add more tests (#6461) 2025-12-15 12:02:19 -08:00
Sarah Wooders
0fc86c4968 feat: run tool by for a given agent [LET-6320] (#6386) 2025-11-26 14:39:40 -08:00
Ari Webb
3e02f12dfd feat: add tool embedding and search [LET-6333] (#6398)
* feat: add tool embedding and search

* fix ci

* add env variable for embedding tools

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-26 14:39:40 -08:00
jnjpng
ccafb25268 feat: launch darkly modal flag (#6345)
* base

* update

* update

* update

* generate

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-24 19:10:27 -08:00
cthomas
345ea42630 feat: offload all file i/o in server endpoints LET-6252 (#6300)
feat: offload all file i/o in server endpoints
2025-11-24 19:10:26 -08:00
Sarah Wooders
5730f69ecf feat: modal tool execution - NO FEATURE FLAGS USES MODAL [LET-4357] (#5120)
* initial commit

* add delay to deploy

* fix tests

* add tests

* passing tests

* cleanup

* and use modal

* working on modal

* gate on tool metadata

* agent state

* cleanup

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-11-13 15:36:56 -08:00
Sarah Wooders
982501f6fa feat: create model table to persist available models (#5835)
---------

Co-authored-by: Ari Webb <arijwebb@gmail.com>
Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:56 -08:00
Ari Webb
da11d80bf4 fix: add default model gpt4.1 (#5897)
add default model gpt4.1

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:36:39 -08:00
Ari Webb
5947e209c7 feat: generate json schema in generate-tool [LET-5901] (#5769)
* generate json schema

* delete commented try catch

---------

Co-authored-by: Ari Webb <ari@letta.com>
2025-11-13 15:35:34 -08:00
jnjpng
e3f794dac5 fix: handle async context task cleanup for mcp client [LET-5746] (#5619)
* base

* update

* update

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:13:15 -07:00
Kian Jones
bbaaabb6e1 fix: path validator had weird fastapi shared object memory bug (#5594)
* fix weird path param conflict

* move to factory model

* openapi

* use type hinting and import annotations

* re add after mc resolution
2025-10-24 15:13:15 -07:00
Kian Jones
448ba33c70 fix: source id from pydantic base class rather than expected string id (#5554)
* first pass

* hacky fix bc of path import
2025-10-24 15:12:26 -07:00
Kian Jones
f04bc0753c feat: add path parameter validation for tool_id (#5525)
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
2025-10-24 15:12:11 -07:00
jnjpng
5d153214c0 feat: allow invalid schema tools to be attached with warning (#5341)
* base

* allow attach

* display badge

* clean up

---------

Co-authored-by: Letta Bot <noreply@letta.com>
2025-10-24 15:11:31 -07:00
Sarah Wooders
324933edd3 feat: exception handling middleware for sandbox_configs + identities + tools (#5143) 2025-10-07 17:50:50 -07:00
Sarah Wooders
e07a589796 chore: rm composio (#5151) 2025-10-07 17:50:49 -07:00
Sarah Wooders
d0d36a4b07 fix: remove json schema generation from tool validation [LET-4509] (#4964)
* patch integration test

* create default user and org

* rm

* patch

* add testing

* remove validation for schemas from pydantic object

* add file

* patch tests

* fix more tests

* fix managers

* fix sdk test

* patch schema tests

* Comment out name in update

* patch test

* patch

* add another test
2025-10-07 17:50:46 -07:00
Matthew Zhou
c27e69ce6c fix: Fix mcp tests [LET-4496] (#4927)
Fix mcp tests
2025-10-07 17:50:46 -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
Shubham Naik
98e8fcdee6 feat: allow list tools by tool type [PRO-870] (#4036)
* feat: allow list tools by tool type

* chore: update list

* chore: respond to comments

* chore: refactor tools hella

* Add tests to managers

* chore: branch

---------

Co-authored-by: Shubham Naik <shub@memgpt.ai>
Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-09-02 15:53:36 -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
Sarah Wooders
58be205098 chore: patch update tools (#4090)
* patch update tools

* update tool patch

* fallback to generation for legacy tools

* avoid re-parsing source if json schema exists

* fix more tests

* remove asssert

* fix

* update

* update

* update

* Fix tests

---------

Co-authored-by: Matt Zhou <mattzh1314@gmail.com>
2025-08-28 11:34:36 -07:00
Charles Packer
eb00e49a37 fix: patch support for custom headers + auth in MCP connects (was getting a weird silent error)
Co-authored-by: jnjpng <jin@letta.com>
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-08-21 13:42:19 -07:00
cthomas
c307b41086 feat: add tools generation response to error logs (#3984) 2025-08-18 14:21:45 -07:00
Charles Packer
773a6452d1 fix: handle faulty schemas from bad mcp servers better
Co-authored-by: jnjpng <jin@letta.com>
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-08-15 16:08:52 -07:00
Andy Li
1ff2434598 feat: typescript deps in ade 2025-08-15 15:49:57 -07:00
jnjpng
711c22ec0e feat: add mcp tool simulator
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-08-14 16:31:43 -07:00
jnjpng
93e41bbf0a fix: delete associated mcp oauth sessions on delete and link existing mcp oauth sessions on create
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-08-12 15:32:33 -07:00
Matthew Zhou
37fdecb433 feat: Improve tool renaming based on json schema (#3676) 2025-07-31 12:57:22 -07:00
jnjpng
25c83dcf2e fix: handling 401 unauthorized for streamable http oauth
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-31 12:28:51 -07:00
jnjpng
f20b3262ef fix: update deployment env variables for core for oauth routing
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-30 13:19:48 -07:00
jnjpng
24c9c0524b fix: oauth prod environment variables
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-30 11:02:21 -07:00
jnjpng
bd87f62b89 feat: redirect ouath callback through web for cloud
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-29 17:36:30 -07:00
cthomas
c48945a54c feat: tool generation improvements (#3633) 2025-07-29 15:35:08 -07:00
jnjpng
6e0fbe2bd0 fix: update mcp documentation
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-29 14:24:48 -07:00
cthomas
dd96fa4a34 feat: pass in generated pip requirement to tool update (#3614) 2025-07-29 09:20:01 -07:00
cthomas
b9b3be077a feat: ai tool helper system prompt (#3613) 2025-07-29 09:19:50 -07:00
jnjpng
04511d1ffc feat: allow mcp authentication overrides per agent (#3318)
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-28 18:20:58 -07:00
jnjpng
13f8785181 fix: stdio form regression with streamable oauth
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-25 15:19:16 -07:00
Andy Li
1959109821 feat: support for project_id and backfills 2025-07-25 13:06:12 -07:00
jnjpng
4fb8902084 feat: add support for oauth mcp
Co-authored-by: Jin Peng <jinjpeng@Jins-MacBook-Pro.local>
2025-07-24 18:23:01 -07:00