Skip to content

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

refactor(core): remove workspace lifecycle events

Steven Enamakel56055e67cdb1
diff --git a/crates/openhuman-core/src/core/events.rs b/crates/openhuman-core/src/core/events.rs
index e2c956439e..3b0f4057c7 100644
--- a/crates/openhuman-core/src/core/events.rs
+++ b/crates/openhuman-core/src/core/events.rs
@@ -485,27 +485,11 @@ pub enum DomainEvent {
elapsed_ms: u64,
},
- // ── Workspace isolation ─────────────────────────────────────────────
- /// A TinyAgents workspace descriptor was prepared for an isolated run.
- WorkspacePrepared {
- /// Audit identity of the policy that produced the workspace.
- policy_id: String,
- /// Allowed workspace root.
- root: String,
- },
/// A TinyAgents workspace descriptor blocked an out-of-root path.
WorkspaceViolation {
/// Path that failed the descriptor's allowed-root policy.
path: String,
},
- /// A TinyAgents workspace descriptor was cleaned up.
- WorkspaceCleanup {
- /// Audit identity of the policy whose workspace was cleaned up.
- policy_id: String,
- /// Cleanup error, when cleanup failed.
- error: Option<String>,
- },
-
// ── Approval ────────────────────────────────────────────────────────
/// Agent attempted a tool call that produces an external side effect;
/// awaiting user approval. Published by `ApprovalGate` before parking the
@@ -1369,9 +1353,7 @@ impl DomainEvent {
Self::ToolExecutionStarted { .. } | Self::ToolExecutionCompleted { .. } => "tool",
- Self::WorkspacePrepared { .. }
- | Self::WorkspaceViolation { .. }
- | Self::WorkspaceCleanup { .. } => "workspace",
+ Self::WorkspaceViolation { .. } => "workspace",
Self::WebhookIncomingRequest { .. }
| Self::WebhookReceived { .. }
@@ -1495,9 +1477,7 @@ impl DomainEvent {
Self::WorkflowsChanged { .. } => "WorkflowsChanged",
Self::ToolExecutionStarted { .. } => "ToolExecutionStarted",
Self::ToolExecutionCompleted { .. } => "ToolExecutionCompleted",
- Self::WorkspacePrepared { .. } => "WorkspacePrepared",
Self::WorkspaceViolation { .. } => "WorkspaceViolation",
- Self::WorkspaceCleanup { .. } => "WorkspaceCleanup",
Self::WebhookIncomingRequest { .. } => "WebhookIncomingRequest",
Self::WebhookReceived { .. } => "WebhookReceived",
Self::WebhookRegistered { .. } => "WebhookRegistered",
@@ -1581,8 +1561,6 @@ impl DomainEvent {
| Self::ChannelDisconnected { channel, .. } => Some(channel.as_str()),
Self::ToolExecutionStarted { tool_name, .. }
| Self::ToolExecutionCompleted { tool_name, .. } => Some(tool_name.as_str()),
- Self::WorkspacePrepared { policy_id, .. }
- | Self::WorkspaceCleanup { policy_id, .. } => Some(policy_id.as_str()),
Self::WorkspaceViolation { path } => Some(path.as_str()),
Self::RunQueueMessageQueued { thread_id, .. }
| Self::RunQueueFollowupDispatched { thread_id, .. }
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge_subagent_events.rs b/crates/openhuman-core/src/web_chat/progress_bridge_subagent_events.rs
index 05abc16e8a..96093facdb 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge_subagent_events.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge_subagent_events.rs
@@ -18,7 +18,7 @@ use crate::web_chat::{SubagentProgressDetail, WebChannelEvent};
use super::{
cap_wire_args, cap_wire_output, ledger_append_event, ledger_upsert_agent_run,
- ledger_upsert_telemetry, publish_seq_stamped, subagent_worktree_detail,
+ ledger_upsert_telemetry, publish_seq_stamped,
};
/// Bundles the progress bridge's per-turn identity fields (read-only for the
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs b/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
index 559145572f..f68d6421d4 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge_tests.rs
@@ -156,36 +156,6 @@ async fn tool_call_completed_forwards_real_output_on_tool_result() {
assert_eq!(event.tool_call_id.as_deref(), Some("call-1"));
}
-#[test]
-fn worktree_detail_collapses_empty_changed_files_to_none() {
- // Non-isolated / clean worker: empty list → `None` so the renderer
- // omits the "changed files" section instead of showing an empty one.
- let d = subagent_worktree_detail(None, vec![], None);
- assert_eq!(d.worktree_path, None);
- assert_eq!(d.changed_files, None);
- assert_eq!(d.dirty_status, None);
-}
-
-#[test]
-fn worktree_detail_forwards_isolated_worker_fields() {
- // Isolated worker with uncommitted changes: fields pass through and a
- // non-empty list is wrapped in `Some`.
- let d = subagent_worktree_detail(
- Some("/repo/.claude/worktrees/run-1".to_string()),
- vec!["src/lib.rs".to_string(), "README.md".to_string()],
- Some(true),
- );
- assert_eq!(
- d.worktree_path.as_deref(),
- Some("/repo/.claude/worktrees/run-1")
- );
- assert_eq!(
- d.changed_files,
- Some(vec!["src/lib.rs".to_string(), "README.md".to_string()])
- );
- assert_eq!(d.dirty_status, Some(true));
-}
-
// ── #4270 inference heartbeat ────────────────────────────────────────────
use crate::config::Config;