Skip to content

Commit 20f6303

Browse files
terminus2 agent (#343)
* [Feature] Support terminus2 adapter * [Refactor] Wrap harbor.Terminus2 in Terminus2Adapter - Replace terminal-bench-based wrapping with a thin adapter over harbor.agents.terminus_2.Terminus2; harbor's LiteLLM layer sets reraise=True, so auth/rate-limit errors surface instead of being swallowed by nested RetryError. - Bundle a lazy LocalSandboxEnvironment factory exposing harbor's BaseEnvironment via local subprocess/shutil — the adapter runs inside the lagent sandbox daemon, and lazy build keeps `import lagent.adapters` working without harbor on PYTHONPATH. * [Feature] Support get_messages in Terminus2Adapter * [Fix] Capture terminus2 trajectory on timeout and support whitebox get_messages * [Refactor] Route Terminus2Adapter LLM calls solely through the proxy - Drop base_url/api_key from Terminus2Adapter.__init__; always use self.proxy.url and sk-proxy-{session_id}. As a black-box adapter, an explicit base_url/api_key alongside the proxy only muddies which endpoint is actually used. - Require the SessionClient proxy: setup() raises if it is missing, and the whitebox (proxy is None) fallbacks in run_external_async / get_messages are removed. - Remove SessionClient.get_records; get_messages reads self.proxy._records directly so the per-turn dedup logic stays in the adapter, not the proxy.
1 parent 9cb1a99 commit 20f6303

2 files changed

Lines changed: 533 additions & 0 deletions

File tree

lagent/adapters/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from .openhands import OpenHandsAdapter
88
from .proxy import SessionClient
99
from .sdk_adapter import SDKAgentAdapter
10+
from .terminus2 import Terminus2Adapter
1011

1112
__all__ = [
1213
'BaseExternalAgent',
@@ -19,4 +20,5 @@
1920
'SDKAgentAdapter',
2021
'MiniSWEAgentAdapter',
2122
'SessionClient',
23+
'Terminus2Adapter',
2224
]

0 commit comments

Comments
 (0)