mirror of
https://github.com/outbackdingo/optimclaw.git
synced 2026-08-30 16:19:21 +00:00
feat: add tool execution idempotency cache
For tools that declare `is_idempotent() == true`, successful results are cached per-job so repeated identical calls (common during self-repair recovery, stuck job retries, or chat-mode retry loops) return instantly without re-executing. Cache uses SHA-256 content hashing with TTL and LRU eviction, scoped per job_id. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
ffb1cc9be8
commit
322a048b39
@@ -282,6 +282,9 @@ impl TestHarnessBuilder {
|
||||
max_actions_per_hour: None,
|
||||
}));
|
||||
|
||||
let idempotency_cache = Arc::new(crate::tools::ToolIdempotencyCache::new(
|
||||
crate::tools::IdempotencyCacheConfig::default(),
|
||||
));
|
||||
let deps = AgentDeps {
|
||||
store: Some(Arc::clone(&db)),
|
||||
llm,
|
||||
@@ -294,6 +297,7 @@ impl TestHarnessBuilder {
|
||||
skills_config: SkillsConfig::default(),
|
||||
hooks,
|
||||
cost_guard,
|
||||
idempotency_cache,
|
||||
};
|
||||
|
||||
TestHarness {
|
||||
|
||||
Reference in New Issue
Block a user