Skip to content

Commit

Permalink
Also force new thread in case of incomplete run
Browse files Browse the repository at this point in the history
  • Loading branch information
daohoangson committed Jul 20, 2024
1 parent ec5005a commit cd8e574
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/openai/src/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class AgentStreamer {

const { ctx, threadId, tools } = this;
if (functionToolCalls.length === 0) {
if (run.status === "failed") {
if (run.status === "failed" || run.status === "incomplete") {
for (const tool of tools) {
if (tool.name === "new_thread") {
// force new thread in case of run failure
Expand Down

0 comments on commit cd8e574

Please sign in to comment.