Commit graph

39278 commits

Author SHA1 Message Date
Ishaan Jaffer
7864d5d7d9
test(managed_agents): guard rail — proxy must not import claude_agent_sdk
Phase 2 architecture (LIT-2879): the agent runtime runs on the
per-Session VM, not in the proxy. Add a pytest that scans
litellm/proxy/ and fails if any source file imports claude_agent_sdk.

Currently passes (zero offenders). The test enforces that the boundary
stays intact going forward.

Tracks LIT-2879.
2026-05-06 19:31:44 -07:00
Ishaan Jaffer
81bdefab12
refactor(tests/test_sweepers): update vm_providers import path
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
f554d17e42
refactor(tests/conftest): update vm_providers import path
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
4033702a53
docs(sandbox/ec2_ssm): update docstring path refs to managed_agents/vms
Note: sandbox/ goes away in iteration 2 (LIT-2879 rule 5 — one concept:
VM). Until then, keep docstrings accurate.

Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
379b2c8c9a
docs(config): update vm_providers path ref in example yaml
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
b773919327
refactor(sweepers): update vm_providers import path
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
ae6d3780ff
refactor(session_endpoints): update vm_providers + warm_pool import paths
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
fa62360478
refactor(proxy_server): update import path for warm_pool manager
Tracks LIT-2879.
2026-05-06 19:30:44 -07:00
Ishaan Jaffer
a884e34446
refactor(tests): mirror warm_pool move — test_warm_pool_real.py
Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
781f8ef2a9
refactor(tests): mirror warm_pool move — test_manager.py
Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
4618cba00e
refactor(tests): mirror warm_pool move — test_hydrate.py
Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
e5fd4855fe
refactor(tests): mirror warm_pool move — test_attach.py
Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
e5a6c90ad2
refactor(tests): mirror warm_pool move — __init__.py
Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
a7e4eb0756
refactor(tests): mirror vm_providers move — test_team_config.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
36dacaee30
refactor(tests): mirror vm_providers move — test_noop.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:11 -07:00
Ishaan Jaffer
ccdc9cfd5e
refactor(tests): mirror vm_providers move — test_factory.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:10 -07:00
Ishaan Jaffer
488e590edf
refactor(tests): mirror vm_providers move — test_ec2_provider_real.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:10 -07:00
Ishaan Jaffer
8bf14f6c04
refactor(tests): mirror vm_providers move — test_ec2_provider.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:10 -07:00
Ishaan Jaffer
e5e08497d9
refactor(tests): mirror vm_providers move — __init__.py
Tests follow 1:1 mapping convention from tests/test_litellm/readme.md:
litellm/foo/bar.py → tests/test_litellm/foo/test_bar.py.

Tracks LIT-2879.
2026-05-06 19:30:10 -07:00
Ishaan Jaffer
da531564f6
refactor(managed_agents/vms/warm_pool): move warm_pool/transports/ssm.py out of proxy
Tracks LIT-2879.
2026-05-06 19:30:02 -07:00
Ishaan Jaffer
7d5e0fd26a
refactor(managed_agents/vms/warm_pool): move warm_pool/transports/__init__.py out of proxy
Tracks LIT-2879.
2026-05-06 19:30:02 -07:00
Ishaan Jaffer
ef0dc52f7c
refactor(managed_agents/vms/warm_pool): move warm_pool/types.py out of proxy
Phase 2: warm pool is part of VM management — moves to
litellm/managed_agents/vms/warm_pool/ alongside the providers.

Tracks LIT-2879.
2026-05-06 19:30:02 -07:00
Ishaan Jaffer
32cfd1b00c
refactor(managed_agents/vms/warm_pool): move warm_pool/manager.py out of proxy
Phase 2: warm pool is part of VM management — moves to
litellm/managed_agents/vms/warm_pool/ alongside the providers.

Tracks LIT-2879.
2026-05-06 19:30:02 -07:00
Ishaan Jaffer
b265c750c7
refactor(managed_agents/vms/warm_pool): move warm_pool/hydrate.py out of proxy
Phase 2: warm pool is part of VM management — moves to
litellm/managed_agents/vms/warm_pool/ alongside the providers.

Tracks LIT-2879.
2026-05-06 19:30:01 -07:00
Ishaan Jaffer
c192f54146
refactor(managed_agents/vms/warm_pool): move warm_pool/attach.py out of proxy
Phase 2: warm pool is part of VM management — moves to
litellm/managed_agents/vms/warm_pool/ alongside the providers.

Tracks LIT-2879.
2026-05-06 19:30:01 -07:00
Ishaan Jaffer
9c82e97397
refactor(managed_agents/vms/warm_pool): move warm_pool/__init__.py out of proxy
Phase 2: warm pool is part of VM management — moves to
litellm/managed_agents/vms/warm_pool/ alongside the providers.

Tracks LIT-2879.
2026-05-06 19:30:01 -07:00
Ishaan Jaffer
7f289b6738
refactor(managed_agents/vms): move vm_providers/team_config.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
5bdd95f400
refactor(managed_agents/vms): move vm_providers/registry.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
2c67c7f470
refactor(managed_agents/vms): move vm_providers/noop.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
1e13579a05
refactor(managed_agents/vms): move vm_providers/factory.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
e319398a82
refactor(managed_agents/vms): move vm_providers/ec2.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
31ceef8517
refactor(managed_agents/vms): move vm_providers/base.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
9c7eec479f
refactor(managed_agents/vms): move vm_providers/__init__.py out of proxy
Phase 2 architecture rule: VM management code lives in
litellm/managed_agents/vms/, not litellm/proxy/. The proxy is control
plane only.

Tracks LIT-2879.
2026-05-06 19:29:53 -07:00
Ishaan Jaffer
f070f4ff12
merge: wire managed_agents into POST /v2/sessions/{sid}/runs (PR #27356) 2026-05-06 18:13:44 -07:00
Ishaan Jaffer
60af728673
test(proxy): disable managed_agents driver in agent_session_endpoints conftest 2026-05-06 18:10:25 -07:00
Ishaan Jaffer
78c69ce273
feat(proxy): drive runs via litellm.managed_agents async task 2026-05-06 18:10:18 -07:00
Ishaan Jaffer
58840a1389
feat(proxy): add managed_agents_runner to drive queued runs in-process 2026-05-06 18:10:11 -07:00
Ishaan Jaffer
fe89237b03
merge: pick up final managed_agents tests + conftest FK adapter 2026-05-06 18:05:51 -07:00
Ishaan Jaffer
47415550ee
feat(managed_agents): expose AgentRuntime + ClaudeSDK + LiteLLM runtimes from agent_runtime package
The package __init__ now re-exports AgentRuntime/AgentConfig/SessionState
plus both runtime implementations (ClaudeSDKAgentRuntime and the new
LiteLLMAgentRuntime) so callers can do
'from litellm.managed_agents.agent_runtime import LiteLLMAgentRuntime'
without poking into submodules.

Required for the package-level __init__.py re-exports to resolve.
2026-05-06 18:04:35 -07:00
Ishaan Jaffer
5133953121
test(managed_agents): unwrap Prisma relation syntax in fake DB so create payloads land on FK columns
Real Prisma translates {agent: {connect: {id: X}}} into the underlying
agent_id FK column at write time. The in-memory FakePrismaClient we
share with the proxy tests stores the dict verbatim, so the agent_id
column was None on every row our managed_agents code wrote. Tests
asserting session.agent_id == 'agent_1' (and the same for session_id /
run_id) all failed at the same boundary.

Fix: wrap each table's create() in a small adapter that unwraps the
relation-syntax keys into bare FK columns before delegating. Local to
this test conftest so the change does not leak into the proxy tests
that re-use the same fake.
2026-05-06 18:04:07 -07:00
Ishaan Jaffer
c0ecb0d9ad
merge: integrate litellm/managed_agents/ (Epic C pivot — Python module wrapping claude-agent-sdk) 2026-05-06 18:03:16 -07:00
Ishaan Jaffer
6cb0475972
test(managed_agents): test_subclass_override.py from swarm 2026-05-06 18:02:42 -07:00
Ishaan Jaffer
2ecd15ac05
test(managed_agents): test_sandbox_local.py from swarm 2026-05-06 18:02:41 -07:00
Ishaan Jaffer
b4f3c5d2c9
test(managed_agents): test_session.py from swarm 2026-05-06 18:02:41 -07:00
Ishaan Jaffer
430d17e67d
test(managed_agents): test_agent.py from swarm 2026-05-06 18:02:41 -07:00
Ishaan Jaffer
5f85c4e83d
test(managed_agents): conftest.py from swarm 2026-05-06 18:02:41 -07:00
Ishaan Jaffer
229dbb19f0
test(managed_agents): mocked LiteLLMAgentRuntime tool loop 2026-05-06 18:02:07 -07:00
Ishaan Jaffer
d5cc949f47
test(managed_agents): real-Anthropic e2e for ClaudeSDKAgentRuntime + LocalSandbox 2026-05-06 18:01:47 -07:00
Ishaan Jaffer
6a0214a97b
feat(managed_agents): expose Agent/Session/Run/runtimes/sandboxes from package root
The package __init__ now re-exports the public surface so SDK callers
can do a single 'from litellm.managed_agents import Agent, Session, ...'
instead of digging into submodules.

Also pins what's public — anything not in __all__ is implementation
detail and may move.
2026-05-06 17:59:03 -07:00
Ishaan Jaffer
af0f76368e
feat(managed_agents): add Session class with send() that drives runs end-to-end
Session is the unit of work in the managed-agents API. send(prompt)
mirrors what the HTTP create_run + event_stream pair does on the proxy:

  1. INSERT LiteLLM_AgentRun (status=queued, prompt={text}).
  2. Flip session status ready -> busy and run status queued -> running.
  3. async for event in self.runtime.run(...) — persist each event to
     LiteLLM_AgentRunEvent and yield it back to the consumer.
  4. On exit (clean or error), set the run terminal status and restore
     session to ready in a finally block so a single failed send never
     locks the session forever.

Also adds get_run/list_runs/conversation read helpers — same wire shape
the corresponding HTTP endpoints serve.
2026-05-06 17:58:30 -07:00