Andrea Cosentino created CAMEL-24614:
----------------------------------------

             Summary: camel-langchain4j-agent: validate that an agent was 
resolved before use
                 Key: CAMEL-24614
                 URL: https://issues.apache.org/jira/browse/CAMEL-24614
             Project: Camel
          Issue Type: Bug
          Components: camel-langchain4j-agent
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.23.0


LangChain4jAgentProducer resolves the agent from the registry with 
lookupByNameAndType(agentId, Agent.class), which returns null when no matching 
bean exists. With no agent/agentConfiguration/agentFactory configured and no 
registry bean named agentId, this.agent stays null and process() throws an 
opaque NullPointerException at agent.chat(...) instead of a clear configuration 
error. Fix: after the resolution chain in doInit, throw a clear 
IllegalArgumentException when agent == null && agentFactory == null.

_Reported by an automated functional audit._



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to