Skip to content

Commit 94b8a86

Browse files
hyperpolymathclaude
andcommitted
fix(orchestrator): add switch_project/clear_history/recent_history delegators
`src/main.rs` invokes three Orchestrator methods that did not exist on the type, causing `cargo check --bin mobile-ai` to fail with 4 E0599 errors (two for `switch_project`, one each for `clear_history` and `recent_history`). The methods all exist on the inner ContextManager already, so the fix is three pure-delegation forwarders. Imports `ConversationTurn` from `crate::types` (already declared in that module) to match the return-type shape of `recent_history`. Restores library + binary build. Existing tests unaffected (39 lib tests still pass; two unrelated SNN tests — `snn::tests::test_lif_neuron_reset` and `snn::tests::test_spiking_network_reset` — fail on main and are out of scope here). Surfaced 2026-05-27 during the Track E Cargo CVE phantom-strip pilot in PR #41 — the build break was visible but unrelated to the CVE work. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 8f2d1f2 commit 94b8a86

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

src/orchestrator.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use crate::{
1818
context::ContextManager,
1919
expert::ExpertSystem,
2020
router::{Router, RouterConfig},
21-
types::{Query, Response, ResponseMetadata, RoutingDecision},
21+
types::{ConversationTurn, Query, Response, ResponseMetadata, RoutingDecision},
2222
};
2323

2424
/// Orchestrator: Coordinates the full AI pipeline.
@@ -82,6 +82,21 @@ impl Orchestrator {
8282

8383
Ok(response)
8484
}
85+
86+
/// Set the active project on the underlying ContextManager.
87+
pub fn switch_project(&mut self, project: impl Into<String>) {
88+
self.context.switch_project(project);
89+
}
90+
91+
/// Drop the active project's conversation history.
92+
pub fn clear_history(&mut self) {
93+
self.context.clear_history();
94+
}
95+
96+
/// Borrow the N most recent turns from the active project's history.
97+
pub fn recent_history(&self, n: usize) -> Vec<ConversationTurn> {
98+
self.context.recent_history(n)
99+
}
85100
}
86101

87102
impl Default for Orchestrator {

0 commit comments

Comments
 (0)