Repository navigation
refactor(agent): move tool-result artifacts and the use_skill pack mechanism into tinyagents-harness - #6797
Conversation
Updates the vendored tinyagents dependency to the latest version to incorporate upstream bug fixes and improvements. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `UseSkillTool`, `PackRegistryHandle`, and `ToolPack` types, along with their rendering and resolution logic, have been moved from the local `toolpacks` module into the `tinyagents_harness` crate. The local `tools.rs` and `types.rs` files are deleted, and all call sites now import from `tinyagents_harness::tool::packs`. A new `CATALOG` constant in `registry.rs` wraps the static `PACKS` array into a `PackCatalog` that the generic `use_skill` tool uses for lookup, keeping the pack definitions local while delegating the tool infrastructure to the shared harness. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ts_harness::tool::packs::USE_SK Migrate all references to the `USE_SKILL` constant and related tool pack types from the internal `crate::tools::toolpacks` module to the external `tinyagents_harness::tool::packs` crate. This change aligns the codebase with the extracted harness library, ensuring that tool pack definitions and their associated types are sourced from the shared dependency rather than the local module. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The packed tool route middleware was incorrectly using the original tool name instead of the packed tool name when routing tool calls. This caused tool dispatch to fail for tools that had been packed, as the middleware could not match the incoming tool name to the registered packed tool identifier. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When a tool returns a result artifact referencing a file that does not exist on disk, the agent now gracefully handles the missing file instead of panicking. This change adds proper error handling in the tool result artifacts module and updates the session host builder and tool policy middleware to propagate the error correctly, ensuring robust behavior in production scenarios where file system state may not match tool outputs. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The tool result artifacts module and its associated wiring were no longer being used after the migration to the tinyagents middleware architecture. This change removes the dead code to reduce maintenance burden and improve code clarity. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…_harness Migrate the `USE_SKILL` constant, `route_sentence`, `scope_use_skill_spec`, and `render_pack_filtered` functions along with their associated tests from the core toolpacks crate into the `tinyagents_harness` crate. This centralizes test infrastructure for pack-related tooling and removes duplicate or dead test code from the core library, keeping the production codebase focused on runtime behavior rather than test scaffolding. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…e_llm Replace the inline list of business-limit markers and Z.AI codes in `is_non_retryable_rate_limit_text` with a call to `tinyinference_llm::failure::contains_business_limit`, which now owns the canonical detection logic. This removes duplication and ensures the web-chat layer stays in sync with the provider classification without maintaining a separate copy of the marker set. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reordered import statements in thirteen files to follow the project's convention of grouping third-party imports before local crate imports, with no functional changes to the code. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the vendored tinyagents dependency to incorporate upstream fixes and improvements. No changes to the project's own source code were required. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add README documentation for the agent harness and toolpacks modules to improve developer onboarding and clarify the purpose and usage of these components within the openhuman-core crate. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (35)
💤 Files with no reviewable changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughOpenHuman now delegates tool-result artifact storage and tool-pack behavior to TinyAgents, while retaining host-specific configuration and registry data. The rate-limit error check uses TinyInference’s shared business-limit detection helper. ChangesTinyAgents Harness Migration
Business-Limit Error Detection
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to This change moves tool-result artifact storage and tool-pack behavior into shared libraries while keeping OpenHuman's configuration and pack data. It also reuses the shared rate-limit detection. No concrete regression was identified, so the change appears ready to merge after normal checks. Security Architecture ReviewSecurity architecture risk: 🟡 Moderate · up to Existing permission checks and data-protection settings remain visible, and no new security issue was verified. However, equivalent protections during writes, interrupted operations, and cleanup have not been fully established. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
A rabbit checks the tool-pack trail Comment |
Pin tinyagents at the artifacts tip merged with main (oh-stack-6797). Co-authored-by: Medulla <medulla@tinyhumans.ai>
Summary
This Wave 2 PR moves the tool-result artifact store and the
use_skilltool-pack mechanism intotinyagents-harness. The net change is −1.85k lines (197 added, 2,049 deleted).Tool-result artifacts →
tinyagents_harness::artifacts::tool_results(tinyagents#239)ArtifactRedactor/Redactedrather than adding a second policy trait.ToolResultArtifactStore::new(action_dir, session, Arc<dyn ArtifactRedactor>, read_tool, max_readable_bytes). Thefile_read/use_skillnames are passed as parameters.SanitizingRedactor,FileReadTool::MAX_FILE_SIZE_BYTES, and theopenhuman_tool_result_artifactsnamespace.envelope_text_is_byte_stable). The OpenHuman index store is replaced by the crate'sInMemoryStore.artifact_offload/. What remains there is host-owned by design: theSecurityPolicyworkspace guard, thesanitize_textredactor, and the product prompt text.use_skillpack mechanism →tinyagents_harness::tool::packsToolPack,PackCatalog,PackRegistryHandle,UseSkillTool,render_pack_filtered,scope_use_skill_spec,route_sentence,NoSuchPackToolandUSE_SKILL.PackCatalog::new(&'static [ToolPack], not_found_marker).registry.rs,PACKS);ToolGroups, which is sized by the table and readsCoreContext;host_extensionsandToolPolicySession.CoreBuilder's API is unchanged.tinyagents_harness::tool::packsdirectly, because the boundary check bans re-exports.Web-chat error classifiers: not moved
openhuman_billing. The predicates are keyed on OpenHuman's own backend strings.is_non_retryable_rate_limit_text, was a byte-identical copy of tinyinference's privatecontains_business_limit. That function is now public (tinyinference#42), andretry.rsdelegates to it.Verification
cargo check --tests -p openhuman -p openhuman-cli --features "$(bash scripts/ci/product-features.sh)"is clean. The app manifest andopenhuman-embed/openhuman-tinyhumans --testsalso compile.sync_activityordering race (see refactor(core): move time/goals tools, conversation store and composio execute into vendor crates #6785).raw_coverage_all: 167 passed, 1 failed. The failure is the pre-existing MCPtool_registry_entries_include_connected_mcp_client_tools, which fails identically on the original base.artifacts::tool_resultshas 21 tests,tool::packshas 16, and tinyinferencefailurehas 14. fmt andclippy -D warningsare clean.rust:layout,check-agent-runtime-boundary,check-feature-forwarding,check-gated-test-allowlist, andcheck-submodule-monotonic upstream/main HEAD.Merge order
Merge tinyinference#42 first, then tinyagents#239 (both based on
main), then this PR after #6789.Summary by CodeRabbit
Bug Fixes
Improvements