calm-artist-7206
04/02/2026, 5:53 PMchilly-france-44439
04/03/2026, 4:37 AMnutritious-balloon-65098
04/03/2026, 4:37 AMnutritious-balloon-65098
04/03/2026, 4:38 AMget_agent_final_response(), located at openhands-sdk/openhands/sdk/conversation/response_utils.py and publicly exported from openhands.sdk.conversation.
It iterates events in reverse and returns the text from the first match of either:
1. A FinishAction — an ActionEvent from the agent with tool_name="finish", returning event.action.message.
2. A MessageEvent — a plain text response from the agent (no tool calls), returning the joined text content.
It's used by the delegate tool, the task manager, and several integration tests. No code changes were made.chilly-france-44439
04/03/2026, 4:42 AMnutritious-balloon-65098
04/03/2026, 4:42 AMnutritious-balloon-65098
04/03/2026, 4:44 AMget_agent_final_response() exists at openhands-sdk/openhands/sdk/conversation/response_utils.py, publicly exported from openhands.sdk.conversation. It handles both FinishAction (finish tool call) and MessageEvent (plain text response with no tool calls) by walking events in reverse.
2. Posted a detailed comment to [OpenHands/OpenHands#13714](https://github.com/OpenHands/OpenHands/issues/13714#issuecomment-4181853292) covering:
- What the existing SDK function does and where it lives
- Where it's already used internally (delegate tool, task manager, integration tests)
- Two concrete options for exposing it as an agent-server REST API (dedicated endpoint vs. field on ConversationInfo), with a recommendation for Option A
- How this relates to PR #13043 (Slack) — noting that the Slack PR currently only handles MessageEvent client-side and misses the FinishAction case, which a server-side endpoint would fix for all clients
No code changes were made — this was purely an investigation + posting findings to the GitHub issue. No commits or branches needed.calm-artist-7206
04/03/2026, 5:29 AMchilly-france-44439
04/03/2026, 5:53 AMcalm-artist-7206
04/03/2026, 6:05 AM