Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions crates/openhuman-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ tinyinference-voice = { path = "../../vendor/tinyagents/vendor/tinyinference/cra
# No `[patch.crates-io]` entry: the crate is not published, so the path is the
# whole address — the same arrangement as `tinyhumans-sdk` and the `-bus`
# crates. After cloning: `git submodule update --init --recursive vendor/`.
tinytools-jev = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools-jev" }
tinytools = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools" }
tinytools-agent = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools-agent" }
tinytools-std = { path = "../../vendor/tinyagents/vendor/tinytools/crates/tinytools-std" }
Expand Down
10 changes: 9 additions & 1 deletion crates/openhuman-core/src/agent/tinyagents/harness_assembly.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ pub(super) fn assemble_turn_harness(
}

// Capture context settings before `install` consumes `context_mw`.
let recovery_config = context_mw.runtime_config.clone();
let autocompact_enabled = context_mw.autocompact_enabled;
let compaction = context_mw.compaction;
// Captured for the same reason `autocompact_enabled` is — `install` consumes
Expand Down Expand Up @@ -313,7 +314,10 @@ pub(super) fn assemble_turn_harness(
// Repeated failures stop the run using each tool's declared side effects.
let repeated_failure = handle.as_ref().map(|handle| {
let (t, halt) = (REPEATED_TOOL_FAILURE_THRESHOLD, halt_summary.clone());
let mw = middleware::RepeatedToolFailureMiddleware::new(handle.clone(), t, halt);
let mut mw = middleware::RepeatedToolFailureMiddleware::new(handle.clone(), t, halt);
if let Some(config) = &recovery_config {
mw = mw.with_recovery(config);
}
Arc::new(mw.with_tool_facts(middleware::tool_sets_lookup(tool_sets.clone())))
});
if let Some(mw) = &repeated_failure {
Expand Down Expand Up @@ -350,6 +354,10 @@ pub(super) fn assemble_turn_harness(
&session_deferred,
);

if let Some(mw) = &repeated_failure {
mw.set_recovery_registry(harness.tools(), tool_policy.as_ref().map(|p| &p.session));
}

// SHADOW tool-exposure layer (issue #4249, 01.3 — dynamic exposure). Compose
// the OpenHuman exposure policy as a crate-native selection layer
// (ToolAllowlistMiddleware + a ContextualToolSelectionMiddleware built via
Expand Down
2 changes: 2 additions & 0 deletions crates/openhuman-core/src/agent/tinyagents/middleware.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ mod loop_guards;
mod memory_pack;
mod nudge_injector;
mod packed_tool_route;
mod recovery_advice;
mod recovery_telemetry;
mod repeated_failure;
mod research_budget;
mod shell_turn_budget;
Expand Down
Loading
Loading