chore: Bump version to 1.6.16 and refactor AgentExecutorService to improve context walking logic
This commit is contained in:
2
pom.xml
2
pom.xml
@@ -4,7 +4,7 @@
|
|||||||
<artifactId>lm-lib</artifactId>
|
<artifactId>lm-lib</artifactId>
|
||||||
<groupId>de.extio</groupId>
|
<groupId>de.extio</groupId>
|
||||||
<name>lm-lib</name>
|
<name>lm-lib</name>
|
||||||
<version>1.6.15</version>
|
<version>1.6.16</version>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java.version>21</java.version>
|
<java.version>21</java.version>
|
||||||
|
|||||||
@@ -69,6 +69,13 @@ public class AgentExecutorService implements InitializingBean, DisposableBean {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public List<AgentContext> walk(final BaseAgent agent, final AgentContext context, final Consumer<AgentContext> agentContextUpdateConsumer) {
|
public List<AgentContext> walk(final BaseAgent agent, final AgentContext context, final Consumer<AgentContext> agentContextUpdateConsumer) {
|
||||||
|
if (!context.getGraph().isEmpty()) {
|
||||||
|
context.getGraph().add("‖");
|
||||||
|
}
|
||||||
|
return this.walkRecursive(agent, context, agentContextUpdateConsumer);
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<AgentContext> walkRecursive(final BaseAgent agent, final AgentContext context, final Consumer<AgentContext> agentContextUpdateConsumer) {
|
||||||
LOGGER.debug("Agent: {}", agent.name());
|
LOGGER.debug("Agent: {}", agent.name());
|
||||||
|
|
||||||
this.discoverAgents(context);
|
this.discoverAgents(context);
|
||||||
@@ -96,7 +103,7 @@ public class AgentExecutorService implements InitializingBean, DisposableBean {
|
|||||||
|
|
||||||
branchTasks.add(CompletableFuture.runAsync(() -> {
|
branchTasks.add(CompletableFuture.runAsync(() -> {
|
||||||
try {
|
try {
|
||||||
responses.addAll(this.walk(branchAgent, branchContext, agentContextUpdateConsumer));
|
responses.addAll(this.walkRecursive(branchAgent, branchContext, agentContextUpdateConsumer));
|
||||||
}
|
}
|
||||||
catch (final Exception e) {
|
catch (final Exception e) {
|
||||||
LOGGER.error("Error executing agent", e);
|
LOGGER.error("Error executing agent", e);
|
||||||
|
|||||||
Reference in New Issue
Block a user