Skip to content

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

chore: remove debug instrumentation from web chat and session host

Steven Enamakela8f476e22025
diff --git a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
index e040cd42be..6c2a9e6363 100644
--- a/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
+++ b/crates/openhuman-core/src/agent/session_host/runtime/accessors.rs
@@ -528,10 +528,6 @@ impl OpenHumanSessionHost {
));
}
- pub fn debug_drop_runtime_session_only(&mut self) {
- self.runtime_session = None;
- }
-
/// Clears the agent's conversation history.
pub fn clear_history(&mut self) {
// Runtime `Session` owns the only generic history and has no mutable
diff --git a/crates/openhuman-core/src/core/runtime/context_agent.rs b/crates/openhuman-core/src/core/runtime/context_agent.rs
index a9f51f4966..8ab6c016eb 100644
--- a/crates/openhuman-core/src/core/runtime/context_agent.rs
+++ b/crates/openhuman-core/src/core/runtime/context_agent.rs
@@ -80,10 +80,6 @@ impl CoreContext {
Arc::strong_count(self) > 1 || Arc::strong_count(&self.agent.state) > 1
}
- pub fn agent_state_arc(&self) -> &Arc<super::super::agent_scope::AgentScopedState> {
- &self.agent.state
- }
-
/// The state slots this context owns.
pub fn agent_state(&self) -> &super::super::agent_scope::AgentScopedState {
&self.agent.state
diff --git a/crates/openhuman-core/src/profiles/host.rs b/crates/openhuman-core/src/profiles/host.rs
index fd186b1a91..53ab2d87f8 100644
--- a/crates/openhuman-core/src/profiles/host.rs
+++ b/crates/openhuman-core/src/profiles/host.rs
@@ -579,7 +579,6 @@ impl ProfileHost {
/// or a turn still running on its context (a detached turn outlives the
/// request that started it).
fn in_use(slot: &Slot) -> bool {
- log::debug!("[profiles] DEBUGPIN state={} ctx={} agent_state={}", Arc::strong_count(&slot.state), Arc::strong_count(&slot.state.context), Arc::strong_count(slot.state.context.agent_state_arc()));
Arc::strong_count(&slot.state) > 1 || slot.state.context.tenant_in_use()
}
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge.rs b/crates/openhuman-core/src/web_chat/progress_bridge.rs
index 55273f0b3b..896b1345bd 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge.rs
@@ -1253,7 +1253,6 @@ pub(crate) fn spawn_progress_bridge(
// The response presenter waits only briefly for this signal before
// publishing an error. Trace export is best-effort I/O and must not
// hold up terminal delivery after the progress stream closed.
- log::debug!("[web_channel][bridge] DEBUGBRIDGE exited request_id={request_id}");
let _ = drained_tx.send(true);
if let Some(mut collector) = span_collector.take() {
collector.finish(unix_epoch_ms());
diff --git a/crates/openhuman-core/src/web_chat/run_task.rs b/crates/openhuman-core/src/web_chat/run_task.rs
index a80b82b2f7..915acf7b8c 100644
--- a/crates/openhuman-core/src/web_chat/run_task.rs
+++ b/crates/openhuman-core/src/web_chat/run_task.rs
@@ -152,7 +152,6 @@ pub(crate) async fn run_chat_task(
input: Some(message.to_string()),
output: None,
});
- let progress_probe = progress_tx.downgrade();
agent.set_on_progress(Some(progress_tx));
agent.set_run_queue(Some(run_queue));
agent.set_thread_id(Some(thread_id));
@@ -318,15 +317,7 @@ pub(crate) async fn run_chat_task(
.await;
}
- log::debug!("[web-channel] DEBUGSENDERS before-clear={}", progress_probe.strong_count());
agent.set_on_progress(None);
- log::debug!("[web-channel] DEBUGSENDERS after-clear={}", progress_probe.strong_count());
- if std::env::var("DEBUG_CLEAR").is_ok() {
- agent.debug_drop_runtime_session_only();
- log::debug!("[web-channel] DEBUGSENDERS after-drop-runtime-session={}", progress_probe.strong_count());
- agent.clear_history();
- log::debug!("[web-channel] DEBUGSENDERS after-clear-history={}", progress_probe.strong_count());
- }
// The caller publishes the terminal `chat_done`/`chat_error` as soon as
// this returns. Let the bridge forward everything the turn queued first,
@@ -407,14 +398,6 @@ pub(crate) async fn run_chat_task(
checkin_session_agent(thread_id, agent, current_fp).await;
}
}
- log::debug!("[web-channel] DEBUGSENDERS after-checkin={}", progress_probe.strong_count());
- {
- let probe = progress_probe.clone();
- tokio::spawn(async move {
- tokio::time::sleep(std::time::Duration::from_secs(5)).await;
- log::debug!("[web-channel] DEBUGSENDERS after-5s={}", probe.strong_count());
- });
- }
result
}
diff --git a/tests/saas_mode/support.rs b/tests/saas_mode/support.rs
index 0904a8a38f..79b17665d1 100644
--- a/tests/saas_mode/support.rs
+++ b/tests/saas_mode/support.rs
@@ -409,7 +409,6 @@ pub fn start_node_logging(
.env("HOME", d.tmp.path())
.env("USERPROFILE", d.tmp.path())
.env("RUST_LOG", rust_log)
- .env("DEBUG_CLEAR", "1")
.stdout(std::fs::File::create(&log).unwrap())
.stderr(Stdio::null());
for var in SCRUBBED_ENV {