summaryrefslogtreecommitdiff
path: root/src/Agent.Core/Runtime/AgentRuntime.cs
diff options
context:
space:
mode:
authortanaka takashi <isazaka@gmail.com>2026-08-11 22:04:42 +0900
committertanaka takashi <isazaka@gmail.com>2026-08-11 22:04:42 +0900
commit66701c56acb06c9cb56601f5deb65235f5178071 (patch)
tree70c04346c3715fca9058f5b123e69109d39e0d3a /src/Agent.Core/Runtime/AgentRuntime.cs
parent6a9f90d0559f1ebf7967ab903f25d3e632d1f954 (diff)
Preserve planned tool parameters and bound failures
Diffstat (limited to 'src/Agent.Core/Runtime/AgentRuntime.cs')
-rw-r--r--src/Agent.Core/Runtime/AgentRuntime.cs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Agent.Core/Runtime/AgentRuntime.cs b/src/Agent.Core/Runtime/AgentRuntime.cs
index f1c7186..3722ff3 100644
--- a/src/Agent.Core/Runtime/AgentRuntime.cs
+++ b/src/Agent.Core/Runtime/AgentRuntime.cs
@@ -302,6 +302,10 @@ public sealed class AgentRuntime(TaskRegistry registry, IOllamaClient ollama, Ag
if (unresolvedToolFailures.Count > 0)
{
+ string unresolvedFingerprint = string.Join(";", unresolvedToolFailures.OrderBy(static item => item.Key, StringComparer.Ordinal)
+ .Select(static item => $"{item.Key}={item.Value}"));
+ ToolUseGuardResult unresolvedGuard = guard.Evaluate(true, false, false, unresolvedFingerprint);
+ if (unresolvedGuard.Decision == ToolUseGuardDecision.Fail) throw new InvalidOperationException(unresolvedGuard.Observation);
messages.Add(new OllamaMessage("system", "Completion is not allowed while tool failures remain unresolved. Retry or correct: " +
string.Join("; ", unresolvedToolFailures.Select(static item => $"{item.Key}={item.Value}"))));
continue;