Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

refactor(plan_review): move plan review module to crate root

Steven Enamakel35f4af80cf04
diff --git a/crates/openhuman-core/src/agent/mod.rs b/crates/openhuman-core/src/agent/mod.rs
index 53997cc5e3..bfc91ca871 100644
--- a/crates/openhuman-core/src/agent/mod.rs
+++ b/crates/openhuman-core/src/agent/mod.rs
@@ -35,7 +35,6 @@ pub(crate) mod message_convert;
pub mod messages;
pub mod multimodal;
pub mod orchestration;
-pub mod plan_review;
/// Cross-platform shell selection shared by [`host_runtime::NativeRuntime`]
/// and [`crate::sandbox::ops`] so all three shell-spawning sites
/// agree on `cmd.exe` (Windows) vs `bash`/`sh` (Unix). Fixes #4705 where
diff --git a/crates/openhuman-core/src/agent/registration.rs b/crates/openhuman-core/src/agent/registration.rs
index 9f67007fb0..dc7dd34222 100644
--- a/crates/openhuman-core/src/agent/registration.rs
+++ b/crates/openhuman-core/src/agent/registration.rs
@@ -57,7 +57,7 @@ pub(crate) fn dialogue_tools(action_dir: &Path, root_config: &Config) -> Vec<Box
Box::new(TodoTool::new(root_config.workspace_dir.clone())),
// Interactive plan-review gate: parks the live turn on a thread-scoped
// plan the user must approve before execution (Codex/Claude plan mode).
- Box::new(crate::agent::plan_review::RequestPlanReviewTool::new()),
+ Box::new(crate::plan_review::RequestPlanReviewTool::new()),
Box::new(PlanExitTool::new()),
// Workflow composition: `run_workflow` runs another workflow as a
// subagent and (by default) waits on its result like a function call;
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit.rs b/crates/openhuman-core/src/agent/tools/plan_exit.rs
index 8f1ef72bb6..310e818fea 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit.rs
@@ -102,7 +102,7 @@ impl PlanExitTool {
// concurrent `plan_exit` call that races a still-pending review:
// flipping the mode early would unlock every tool for the thread
// before the user has actually approved anything.
- if crate::agent::plan_review::gate::global()
+ if crate::plan_review::gate::global()
.parked_review_for_thread(thread_id)
.is_some()
{
diff --git a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
index 6facac3922..85c7586237 100644
--- a/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
+++ b/crates/openhuman-core/src/agent/tools/plan_exit_tests.rs
@@ -1,5 +1,5 @@
use super::*;
-use crate::agent::plan_review::PlanReviewResolution;
+use crate::plan_review::PlanReviewResolution;
struct ThreadContext(&'static str);
impl ToolRunContext for ThreadContext {
@@ -21,7 +21,7 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {
thread_id,
tinyagents_harness::middleware::RunMode::Plan,
);
- let gate = crate::agent::plan_review::gate::global();
+ let gate = crate::plan_review::gate::global();
let parked = tokio::spawn(async move {
gate.request_review(
Some(thread_id.to_string()),
@@ -58,7 +58,7 @@ async fn plan_exit_does_not_flip_while_a_review_is_parked() {
// Resolve the parked review so the spawned task and the gate's
// bookkeeping don't leak past this test.
assert!(
- crate::agent::plan_review::gate::global()
+ crate::plan_review::gate::global()
.decide_by_thread(thread_id, PlanReviewResolution::Approve)
);
let resolution = parked.await.unwrap();
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rs
index 2359d1d209..ad6c2f2a2f 100644
--- a/crates/openhuman-core/src/core/all.rs
+++ b/crates/openhuman-core/src/core/all.rs
@@ -444,7 +444,7 @@ fn build_registered_controllers() -> Vec<GroupedController> {
push(
&mut controllers,
DomainGroup::Agent,
- crate::agent::plan_review::all_plan_review_registered_controllers(),
+ crate::plan_review::all_plan_review_registered_controllers(),
);
// Per-thread Plan/Build run mode (agent.set_run_mode / agent.get_run_mode)
push(
diff --git a/crates/openhuman-core/src/core/events.rs b/crates/openhuman-core/src/core/events.rs
index c0a591785c..cc7626f200 100644
--- a/crates/openhuman-core/src/core/events.rs
+++ b/crates/openhuman-core/src/core/events.rs
@@ -669,7 +669,7 @@ pub enum DomainEvent {
// ── Plan review (interactive plan-mode gate) ────────────────────────
/// An interactive turn parked on a thread-scoped plan the user must
/// review before execution. Published by
- /// [`crate::agent::plan_review::gate::PlanReviewGate::request_review`]
+ /// [`crate::plan_review::gate::PlanReviewGate::request_review`]
/// and bridged to the web channel as a `plan_review_request` socket event.
PlanReviewRequested {
/// Unique id correlating the decision back to the parked turn.
diff --git a/crates/openhuman-core/src/lib.rs b/crates/openhuman-core/src/lib.rs
index 2a9a70e8aa..c5547f2551 100644
--- a/crates/openhuman-core/src/lib.rs
+++ b/crates/openhuman-core/src/lib.rs
@@ -77,6 +77,7 @@ pub mod media;
pub mod memory;
pub mod modules;
pub mod platform;
+pub mod plan_review;
pub mod profiles;
pub mod sandbox;
pub mod search;
diff --git a/crates/openhuman-embed/src/host_internals.rs b/crates/openhuman-embed/src/host_internals.rs
index 484af48fb3..ed81c10188 100644
--- a/crates/openhuman-embed/src/host_internals.rs
+++ b/crates/openhuman-embed/src/host_internals.rs
@@ -162,7 +162,7 @@ pub mod agent {
}
pub mod plan_review {
pub mod gate {
- pub use openhuman_core::agent::plan_review::gate::global;
+ pub use openhuman_core::plan_review::gate::global;
}
}
pub mod session_store {
diff --git a/crates/openhuman-rpc/src/server/socketio.rs b/crates/openhuman-rpc/src/server/socketio.rs
index 2900bf3fb1..119ff6b842 100644
--- a/crates/openhuman-rpc/src/server/socketio.rs
+++ b/crates/openhuman-rpc/src/server/socketio.rs
@@ -1274,7 +1274,7 @@ fn replay_parked_approval(socket: &SocketRef, thread_id: &str) {
/// UI the same fire-and-forget way, so the same reconciliation applies.
fn replay_parked_plan_review(socket: &SocketRef, thread_id: &str) {
let Some(row) =
- crate::core_host::agent::plan_review::gate::global().parked_review_for_thread(thread_id)
+ crate::core_host::plan_review::gate::global().parked_review_for_thread(thread_id)
else {
return;
};