From a26b076b5af31f5bea6b7ed473880eb65e3ee42f Mon Sep 17 00:00:00 2001 From: extio-de Date: Sat, 14 Mar 2026 15:27:01 +0100 Subject: [PATCH] feat: Add alwaysSkipCache flag to AgentContext and update BaseAgent to utilize it --- src/main/java/de/extio/lmlib/agent/AgentContext.java | 11 +++++++++++ src/main/java/de/extio/lmlib/agent/BaseAgent.java | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/de/extio/lmlib/agent/AgentContext.java b/src/main/java/de/extio/lmlib/agent/AgentContext.java index 66c2ec7..80f3646 100755 --- a/src/main/java/de/extio/lmlib/agent/AgentContext.java +++ b/src/main/java/de/extio/lmlib/agent/AgentContext.java @@ -29,6 +29,8 @@ public final class AgentContext { private volatile boolean skipNextCompletion; private volatile boolean skipCache; + + private volatile boolean alwaysSkipCache; private volatile Conversation conversation; @@ -80,6 +82,7 @@ public final class AgentContext { this.errorException = other.errorException; this.skipNextCompletion = other.skipNextCompletion; this.skipCache = other.skipCache; + this.alwaysSkipCache = other.alwaysSkipCache; this.streaming = other.streaming; synchronized (other.graph) { this.graph.addAll(other.graph); @@ -233,6 +236,14 @@ public final class AgentContext { public void setSkipCache(final boolean skipCache) { this.skipCache = skipCache; } + + public boolean isAlwaysSkipCache() { + return this.alwaysSkipCache; + } + + public void setAlwaysSkipCache(final boolean alwaysSkipCache) { + this.alwaysSkipCache = alwaysSkipCache; + } Consumer getAgentContextUpdateConsumer() { return agentContextUpdateConsumer; diff --git a/src/main/java/de/extio/lmlib/agent/BaseAgent.java b/src/main/java/de/extio/lmlib/agent/BaseAgent.java index f20c2b0..3d09d34 100644 --- a/src/main/java/de/extio/lmlib/agent/BaseAgent.java +++ b/src/main/java/de/extio/lmlib/agent/BaseAgent.java @@ -112,7 +112,7 @@ public interface BaseAgent { split.context().getGraph().add(this.name()); if (!skipCompletion) { - final boolean skipCache = split.context().isSkipCache(); + final boolean skipCache = split.context().isSkipCache() || split.context().isAlwaysSkipCache(); split.context().setSkipCache(false); final var conversation = this.setupConversation(split);