Skip to content

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

feat(chatRuntime): add optional tool call id and expiry to pending plan review

Steven Enamakel8d698990f092
diff --git a/app/src/store/chatRuntimeSlice.ts b/app/src/store/chatRuntimeSlice.ts
index 86792485b5..4f47543d82 100644
--- a/app/src/store/chatRuntimeSlice.ts
+++ b/app/src/store/chatRuntimeSlice.ts
@@ -638,6 +638,14 @@ export interface PendingPlanReview {
summary: string;
/** Ordered plan steps to display for review. */
steps: string[];
+ /**
+ * The `request_plan_review` tool call this review binds to (wire contract:
+ * `DomainEvent::PlanReviewRequested.tool_call_id`, additive, lands with core
+ * workstream C2). Absent on a core that has not landed C2 yet.
+ */
+ toolCallId?: string;
+ /** RFC3339 expiry for the parked review (additive, lands with C2). */
+ expiresAt?: string;
}
/** One step in a `WorkflowProposal`'s summary — a non-trigger node. */
diff --git a/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs b/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs
new file mode 100644
index 0000000000..324e52f0e1
--- /dev/null
+++ b/crates/openhuman-core/src/agent/tinyagents/run_mode_tests.rs
@@ -0,0 +1,33 @@
+use super::*;
+
+#[test]
+fn defaults_to_build_mode_for_an_unseen_thread() {
+ let thread_id = format!("run-mode-test-{}", uuid::Uuid::new_v4());
+ assert_eq!(get_mode(&thread_id), RunMode::Build);
+}
+
+#[test]
+fn set_mode_is_observed_through_a_fresh_handle_lookup() {
+ let thread_id = format!("run-mode-test-{}", uuid::Uuid::new_v4());
+ set_mode(&thread_id, RunMode::Plan);
+ assert_eq!(get_mode(&thread_id), RunMode::Plan);
+ set_mode(&thread_id, RunMode::Build);
+ assert_eq!(get_mode(&thread_id), RunMode::Build);
+}
+
+#[test]
+fn handle_for_thread_shares_state_with_set_mode() {
+ let thread_id = format!("run-mode-test-{}", uuid::Uuid::new_v4());
+ let handle = handle_for_thread(&thread_id);
+ set_mode(&thread_id, RunMode::Plan);
+ assert_eq!(handle.get(), RunMode::Plan);
+}
+
+#[test]
+fn mode_label_round_trips() {
+ assert_eq!(mode_label(RunMode::Plan), "plan");
+ assert_eq!(mode_label(RunMode::Build), "build");
+ assert_eq!(parse_mode_label("plan"), Some(RunMode::Plan));
+ assert_eq!(parse_mode_label("build"), Some(RunMode::Build));
+ assert_eq!(parse_mode_label("nonsense"), None);
+}