Skip to content

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

refactor(web_chat): simplify progress bridge event handling

Steven Enamakel52b07f193a41
diff --git a/crates/openhuman-core/src/web_chat/progress_bridge.rs b/crates/openhuman-core/src/web_chat/progress_bridge.rs
index 6847d9c956..4fbdf78a2f 100644
--- a/crates/openhuman-core/src/web_chat/progress_bridge.rs
+++ b/crates/openhuman-core/src/web_chat/progress_bridge.rs
@@ -165,13 +165,13 @@ mod wire_caps;
use wire_caps::MAX_WIRE_SUBAGENT_OUTPUT;
use wire_caps::{cap_wire_args, cap_wire_output};
+use crate::agent::session_store::ledger_sync;
+
pub(super) fn ledger_upsert_agent_run(
config: &crate::config::Config,
upsert: tinyagents_session::run_ledger::AgentRunUpsert,
) {
- if let Err(err) =
- crate::agent::session_store::ledger_sync::upsert_agent_run(&config.workspace_dir, upsert)
- {
+ if let Err(err) = ledger_sync::upsert_agent_run(&config.workspace_dir, upsert) {
log::warn!("[run_ledger][web_channel] failed to upsert run: {err}");
}
}
@@ -180,9 +180,7 @@ pub(super) fn ledger_append_event(
config: &crate::config::Config,
event: tinyagents_session::run_ledger::RunEventAppend,
) {
- if let Err(err) =
- crate::agent::session_store::ledger_sync::append_run_event(&config.workspace_dir, event)
- {
+ if let Err(err) = ledger_sync::append_run_event(&config.workspace_dir, event) {
log::warn!("[run_ledger][web_channel] failed to append event: {err}");
}
}
@@ -191,10 +189,7 @@ pub(super) fn ledger_upsert_telemetry(
config: &crate::config::Config,
telemetry: tinyagents_session::run_ledger::RunTelemetryUpsert,
) {
- if let Err(err) = crate::agent::session_store::ledger_sync::upsert_run_telemetry(
- &config.workspace_dir,
- telemetry,
- ) {
+ if let Err(err) = ledger_sync::upsert_run_telemetry(&config.workspace_dir, telemetry) {
log::warn!("[run_ledger][web_channel] failed to upsert telemetry: {err}");
}
}
@@ -203,7 +198,7 @@ pub(super) fn ledger_get_telemetry(
config: &crate::config::Config,
run_id: &str,
) -> Option<tinyagents_session::run_ledger::RunTelemetry> {
- match crate::agent::session_store::ledger_sync::get_agent_run(&config.workspace_dir, run_id) {
+ match ledger_sync::get_agent_run(&config.workspace_dir, run_id) {
Ok(Some(run)) => {
let telemetry = run.telemetry;
log::debug!(