-
Notifications
You must be signed in to change notification settings - Fork 2
feat(orchestration): wire plan_with_cache into handle_plan_goal (#1856 follow-up) #2070
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingorchestrationTask orchestration / DAG schedulingTask orchestration / DAG scheduling
Description
Problem
PR #2068 added plan template caching infrastructure (PlanCache, plan_with_cache, SQLite migration 040, PlanCacheConfig) but the integration into the actual planning code path was not completed.
In crates/zeph-core/src/agent/mod.rs (line ~521), handle_plan_goal() calls:
let (graph, planner_usage) = LlmPlanner::new(
self.provider.clone(),
&self.orchestration.orchestration_config,
)
.plan(goal, &available_agents)
.awaitThis bypasses plan_with_cache() entirely. As a result, setting [orchestration.plan_cache] enabled = true in config has no effect — the cache is never consulted, and completed plans are never stored.
Expected Behavior
When orchestration.plan_cache.enabled = true:
- On
/plan <goal>: callplan_with_cache()instead ofplanner.plan()directly PlanCache::new()must be instantiated in theOrchestrationstate struct (or inAgent)- After a plan completes successfully,
cache_plan()must be called to store the template - Subsequent similar goals should trigger cache hit path:
"plan cache hit, adapting template"logged
Required Changes
- Instantiate
PlanCachein the agent's orchestration state (requiresSqlitePoolaccess and embedding model name) - Replace the direct
planner.plan()call inhandle_plan_goal()withplan_with_cache() - After plan execution completes in
finalize_plan_execution()or equivalent, callcache.cache_plan() - Thread goal embedding through the planning flow (embed the goal text before calling
plan_with_cache)
Evidence
grep -rn "plan_with_cache\|PlanCache::new" crates/ --include="*.rs" | grep -v plan_cache.rs
# Returns only: lib.rs re-export line (pub use plan_cache::{...})
# No production call sites found.
Severity
MEDIUM — config option has no effect, feature silently unused. No crash, no data loss. Graceful degradation is unintentional (there is no cache path, only the full planner path).
Reproduction
- Add
[orchestration.plan_cache] enabled = trueto config - Run
/plan research and summarize recent Rust async patterns - Run
/plan summarize recent developments in Rust async(similar goal) - Observe logs —
"plan cache hit, adapting template"is NEVER logged - Verify
SELECT COUNT(*) FROM plan_cacheon test DB → always returns 0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingorchestrationTask orchestration / DAG schedulingTask orchestration / DAG scheduling