fix(agent/tty): Fix finish command in TTY mode

- Prevent the Agent from treating `AgentTerminated` like it would any other exception raised by a command.
- The agent should raise AgentTerminated exception to exit the loop.
This commit is contained in:
Reinier van der Leer
2023-12-13 22:50:02 +01:00
parent acf4df9f87
commit 0e94c7b5fc

View File

@@ -250,6 +250,8 @@ class Agent(
self.context.add(context_item)
result = ActionSuccessResult(outputs=return_value)
except AgentTerminated:
raise
except AgentException as e:
result = ActionErrorResult.from_exception(e)