File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 88``MarkTaskComplete`` emits a sentinel the orchestrator interprets as a
99completion signal. The orchestrator (``Terminus2Agent``) implements the
1010two-step confirmation handshake — the action itself is stateless.
11- """
1211
13- """Local tmux session wrapper.
1412
1513Port of harbor's ``TmuxSession`` that drops the ``BaseEnvironment.exec``
1614indirection and runs ``tmux`` as a local subprocess. Intended for use
2523import subprocess
2624import time
2725
28- from __future__ import annotations
2926
3027from lagent .actions .base_action import AsyncActionMixin , BaseAction , tool_api
3128from lagent .schema import ActionReturn , ActionStatusCode
Original file line number Diff line number Diff line change @@ -51,14 +51,16 @@ class ActionReturn:
5151 tool_call_id : Optional [str ] = None
5252
5353 def format_result (self ) -> str :
54- """Concatenate items in result."""
54+ """Concatenate items in result, falling back to errmsg when result is empty ."""
5555 result = []
5656 for item in self .result or []:
5757 if item ['type' ] == 'text' :
5858 result .append (item ['content' ])
5959 else :
6060 result .append (f"[{ item ['type' ]} ]({ item ['content' ]} )" )
6161 result = '\n ' .join (result )
62+ if not result and self .errmsg :
63+ return self .errmsg
6264 return result
6365
6466
You can’t perform that action at this time.
0 commit comments