agents icon indicating copy to clipboard operation
agents copied to clipboard

TypeError: agent._url.replace is not a function

Open kchro3 opened this issue 6 months ago • 12 comments

I get this error when I pass in the query field in the useAgent. I'm on the latest agents SDK.

For whatever it's worth, I'm running my backend locally on localhost:8787 & I am trying to use the "query" field in the useAgents hook so that I can pass in a JWT.

Something like:

  // works if i uncomment below
  const agent = useAgent({
    agent: "test-agent",
    host: "http://localhost:8787",
    // query: async () => ({
    //   token: await getToken(),  << calls clerk's getToken function
    // }),
  });

kchro3 avatar Apr 05 '25 22:04 kchro3