Skip to content
Merged
Show file tree
Hide file tree
Changes from 55 commits
Commits
Show all changes
229 commits
Select commit Hold shift + click to select a range
a0cda02
feat(harness): add litellm/__init__.py
ishaanj-berri Sep 30, 2026
ee63d1a
feat(harness): add litellm/constants.py
ishaanj-berri Sep 30, 2026
a05002b
feat(harness): add litellm/harness/__init__.py
ishaanj-berri Sep 30, 2026
75472e2
feat(harness): add litellm/harness/adapters/__init__.py
ishaanj-berri Sep 30, 2026
a2da943
feat(harness): add litellm/harness/adapters/base.py
ishaanj-berri Sep 30, 2026
73751c3
feat(harness): add litellm/harness/adapters/claude_code.py
ishaanj-berri Sep 30, 2026
e73a85b
feat(harness): add litellm/harness/adapters/codex.py
ishaanj-berri Sep 30, 2026
0735ccc
feat(harness): add litellm/harness/adapters/opencode.py
ishaanj-berri Sep 30, 2026
1109208
feat(harness): add litellm/harness/endpoint.py
ishaanj-berri Sep 30, 2026
88caf51
feat(harness): add litellm/harness/errors.py
ishaanj-berri Sep 30, 2026
38bb7b7
feat(harness): add litellm/harness/options.py
ishaanj-berri Sep 30, 2026
cb3bd96
feat(harness): add litellm/harness/runtime.py
ishaanj-berri Sep 30, 2026
7665107
feat(harness): add litellm/harness/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
aa78637
feat(harness): add litellm/harness/sandbox/base.py
ishaanj-berri Sep 30, 2026
e5220ce
feat(harness): add litellm/harness/sandbox/docker.py
ishaanj-berri Sep 30, 2026
2c5b66c
feat(harness): add litellm/harness/sandbox/local.py
ishaanj-berri Sep 30, 2026
486d697
feat(harness): add litellm/harness/sandbox/snapshot.py
ishaanj-berri Sep 30, 2026
390149e
feat(harness): add litellm/harness/sync.py
ishaanj-berri Sep 30, 2026
916ad65
feat(harness): add litellm/harness/types.py
ishaanj-berri Sep 30, 2026
ab7acd9
feat(harness): add litellm/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
0ef2dc3
feat(harness): add README.md
ishaanj-berri Sep 30, 2026
efce9e0
feat(harness): add tests/harness_e2e/__init__.py
ishaanj-berri Sep 30, 2026
e92bf5a
feat(harness): add tests/harness_e2e/conftest.py
ishaanj-berri Sep 30, 2026
c20301f
feat(harness): add tests/harness_e2e/test_harness_e2e.py
ishaanj-berri Sep 30, 2026
2f481d4
feat(harness): add tests/test_litellm/harness/__init__.py
ishaanj-berri Sep 30, 2026
4134f94
feat(harness): add tests/test_litellm/harness/adapters/__init__.py
ishaanj-berri Sep 30, 2026
1a26923
feat(harness): add tests/test_litellm/harness/adapters/fixtures/claud…
ishaanj-berri Sep 30, 2026
b8982b9
feat(harness): add tests/test_litellm/harness/adapters/fixtures/claud…
ishaanj-berri Sep 30, 2026
a0d7bd7
feat(harness): add tests/test_litellm/harness/adapters/fixtures/claud…
ishaanj-berri Sep 30, 2026
7292057
feat(harness): add tests/test_litellm/harness/adapters/fixtures/claud…
ishaanj-berri Sep 30, 2026
95d8165
feat(harness): add tests/test_litellm/harness/adapters/fixtures/claud…
ishaanj-berri Sep 30, 2026
6d8f459
feat(harness): add tests/test_litellm/harness/adapters/fixtures/codex…
ishaanj-berri Sep 30, 2026
fe3443b
feat(harness): add tests/test_litellm/harness/adapters/fixtures/codex…
ishaanj-berri Sep 30, 2026
c9edf7d
feat(harness): add tests/test_litellm/harness/adapters/fixtures/codex…
ishaanj-berri Sep 30, 2026
a2f36f3
feat(harness): add tests/test_litellm/harness/adapters/fixtures/codex…
ishaanj-berri Sep 30, 2026
f120ba5
feat(harness): add tests/test_litellm/harness/adapters/fixtures/codex…
ishaanj-berri Sep 30, 2026
24414da
feat(harness): add tests/test_litellm/harness/adapters/fixtures/openc…
ishaanj-berri Sep 30, 2026
42903ad
feat(harness): add tests/test_litellm/harness/adapters/fixtures/openc…
ishaanj-berri Sep 30, 2026
f01ccb5
feat(harness): add tests/test_litellm/harness/adapters/fixtures/openc…
ishaanj-berri Sep 30, 2026
9669303
feat(harness): add tests/test_litellm/harness/adapters/fixtures/openc…
ishaanj-berri Sep 30, 2026
52c585d
feat(harness): add tests/test_litellm/harness/adapters/fixtures/openc…
ishaanj-berri Sep 30, 2026
793a78d
feat(harness): add tests/test_litellm/harness/adapters/test_claude_co…
ishaanj-berri Sep 30, 2026
8f8525d
feat(harness): add tests/test_litellm/harness/adapters/test_codex.py
ishaanj-berri Sep 30, 2026
5bf34e1
feat(harness): add tests/test_litellm/harness/adapters/test_opencode.py
ishaanj-berri Sep 30, 2026
b5e4697
feat(harness): add tests/test_litellm/harness/core_fakes.py
ishaanj-berri Sep 30, 2026
678483a
feat(harness): add tests/test_litellm/harness/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
a81dfeb
feat(harness): add tests/test_litellm/harness/sandbox/test_docker.py
ishaanj-berri Sep 30, 2026
bef7583
feat(harness): add tests/test_litellm/harness/sandbox/test_local.py
ishaanj-berri Sep 30, 2026
9d01dab
feat(harness): add tests/test_litellm/harness/sandbox/test_snapshot.py
ishaanj-berri Sep 30, 2026
387c61b
feat(harness): add tests/test_litellm/harness/test_endpoint.py
ishaanj-berri Sep 30, 2026
ba8f174
feat(harness): add tests/test_litellm/harness/test_init.py
ishaanj-berri Sep 30, 2026
8f831d5
feat(harness): add tests/test_litellm/harness/test_runtime.py
ishaanj-berri Sep 30, 2026
ebd0745
feat(harness): add tests/test_litellm/harness/test_sync.py
ishaanj-berri Sep 30, 2026
5fba073
feat(harness): add tests/test_litellm/harness/test_types.py
ishaanj-berri Sep 30, 2026
4f8c85c
test(harness): use word recall in stream e2e test
ishaanj-berri Sep 30, 2026
431a94f
refactor(harness): update litellm/__init__.py
ishaanj-berri Sep 30, 2026
f1b6223
refactor(harness): update litellm/constants.py
ishaanj-berri Sep 30, 2026
cfb1ab1
refactor(harness): update litellm/harness/__init__.py
ishaanj-berri Sep 30, 2026
2fa7d8a
refactor(harness): remove litellm/harness/adapters/__init__.py
ishaanj-berri Sep 30, 2026
38489cd
refactor(harness): update litellm/harness/context.py
ishaanj-berri Sep 30, 2026
744089c
refactor(harness): update litellm/harness/endpoint.py
ishaanj-berri Sep 30, 2026
f100b32
refactor(harness): update litellm/harness/handlers/__init__.py
ishaanj-berri Sep 30, 2026
24129cd
refactor(harness): update litellm/harness/handlers/base.py
ishaanj-berri Sep 30, 2026
e8256f1
refactor(harness): update litellm/harness/handlers/cli_handler.py
ishaanj-berri Sep 30, 2026
f6f766d
refactor(harness): update litellm/harness/handlers/deepagents_handler.py
ishaanj-berri Sep 30, 2026
5de0892
refactor(harness): update litellm/harness/runtime.py
ishaanj-berri Sep 30, 2026
3d8e54e
refactor(harness): update litellm/harness/sandbox/docker.py
ishaanj-berri Sep 30, 2026
0b28f33
refactor(harness): update litellm/harness/sandbox/local.py
ishaanj-berri Sep 30, 2026
441a733
refactor(harness): update litellm/harness/sync.py
ishaanj-berri Sep 30, 2026
84d7514
refactor(harness): update litellm/harness/types.py
ishaanj-berri Sep 30, 2026
07a4ce2
refactor(harness): update litellm/llms/base_llm/harness/__init__.py
ishaanj-berri Sep 30, 2026
328ef3c
refactor(harness): update litellm/llms/base_llm/harness/transformatio…
ishaanj-berri Sep 30, 2026
6b0decd
refactor(harness): update litellm/llms/base_llm/harness/utils.py
ishaanj-berri Sep 30, 2026
a846fcd
refactor(harness): update litellm/llms/claude_code/__init__.py
ishaanj-berri Sep 30, 2026
5b7bb14
refactor(harness): update litellm/llms/claude_code/harness/__init__.py
ishaanj-berri Sep 30, 2026
c5df8b7
refactor(harness): update litellm/llms/claude_code/harness/transforma…
ishaanj-berri Sep 30, 2026
fdb569c
refactor(harness): update litellm/llms/codex/__init__.py
ishaanj-berri Sep 30, 2026
aaa1fdb
refactor(harness): update litellm/llms/codex/harness/__init__.py
ishaanj-berri Sep 30, 2026
21f7fed
refactor(harness): update litellm/llms/codex/harness/transformation.py
ishaanj-berri Sep 30, 2026
7e4a7b9
refactor(harness): update litellm/llms/deepagents/__init__.py
ishaanj-berri Sep 30, 2026
7b46751
refactor(harness): update litellm/llms/deepagents/harness/__init__.py
ishaanj-berri Sep 30, 2026
40fd53e
refactor(harness): update litellm/llms/deepagents/harness/sandbox_bac…
ishaanj-berri Sep 30, 2026
48f402f
refactor(harness): update litellm/llms/deepagents/harness/transformat…
ishaanj-berri Sep 30, 2026
8bcbfaa
refactor(harness): update litellm/llms/opencode/__init__.py
ishaanj-berri Sep 30, 2026
dc2a414
refactor(harness): update litellm/llms/opencode/harness/__init__.py
ishaanj-berri Sep 30, 2026
fcb1b3d
refactor(harness): update litellm/llms/opencode/harness/transformatio…
ishaanj-berri Sep 30, 2026
366cca4
refactor(harness): update litellm/utils.py
ishaanj-berri Sep 30, 2026
b232fb7
refactor(harness): update README.md
ishaanj-berri Sep 30, 2026
20acd1f
refactor(harness): update tests/harness_e2e/conftest.py
ishaanj-berri Sep 30, 2026
f92637e
refactor(harness): update tests/harness_e2e/test_harness_e2e.py
ishaanj-berri Sep 30, 2026
d1b6e8e
refactor(harness): remove tests/test_litellm/harness/__init__.py
ishaanj-berri Sep 30, 2026
1f6c15b
refactor(harness): remove tests/test_litellm/harness/adapters/__init_…
ishaanj-berri Sep 30, 2026
f1287fb
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
5042078
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
a4cf652
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
6945390
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
d06240d
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
5c1fb65
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
7af7823
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
e17cc12
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
34194fb
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
2555f43
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
826024f
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
69e7fee
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
f066343
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
b0d493e
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
a7b49b7
refactor(harness): remove tests/test_litellm/harness/adapters/fixture…
ishaanj-berri Sep 30, 2026
a33e60b
refactor(harness): remove tests/test_litellm/harness/adapters/test_cl…
ishaanj-berri Sep 30, 2026
908655a
refactor(harness): remove tests/test_litellm/harness/adapters/test_co…
ishaanj-berri Sep 30, 2026
adeaa82
refactor(harness): remove tests/test_litellm/harness/adapters/test_op…
ishaanj-berri Sep 30, 2026
58ca45a
refactor(harness): remove tests/test_litellm/harness/core_fakes.py
ishaanj-berri Sep 30, 2026
0eb4537
refactor(harness): remove tests/test_litellm/harness/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
1c5e0ea
refactor(harness): remove tests/test_litellm/harness/sandbox/test_doc…
ishaanj-berri Sep 30, 2026
8cbb81a
refactor(harness): remove tests/test_litellm/harness/sandbox/test_loc…
ishaanj-berri Sep 30, 2026
5a3c2db
refactor(harness): remove tests/test_litellm/harness/sandbox/test_sna…
ishaanj-berri Sep 30, 2026
2780c33
refactor(harness): remove tests/test_litellm/harness/test_endpoint.py
ishaanj-berri Sep 30, 2026
c94f152
refactor(harness): remove tests/test_litellm/harness/test_init.py
ishaanj-berri Sep 30, 2026
d427ace
refactor(harness): remove tests/test_litellm/harness/test_runtime.py
ishaanj-berri Sep 30, 2026
900075f
refactor(harness): remove tests/test_litellm/harness/test_sync.py
ishaanj-berri Sep 30, 2026
28d8d9b
refactor(harness): remove tests/test_litellm/harness/test_types.py
ishaanj-berri Sep 30, 2026
7f8e1e9
refactor(harness): update tests/unit/harness/__init__.py
ishaanj-berri Sep 30, 2026
b8b5b27
refactor(harness): update tests/unit/harness/core_fakes.py
ishaanj-berri Sep 30, 2026
819c6b5
refactor(harness): update tests/unit/harness/handlers/__init__.py
ishaanj-berri Sep 30, 2026
b3108ea
refactor(harness): update tests/unit/harness/handlers/test_deepagents…
ishaanj-berri Sep 30, 2026
6bb064e
refactor(harness): update tests/unit/harness/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
37c117d
refactor(harness): update tests/unit/harness/sandbox/test_docker.py
ishaanj-berri Sep 30, 2026
3df6db6
refactor(harness): update tests/unit/harness/sandbox/test_local.py
ishaanj-berri Sep 30, 2026
86b90a0
refactor(harness): update tests/unit/harness/sandbox/test_snapshot.py
ishaanj-berri Sep 30, 2026
3919054
refactor(harness): update tests/unit/harness/test_endpoint.py
ishaanj-berri Sep 30, 2026
805b802
refactor(harness): update tests/unit/harness/test_init.py
ishaanj-berri Sep 30, 2026
d337611
refactor(harness): update tests/unit/harness/test_runtime.py
ishaanj-berri Sep 30, 2026
cd5f678
refactor(harness): update tests/unit/harness/test_sync.py
ishaanj-berri Sep 30, 2026
a36ce85
refactor(harness): update tests/unit/harness/test_types.py
ishaanj-berri Sep 30, 2026
0a899e6
refactor(harness): update tests/unit/llms/claude_code/__init__.py
ishaanj-berri Sep 30, 2026
e658e58
refactor(harness): update tests/unit/llms/claude_code/harness/__init_…
ishaanj-berri Sep 30, 2026
a883af2
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Sep 30, 2026
23796a3
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Sep 30, 2026
52eb557
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Sep 30, 2026
b0799b5
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Sep 30, 2026
f53a62b
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Sep 30, 2026
1f3a259
refactor(harness): update tests/unit/llms/claude_code/harness/test_tr…
ishaanj-berri Sep 30, 2026
97ac84e
refactor(harness): update tests/unit/llms/codex/__init__.py
ishaanj-berri Sep 30, 2026
399624c
refactor(harness): update tests/unit/llms/codex/harness/__init__.py
ishaanj-berri Sep 30, 2026
fb84824
refactor(harness): update tests/unit/llms/codex/harness/fixtures/reas…
ishaanj-berri Sep 30, 2026
f3f192c
refactor(harness): update tests/unit/llms/codex/harness/fixtures/stru…
ishaanj-berri Sep 30, 2026
471ca92
refactor(harness): update tests/unit/llms/codex/harness/fixtures/turn…
ishaanj-berri Sep 30, 2026
dd5b9ee
refactor(harness): update tests/unit/llms/codex/harness/fixtures/turn…
ishaanj-berri Sep 30, 2026
29d7d8b
refactor(harness): update tests/unit/llms/codex/harness/fixtures/turn…
ishaanj-berri Sep 30, 2026
7aedfa0
refactor(harness): update tests/unit/llms/codex/harness/test_transfor…
ishaanj-berri Sep 30, 2026
31fca31
refactor(harness): update tests/unit/llms/deepagents/__init__.py
ishaanj-berri Sep 30, 2026
627af9d
refactor(harness): update tests/unit/llms/deepagents/harness/__init__.py
ishaanj-berri Sep 30, 2026
f80f0dd
refactor(harness): update tests/unit/llms/deepagents/harness/test_tra…
ishaanj-berri Sep 30, 2026
3cf237f
refactor(harness): update tests/unit/llms/opencode/__init__.py
ishaanj-berri Sep 30, 2026
da8aac7
refactor(harness): update tests/unit/llms/opencode/harness/__init__.py
ishaanj-berri Sep 30, 2026
b376b2b
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/a…
ishaanj-berri Sep 30, 2026
d4b3263
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/e…
ishaanj-berri Sep 30, 2026
7d78785
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/r…
ishaanj-berri Sep 30, 2026
dc4dc4a
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/t…
ishaanj-berri Sep 30, 2026
0765f84
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/t…
ishaanj-berri Sep 30, 2026
115ce53
refactor(harness): update tests/unit/llms/opencode/harness/test_trans…
ishaanj-berri Sep 30, 2026
01abe25
ci: allowlist tests/harness_e2e, which needs live runtimes and a gateway
ishaanj-berri Sep 30, 2026
ba0052f
fix(harness): bound the turn event queue
ishaanj-berri Sep 30, 2026
e11c437
fix(harness): bound the turn event queue with backpressure
ishaanj-berri Sep 30, 2026
946d520
style: sort imports in utils
ishaanj-berri Sep 30, 2026
f76c2ac
ci: exclude agent-harness config folders from provider docs check
ishaanj-berri Sep 30, 2026
3843b95
refactor(harness): update tests/harness_e2e/conftest.py
ishaanj-berri Sep 30, 2026
bc7a503
refactor(harness): update tests/harness_e2e/test_harness_e2e.py
ishaanj-berri Sep 30, 2026
3968afe
refactor(harness): update tests/unit/harness/core_fakes.py
ishaanj-berri Sep 30, 2026
7ebadcd
refactor(harness): update tests/unit/harness/handlers/test_deepagents…
ishaanj-berri Sep 30, 2026
dd18802
refactor(harness): update tests/unit/harness/test_runtime.py
ishaanj-berri Sep 30, 2026
1a55ed2
refactor(harness): update tests/unit/harness/test_sync.py
ishaanj-berri Sep 30, 2026
73c8fa6
refactor(harness): update tests/unit/llms/deepagents/harness/test_tra…
ishaanj-berri Sep 30, 2026
a0bb354
refactor(harness): update tests/unit/llms/opencode/harness/test_trans…
ishaanj-berri Sep 30, 2026
5737d10
refactor(harness): update litellm/harness/endpoint.py
ishaanj-berri Sep 30, 2026
f8c725b
refactor(harness): update litellm/harness/handlers/deepagents_handler.py
ishaanj-berri Sep 30, 2026
b5f0049
refactor(harness): update litellm/harness/options.py
ishaanj-berri Sep 30, 2026
bfb261a
refactor(harness): update litellm/harness/runtime.py
ishaanj-berri Sep 30, 2026
a3edb9d
refactor(harness): update litellm/harness/sandbox/snapshot.py
ishaanj-berri Sep 30, 2026
41c37af
refactor(harness): update litellm/llms/base_llm/harness/transformatio…
ishaanj-berri Sep 30, 2026
ed6aeff
refactor(harness): update litellm/llms/base_llm/harness/utils.py
ishaanj-berri Sep 30, 2026
49a43d7
refactor(harness): update litellm/llms/claude_code/harness/transforma…
ishaanj-berri Sep 30, 2026
e3251f5
refactor(harness): update litellm/llms/codex/harness/transformation.py
ishaanj-berri Sep 30, 2026
bb40b65
refactor(harness): update litellm/llms/deepagents/harness/sandbox_bac…
ishaanj-berri Sep 30, 2026
1c1f22f
refactor(harness): update litellm/llms/deepagents/harness/transformat…
ishaanj-berri Sep 30, 2026
290a085
refactor(harness): update litellm/llms/opencode/harness/transformatio…
ishaanj-berri Sep 30, 2026
6f5a882
refactor(harness): update litellm/sandbox/__init__.py
ishaanj-berri Sep 30, 2026
59cc90a
refactor(harness): update tests/unit/llms/claude_code/harness/test_tr…
ishaanj-berri Sep 30, 2026
c2cf4ed
refactor(harness): update tests/unit/llms/deepagents/harness/test_san…
ishaanj-berri Sep 30, 2026
e331536
refactor(harness): update tests/unit/llms/opencode/harness/test_trans…
ishaanj-berri Sep 30, 2026
998c9eb
refactor(harness): update litellm/llms/base_llm/harness/utils.py
ishaanj-berri Oct 1, 2026
c3dad94
refactor(harness): update litellm/llms/codex/harness/transformation.py
ishaanj-berri Oct 1, 2026
318d616
refactor(harness): update tests/code_coverage_tests/recursive_detecto…
ishaanj-berri Oct 1, 2026
6626486
refactor(harness): update tests/unit/llms/base_llm/harness/__init__.py
ishaanj-berri Oct 1, 2026
0b71429
refactor(harness): update tests/unit/llms/claude_code/harness/fixture…
ishaanj-berri Oct 1, 2026
706fc50
refactor(harness): update tests/unit/llms/codex/harness/fixtures/__in…
ishaanj-berri Oct 1, 2026
bfcfe9a
refactor(harness): update tests/unit/llms/opencode/harness/fixtures/_…
ishaanj-berri Oct 1, 2026
175bc37
refactor(harness): update litellm/harness/__init__.py
ishaanj-berri Oct 1, 2026
0c497d4
refactor(harness): update litellm/harness/context.py
ishaanj-berri Oct 1, 2026
f64b07f
refactor(harness): update litellm/harness/endpoint.py
ishaanj-berri Oct 1, 2026
317d016
refactor(harness): update litellm/harness/handlers/__init__.py
ishaanj-berri Oct 1, 2026
c4cd299
refactor(harness): update litellm/harness/handlers/base.py
ishaanj-berri Oct 1, 2026
135dfb8
refactor(harness): update litellm/harness/handlers/cli_handler.py
ishaanj-berri Oct 1, 2026
1d0de0e
refactor(harness): update litellm/harness/handlers/deepagents_handler.py
ishaanj-berri Oct 1, 2026
3ad445a
refactor(harness): update litellm/harness/runtime.py
ishaanj-berri Oct 1, 2026
c49defe
refactor(harness): update litellm/harness/sandbox/__init__.py
ishaanj-berri Oct 1, 2026
7b975fb
refactor(harness): update litellm/harness/sandbox/base.py
ishaanj-berri Oct 1, 2026
01fe9ad
refactor(harness): update litellm/harness/sandbox/docker.py
ishaanj-berri Oct 1, 2026
37e0ed2
refactor(harness): update litellm/harness/sandbox/local.py
ishaanj-berri Oct 1, 2026
228aa46
refactor(harness): update litellm/harness/sandbox/snapshot.py
ishaanj-berri Oct 1, 2026
0969933
refactor(harness): update litellm/harness/sync.py
ishaanj-berri Oct 1, 2026
3df0faf
refactor(harness): update litellm/harness/types.py
ishaanj-berri Oct 1, 2026
2e0a096
refactor(harness): update litellm/llms/base_llm/harness/transformatio…
ishaanj-berri Oct 1, 2026
ee192dd
refactor(harness): update litellm/llms/base_llm/harness/utils.py
ishaanj-berri Oct 1, 2026
7c46422
refactor(harness): update litellm/llms/claude_code/harness/transforma…
ishaanj-berri Oct 1, 2026
59c6ccb
refactor(harness): update litellm/llms/codex/harness/transformation.py
ishaanj-berri Oct 1, 2026
7c04c82
refactor(harness): update litellm/llms/deepagents/harness/sandbox_bac…
ishaanj-berri Oct 1, 2026
f6b9329
refactor(harness): update litellm/llms/deepagents/harness/transformat…
ishaanj-berri Oct 1, 2026
d6c14f2
refactor(harness): update litellm/llms/opencode/harness/transformatio…
ishaanj-berri Oct 1, 2026
4b375da
refactor(harness): update litellm/types/llms/custom_http.py
ishaanj-berri Oct 1, 2026
8e8f811
refactor(harness): update tests/unit/harness/test_endpoint.py
ishaanj-berri Oct 1, 2026
72b01c3
refactor(harness): update litellm/harness/runtime.py
ishaanj-berri Oct 1, 2026
99ddf04
refactor(harness): update litellm/llms/deepagents/harness/sandbox_bac…
ishaanj-berri Oct 1, 2026
a07d1a7
refactor(harness): update tests/unit/harness/test_init.py
ishaanj-berri Oct 1, 2026
66942ac
refactor(harness): update tests/unit/harness/test_runtime.py
ishaanj-berri Oct 1, 2026
d31d713
refactor(harness): update tests/unit/llms/deepagents/harness/test_san…
ishaanj-berri Oct 1, 2026
2e7678e
ci: run tests/unit/harness in the misc unit shard
ishaanj-berri Oct 1, 2026
1f93613
refactor(harness): update litellm/harness/runtime.py
ishaanj-berri Oct 1, 2026
68367fb
refactor(harness): update litellm/harness/sync.py
ishaanj-berri Oct 1, 2026
80a4567
refactor(harness): update litellm/llms/deepagents/harness/sandbox_bac…
ishaanj-berri Oct 1, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,33 @@ For MCP OAuth, an upstream may advertise dynamic client registration but refuse

</details>

<details>
<summary><b>Agent Harnesses</b> - Run Claude Code, Codex, OpenCode or Deep Agents on any model (Python SDK)</summary>

### Python SDK - Agent Harnesses

```python
import litellm
from litellm import sandbox
from litellm.harness import Gateway, Harness

result = litellm.harness.run(
Harness.CLAUDE_CODE, # or Harness.CODEX, Harness.OPENCODE, Harness.DEEPAGENTS
"Find why tests/test_router.py is flaky and fix it.",
sandbox=sandbox.local("./repo"),
model="claude-sonnet-4-5",
gateway=Gateway(api_base="http://0.0.0.0:4000", api_key="sk-1234"),
)

print(result.text, result.cost, [f.path for f in result.files])
```

Every model call the harness makes goes through your AI Gateway, tagged `harness,claude_code`. Install `starlette uvicorn` plus the harness CLI (`claude`, `codex` or `opencode`), or `deepagents langchain-litellm` for Deep Agents.

[**Docs: Agent Harnesses**](https://docs.litellm.ai/docs/harness)

</details>

### Supported Providers ([Website Supported Models](https://models.litellm.ai/) | [Docs](https://docs.litellm.ai/docs/providers))

| Provider | `/chat/completions` | `/messages` | `/responses` | `/embeddings` | `/image/generations` | `/audio/transcriptions` | `/audio/speech` | `/moderations` | `/batches` | `/rerank` |
Expand Down
6 changes: 6 additions & 0 deletions litellm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2314,6 +2314,12 @@ def __getattr__(name: str) -> Any:
handler_func: Final = registry[name]
return handler_func(name)

# litellm.harness: imported on first access (it is not needed for completion calls)
if name == "harness":
import importlib

return importlib.import_module("litellm.harness")

# Lazy load encoding from main.py to avoid heavy tiktoken import
if name == "encoding":
from ._lazy_imports import get_litellm_globals
Expand Down
21 changes: 21 additions & 0 deletions litellm/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -2184,3 +2184,24 @@

# API endpoint for breached password k-anonymity search
HIBP_RANGE_API_BASE: Final = "https://api.pwnedpasswords.com/range"

# litellm.harness defaults
HARNESS_ENDPOINT_HOST: Final = "127.0.0.1"
HARNESS_ENDPOINT_STARTUP_TIMEOUT_SECONDS: Final = 10.0
HARNESS_ENDPOINT_REQUEST_TIMEOUT_SECONDS: Final = 600.0
HARNESS_SESSION_TOKEN_BYTES: Final = 32
HARNESS_MAX_DIFF_BYTES: Final = 256 * 1024
HARNESS_STDERR_TAIL_LINES: Final = 40
HARNESS_PROCESS_KILL_GRACE_SECONDS: Final = 5.0
HARNESS_SNAPSHOT_SKIP_DIRS: Final = frozenset(
{
".git",
"node_modules",
".venv",
"venv",
"__pycache__",
".mypy_cache",
".pytest_cache",
".ruff_cache",
}
)
99 changes: 99 additions & 0 deletions litellm/harness/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
"""litellm.harness: run coding-agent runtimes (Claude Code, Codex, OpenCode, Deep Agents)
through one API, with every model call routed via LiteLLM.

from litellm import harness, sandbox

result = harness.run(
harness.Harness.CLAUDE_CODE,
"fix the failing test",
sandbox=sandbox.local("."),
model="claude-sonnet-4-5",
)
"""

from litellm.harness.errors import (
CapabilityUnsupported,
HarnessError,
HarnessInstallFailed,
OptionsMismatch,
OutputInvalid,
SandboxError,
SessionClosed,
StateIncompatible,
)
from litellm.harness.options import (
ClaudeCodeOptions,
CodexOptions,
DeepAgentsOptions,
OpenCodeOptions,
)
from litellm.harness.runtime import (
AsyncEventStream,
AsyncSession,
aresume,
arun,
asession,
astream,
capabilities,
)
from litellm.harness.sync import EventStream, Session, resume, run, session, stream
from litellm.harness.types import (
Approval,
Capabilities,
Compaction,
Done,
Event,
FileChange,
Gateway,
Harness,
Reasoning,
Result,
State,
Text,
ToolCall,
ToolResult,
Usage,
)

__all__ = [
"Approval",
"AsyncEventStream",
"AsyncSession",
"Capabilities",
"CapabilityUnsupported",
"ClaudeCodeOptions",
"CodexOptions",
"Compaction",
"DeepAgentsOptions",
"Done",
"Event",
"EventStream",
"FileChange",
"Gateway",
"Harness",
"HarnessError",
"HarnessInstallFailed",
"OpenCodeOptions",
"OptionsMismatch",
"OutputInvalid",
"Reasoning",
"Result",
"SandboxError",
"Session",
"SessionClosed",
"State",
"StateIncompatible",
"Text",
"ToolCall",
"ToolResult",
"Usage",
"aresume",
"arun",
"asession",
"astream",
"capabilities",
"resume",
"run",
"session",
"stream",
]
39 changes: 39 additions & 0 deletions litellm/harness/adapters/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
"""Adapter registry. Adapter modules are imported only when their harness is used."""

from __future__ import annotations

import importlib
from collections.abc import Mapping
from typing import Final

from litellm.harness.adapters.base import HarnessAdapter, SessionContext
from litellm.harness.types import Capabilities, Harness, require_harness

ADAPTER_PATHS: Final[Mapping[Harness, tuple[str, str]]] = {
Harness.CLAUDE_CODE: ("litellm.harness.adapters.claude_code", "ClaudeCodeAdapter"),
Harness.CODEX: ("litellm.harness.adapters.codex", "CodexAdapter"),
Harness.OPENCODE: ("litellm.harness.adapters.opencode", "OpenCodeAdapter"),
Harness.DEEPAGENTS: ("litellm.harness.adapters.deepagents", "DeepAgentsAdapter"),
}


def get_adapter_class(harness: Harness) -> type[HarnessAdapter]:
"""Import and return the adapter class for harness."""
module_path, class_name = ADAPTER_PATHS[require_harness(harness)]
module = importlib.import_module(module_path)
adapter_cls: type[HarnessAdapter] = getattr(module, class_name)
return adapter_cls


def get_capabilities(harness: Harness) -> Capabilities:
"""What harness supports, as declared by its adapter."""
return get_adapter_class(harness).capabilities


__all__ = [
"ADAPTER_PATHS",
"HarnessAdapter",
"SessionContext",
"get_adapter_class",
"get_capabilities",
]
94 changes: 94 additions & 0 deletions litellm/harness/adapters/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
"""The adapter contract every harness implements."""

from __future__ import annotations

from abc import ABC, abstractmethod
from collections.abc import AsyncIterator, Awaitable, Callable, Mapping, Sequence
from dataclasses import dataclass, field
from typing import (
TYPE_CHECKING,
Any,
ClassVar,
)

from pydantic import BaseModel

from litellm.harness.errors import CapabilityUnsupported
from litellm.harness.options import HarnessOptions
from litellm.harness.sandbox.base import Sandbox
from litellm.harness.types import (
Approval,
Capabilities,
Event,
Gateway,
Harness,
PermissionMode,
)

if TYPE_CHECKING:
from litellm.harness.endpoint import ModelEndpoint

ApprovalHandler = Callable[[Approval], bool | Awaitable[bool]]


@dataclass
class SessionContext:
"""Everything an adapter needs for a session. Owned by core; adapters read it."""

harness: Harness
sandbox: Sandbox
session_id: str
model: str | None = None
gateway: Gateway | None = None
api_key: str | None = None
api_base: str | None = None
endpoint: ModelEndpoint | None = None
instructions: str | None = None
tools: Sequence[Callable[..., Any]] = ()
skills: Sequence[str] = ()
disable_tools: Sequence[str] = ()
permissions: PermissionMode = "full"
on_approval: ApprovalHandler | None = None
output: type[BaseModel] | None = None
max_turns: int | None = None
timeout: float | None = None
metadata: Mapping[str, Any] = field(default_factory=dict)
options: HarnessOptions | None = None
# Set by the adapter during a turn.
final_text: str = ""
output_json: str | None = None
# Filled by adapters that account usage themselves (endpoint-less harnesses).
input_tokens: int = 0
output_tokens: int = 0
cost: float = 0.0
calls: int = 0


class HarnessAdapter(ABC):
"""One runtime. Core owns validation, endpoint, timeouts, files and results."""

harness: ClassVar[Harness]
options_type: ClassVar[type]
capabilities: ClassVar[Capabilities]
uses_endpoint: ClassVar[bool] = True

@abstractmethod
async def start(self, ctx: SessionContext) -> None:
"""Prepare the runtime for this session (config files, skills, agent build)."""

@abstractmethod
def turn(self, ctx: SessionContext, prompt: str) -> AsyncIterator[Event]:
"""Run one turn and yield events. Must not yield Done. Sets ctx.final_text."""

@abstractmethod
async def stop(self, ctx: SessionContext) -> None:
"""Stop anything this adapter started. Safe to call twice."""

def native_session_id(self) -> str | None:
return None

async def resume(self, ctx: SessionContext, native_session_id: str) -> None:
raise CapabilityUnsupported(f"{self.harness.name} does not support resume")

async def history(self, ctx: SessionContext) -> list[dict[str, Any]]:
raise CapabilityUnsupported(f"{self.harness.name} does not expose history")
Loading
Loading