Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When building Langgraph agents from scratch, Using tools with Langgraph workers results in Message Stopped -> Cannot concat object and undefined #2472

Closed
zebathon opened this issue May 23, 2024 · 11 comments · Fixed by #2550
Labels
bug Something isn't working

Comments

@zebathon
Copy link

Describe the bug
The demos seem to work ok. However, when building from scratch adding Tools to worker nodes results in this error.

  • In the UX the frontend reports 'Message Stopped'
  • In langsmith, the Worker node is reporting 'Aborted'
  • In langsmith, the RunnableAgent is reporting the 'Cannot concat...' message.

See below

To Reproduce
Follow the most basic steps to build an Agent workflow

  1. Add 1 Supervisor, 1 Worker, 1 Chat model, and 1 Tool (calculator) all with default values. (Add explicit instructions for worker to use the tool)
  2. Start the conversation with a simple 'calculate 5*5'
  3. See error 'Message Stopped'
  4. Look in Langsmith for root cause Aborted -> Cannot concatenate etc. etc.

Expected behavior
The agent flow should be complete.

When disconnecting the tool, AgentFlow proceeds.

Screenshots
Screenshot 2024-05-23 at 4 46 16 PM

Flow
test Agents.json

Setup

  • Installation npx flowise start
  • Flowise Version 1.8.0
  • OS: macOS
  • Browser: chrome

Additional context
I've tried all types of Tools and Chat Models. Judging by the message I'm guessing it's a problem with either a null/undefinied input to the tool, or null output.

Cannot concat object and undefined

Error: Cannot concat object and undefined
    at concat (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/utils/stream.cjs:165:15)
    at ChatPromptTemplate.transform (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:381:53)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async ChatOpenAI.transform (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:373:26)
    at async RunnableBinding.transform (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:741:9)
    at async ToolCallingAgentOutputParser.transform (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:373:26)
    at async RunnableSequence._streamIterator (/usr/local/lib/node_modules/flowise/node_modules/@langchain/core/dist/runnables/base.cjs:1104:30)
@HenryHengZJ
Copy link
Contributor

If you try modify the Worker prompt to something related to Math so that the Supervisor can correctly use the Worker, does it work?

@zebathon
Copy link
Author

No luck with providing more Math related prompting. FWIW I've attached a langsmith screenshot of the worker invoking a Model with valid input (from the demos). And a 2nd screenshot (from the failing test) with no input_data to the Model. Thus the model is never called by the worker without input data.
Screenshot 2024-05-23 at 5 56 04 PM
Screenshot 2024-05-23 at 5 55 41 PM

@zebathon
Copy link
Author

I have the trace here

@brucechou1983
Copy link

image

Same here.

@mateusluizfb
Copy link

mateusluizfb commented May 27, 2024

@HenryHengZJ same happening here. I asked the supervisor to return data, so it called a worker called "data-center" that has access to some custom tools that can perform a GET request. But I'm getting this error Cannot concat object and undefined

I'm using the docker version.

Screenshot 2024-05-27 at 16 01 54

@eskimm
Copy link

eskimm commented May 27, 2024

Experiencing the similar issues. @HenryHengZJ can you elaborate how to craft prompts to have correct relationship between Supervisor/Workers? Or point to Langraph docs that describe correct use.

@rupjae
Copy link

rupjae commented May 30, 2024

reproduced.

@HenryHengZJ HenryHengZJ added the bug Something isn't working label May 31, 2024
@HenryHengZJ
Copy link
Contributor

PR bugfix merged, will be pushing to new releases soon!

@HenryHengZJ
Copy link
Contributor

can anyone confirm if the issue persists in v1.8.1 or resolved?

@CubanHackerAI
Copy link

issue still persists on 1.8.1

@toi500
Copy link
Contributor

toi500 commented Jun 3, 2024

@HenryHengZJ still bugged #2557

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants