Repository navigation
refactor(agent): move generic harness middleware and the embedding tool ranker into tinyagents-harness - #6791
Merged
senamakel merged 16 commits intoSep 30, 2026
Conversation
Updated the pinned commit for the tinyagents vendored dependency to incorporate upstream changes. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Updated the vendored tinyagents dependency to incorporate upstream fixes and improvements. This change ensures compatibility with the latest API changes and resolves potential runtime issues. 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>
Updated the tinyagents vendor dependency to the latest version to incorporate upstream bug fixes and improvements. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Renamed the module directory and all internal references from the misspelled "tinyagents" to the correct "tiny_agents" across the codebase, updating imports and test file paths to match. This fixes a naming inconsistency that could cause build failures and confusion for developers. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The credential scrubbing middleware and its associated test file have been removed from the tinyagents module. This change eliminates functionality that was no longer needed, simplifying the middleware pipeline. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Re-add the harness_assembly and harness_context_ladder modules that were inadvertently removed, restoring the agent's ability to assemble harness components and manage context escalation during execution. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When a middleware is not found in the tinyagents configuration, the agent now returns an appropriate error instead of panicking or silently failing. This ensures graceful degradation and clearer diagnostics for misconfigured agent pipelines. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
… repeat-progress and wrap-up te Move the memory protocol and embedder hook tests from the deleted `middleware_wrap_up_toc_tests.rs` into a new dedicated file, and remove the repeat-progress and wrap-up tests that are no longer relevant after the corresponding middleware was removed. The consolidation keeps related test coverage together while cleaning up dead test modules. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The embedding ranker was incorrectly using dot product for similarity scoring instead of cosine similarity, which caused inconsistent ranking results when vectors had different magnitudes. The implementation now normalizes vectors and computes cosine similarity, aligning with the expected behavior for embedding-based relevance scoring. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace direct instantiation of `EmbeddingToolRanker` with the new free functions `embedding_provider_is_usable` and `embedding_tool_ranker` across the codebase. This change decouples callers from the concrete struct, making the API more flexible and allowing the internal implementation to evolve without affecting consumers. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Added a README file to document the tinyagents module within the openhuman-core agent crate, providing usage guidance and context for developers working with this component. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Remove imports of `ContentBlock`, `ModelResponse`, and no-progress constants that are no longer used in the test file, cleaning up compiler warnings and reducing unnecessary dependencies. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
The lock file was updated to include the newly required tinyinference-core crate, ensuring that dependency resolution remains consistent across builds. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Contributor
|
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 ignored due to path filters (2)
📒 Files selected for processing (25)
Comment |
Tiny Sweeper review
|
Pin tinyagents at the middleware tip merged with main (oh-stack-6791). Co-authored-by: Medulla <medulla@tinyhumans.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Wave 2: moves the generic agent-loop middleware and the embedding tool ranker into
tinyagents-harness. Net change is −3.1k lines (278 added, 3,410 deleted).Middleware →
tinyagents-harness::middleware::library(tinyagents#234, stacked on #230)Six middlewares move upstream. Each is generic over the run-context type, because none of them read
OpenHumanRunContext. OpenHuman passes its product values in through seams, listed per middleware:message_trim→ImageAwareMessageTrimMiddleware(+estimate_*_tokens,IMAGE_MARKER_TOKEN_COST)with_cleared_placeholder(CLEARED_PLACEHOLDER); the upstream default text is identicalartifact_index_toc→ArtifactIndexTocMiddleware::new(budget, store).with_namespace(..)final_call_wrap_up→wrap_upCapturedOutcomestrait (a small newtype over the existing outcome sink) andwith_deliverable_tools(["file_write","apply_patch"])repeat_progressRepeatExemptionclosure →is_repeat_call_exemptarg_recoverycredential_scrub→CredentialScrubMiddlewareToolScrubberclosure; the browser confirmation-token exemption stays in a slim hostcredential_scrub.rsHaltSummarySlotis now defined upstream with the same type.Stayed in OpenHuman:
prompt_cache.rsreads and mutatesctx.data.cacheable_system_prefix_lenand readstool_dialect. That overlaps the loop's ownfrozen_system_prefix_len, so unifying them needs a real redesign, not a seam.loop_guards.rsholds product copy in its halt summaries, thewait_subagentname, and backend/provider classifiers. Onlyis_repeat_call_exemptis exposed, for the seam above.Middleware ordering and registration in
harness_assemblyare unchanged.Embedding tool ranker →
tinyagents-harness::tool::discover::EmbeddingToolRankerArc<dyn EmbeddingModel>instead of the OpenHuman provider type.embedding_tool_ranker(provider), a deliberately cost-free adapter matching today's behaviour, andembedding_provider_is_usable.tool_search_bench.rsandjev/ranker.rsare updated to use the helpers.embedding failed: embedding error: …instead ofembedding failed: ….Verification
cargo check --tests -p openhuman -p openhuman-cli --features "$(bash scripts/ci/product-features.sh)"is clean. The app manifest,openhuman-embedandopenhuman-tinyhumanscompile with--tests.tinyagents-harness: 1496 lib tests pass, plus 43 others. The moved tests now live inlibrary/*_test.rsandembedding_ranker_test.rs, with new tests for trim, arg recovery, middleware-level scrubbing, and disk-cache signature mismatch. fmt andclippy -D warningsare clean.pnpm rust:layoutcheck-agent-runtime-boundarycheck-feature-forwardingcheck-gated-test-allowlistcheck-submodule-monotonic upstream/main HEAD, with 9 pins forwardcheck-module-pinsfails only on tinywallet and tinychannels. Both come from test: drop 45 quarantined raw-coverage files, dedupe vendor-covered tests, repoint vendor pins #6781.Merge order
Merge tinyagents#228 → #229 → #230 → #234, then this PR after #6789.