Skip to content

Commit c2488b5

Browse files
committed
update completion handling to consider 'length' as a valid termination reason
1 parent 4c2fd93 commit c2488b5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

hud/agents/openai_chat_generic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ async def get_response(self, messages: list[Any]) -> AgentResponse:
142142
return AgentResponse(
143143
content=msg.content or "",
144144
tool_calls=tool_calls,
145-
done=choice.finish_reason == "stop",
145+
done=choice.finish_reason in ("stop", "length"),
146146
raw=response, # Include raw response for access to Choice objects
147147
)
148148

0 commit comments

Comments
 (0)