I’m running into a problem with my multi-agent system setup using LangChain. I’m working with ChatBedrockConverse and trying to build a supervisor that manages different types of agents.
The Problem
I have two types of agents in my system:
Agents with tools (created using createReactAgent)
Agents without tools (built with StateGraph)
When the agents without tools try to handle message histories that contain tool calls from the other agents, I get this error:
ValidationException: The toolConfig field must be defined when using toolUse and toolResult content blocks.
My Code Structure
// Creating agents
const hotelBooker = createReactAgent({
llm: myLLM,
tools: [reserveHotel]
});
const travelAdvisor = new StateGraph(MessagesAnnotation)
.addNode('consultant', processRequest)
.compile();
// Setting up supervisor
const mainSupervisor = createSupervisor({
agents: [hotelBooker, travelAdvisor],
llm: myLLM,
});
// This triggers the error
await mainSupervisor.stream({
messages: [new HumanMessage('Reserve hotel and give travel tips')]
});
It seems like the non-tool agents can’t properly handle the tool-related content from other agents in the conversation history.
Has anyone dealt with this before? Any workarounds or solutions would be really helpful!
I’ve hit this exact same issue mixing agent types in multi-agent setups. ChatBedrockConverse freaks out when it sees tool calls in message history but no toolConfig - even if your current agent doesn’t use tools.
Easiest fix? Strip tool messages from history before sending to non-tool agents. Here’s what worked:
function cleanHistoryForNonToolAgent(messages) {
return messages.filter(msg => {
if (msg.additional_kwargs?.tool_calls) return false;
if (msg.type === 'tool') return false;
return true;
});
}
// In your non-tool agent setup
const travelAdvisor = new StateGraph(MessagesAnnotation)
.addNode('consultant', async (state) => {
const cleanMessages = cleanHistoryForNonToolAgent(state.messages);
return processRequest({ ...state, messages: cleanMessages });
})
.compile();
You could also configure your supervisor to handle message routing differently. Filter what each agent sees based on what they can actually handle instead of dumping full history on everyone.
Spent hours debugging this ValidationException before figuring it out. Bedrock’s really strict about tool configs - it won’t let you pass tool messages without proper setup.
Had the same ValidationException nightmare with a mixed agent system. The problem is ChatBedrockConverse validates your entire message chain against the current LLM config, not just what you’re sending right now.
Skip message filtering - it’s a pain. Instead, set up all your LLMs with empty tool configs from the start. Even your non-tool agents need an empty tools array to keep Bedrock happy.
const nonToolLLM = new ChatBedrockConverse({
model: 'your-model',
tools: [], // Empty but defined
toolConfig: { toolChoice: { auto: {} } }
});
Now your non-tool agents can handle tool messages in the history without crashing. They’ll just ignore tool calls since there’s nothing to invoke.
I tried filtering messages first but lost important context when agents couldn’t see the full conversation. This config trick keeps everything intact while dodging ValidationException completely. Works with different Bedrock models too.
Yeah, this is annoying. I set up a message transformer in my supervisor that routes clean histories to each agent type. I keep separate conversation threads - tool agents get full context, but non-tool ones only see regular messages. It’s more complex but stops validation errors completely and keeps conversation flow intact.
Been there. The ValidationException happens because Bedrock gets confused when it sees tool artifacts in message history without proper tool configuration.
Skip the manual message filtering and separate conversation threads - I just automate this whole thing with Latenode. It handles message routing between different agent types without the headache.
You set up workflows that automatically detect message types and send them where they need to go. Tool messages hit tool-enabled agents, regular messages hit non-tool agents. No more manual filtering or validation errors.
I’ve built similar multi-agent systems where Latenode runs the supervisor logic. It tracks conversation state, transforms messages, and coordinates between different agent architectures so you don’t have to deal with Bedrock’s strict validation rules.
The automation catches edge cases you’d miss coding message filters yourself. Plus you get visual workflow management instead of debugging complex routing logic.