Skip to content

possible-bug: abort stream function, or finish function doesn't end stream #61

Open
@saranatour1

Description

@saranatour1

following a thread on the convex discord, using the components.agent.streams.finish doesn't end the stream immediately, and using the AbortController doesn't end the stream too.

export const stopStreaming = action({Add commentMore actions
  args: { threadId: v.string() },
  handler: async (ctx, args_0) => {
   // Not properly working
    const data = await ctx.runQuery(components.agent.streams.list, { threadId: args_0.threadId })
    if (data[0]) {
      console.log("I ran", data[0].streamId)
      await ctx.runMutation(components.agent.streams.finish, {
        streamId: data?.[0]?.streamId
      })

    } else {
      console.log("none are running right now")
    }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions