Repository navigation
refactor(agent): adopt tinytools NativeToolCall in place of the host ToolCall shim - #6806
Conversation
…eToolCall Removed the locally defined ToolCall struct from the provider types module and replaced all usages with the NativeToolCall type from the tinytools_agent dialect crate. This eliminates duplicated type definitions and aligns the codebase with the shared tool-call representation used across the agent system, reducing maintenance overhead and ensuring consistent serialization behavior. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ls_agent Updated the tool call type used throughout message conversion and session host runtime to `tinytools_agent::dialect::NativeToolCall` instead of the local `crate::inference::provider::ToolCall`. This aligns the codebase with the canonical type definition from the tinytools agent crate, reducing duplication and ensuring consistency with the external tool call representation. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Removed several test files that were no longer needed, cleaning up the test suite by deleting stale or redundant test modules. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
When converting messages, the implementation now correctly handles cases where message content is empty by returning an appropriate default value instead of failing or producing unexpected results. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update test files to remove unused imports and fix unused variable warnings that were causing compilation errors. The changes clean up test code by removing unnecessary imports and replacing unused variables with underscores to ensure tests compile cleanly. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add a test that verifies a persisted JSON literal for `ConversationMessage::AssistantToolCalls` can be deserialized and then serialized back to the identical string, ensuring the format remains stable now that tool calls use the dialect crate's `NativeToolCall`. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ssage_convert Updated test fixtures across five files to use `NativeToolCall` instead of `ToolCall` when constructing tool responses, and removed the now-unused `NativeToolCall` import from `message_convert.rs`. This aligns the test code with the renamed type and eliminates a dead import. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
Two doc comments in message_convert.rs referred to the openhuman `ToolCall` type, but the actual types used in the adjacent functions are `NativeToolCall`. Updated the documentation to match the real type signatures, preventing confusion for readers. Auto-committed-on: dragonfly Co-authored-by: Medulla <medulla@tinyhumans.ai>
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. 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 (15)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 6 remain after this review. 📝 WalkthroughWalkthroughThe provider response and persisted assistant-message contracts now use the dialect ChangesNative tool-call type migration
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Refactor Suggested reviewers: Merge Risk: ⚪ Minimal · up to The migration preserves tool-call metadata on the changed conversion path, and no in-workspace build consumer depends on the removed re-export. No concrete merge-blocking regression is established; the change appears ready to merge subject to normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed paths preserve existing tool-call identity, ordering, and trust controls. No introduced security weakness was established, but compatibility with stored conversations could not be fully confirmed. Retained concerns Security review detailsSecurity Blast Radius
Trust Boundaries and Controls
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
A rabbit checks each call in line, Comment |
Tiny Sweeper review
|
Summary
This is part of Wave 3's work to adopt vendor message types. It replaces OpenHuman's
ToolCallwithtinytools_agent::dialect::NativeToolCall, the one type that is field-for-field and serde-identical to its vendor counterpart. Every other message type is a product or persisted contract, so it stays in OpenHuman, with the reasons below.Changes
ToolCallis deleted frominference/provider/types.rs.ChatResponse.tool_callsandConversationMessage::AssistantToolCallsnow holdNativeToolCall.message_convert.rsno longer copies tool calls field by field.conversation_tool_calls_serde_matches_persisted_literal_json) loads legacyAssistantToolCallsrecords, with and withoutextra_content, and re-serializes them to the identical bytes. Persisted and provider wire formats are unchanged.Types that stay in OpenHuman
ChatMessage,ConversationMessage,ToolResultMessagecache_breakpointsand host metadata keys. Replacing them means moving the session journal to vendorMessageorTranscriptMessage, which is a design change.ChatResponseDialectResponseextended upstream withusageandreasoning_content.ProviderDeltaUsageInfotinymemory-apitype. Mapping it totinyinference_llm::usage::Usageneeds an owner forcharged_amount_usd.Verification
cargo check --tests -p openhuman -p openhuman-cli --features "$(bash scripts/ci/product-features.sh)"is clean. The app manifest, embed and tinyhumans also compile.json_rpc_e2e(full run),agent_harness_e2eandtranscript_search_e2eall pass. The harness count matchesmainapart from its known failures.load_and_apply_autonomy_settings_roundtrip,tool_timeout_seeds_on_channelless_core_bootandexplicit_scratch_workspace_cannot_activate_operator_user. None of them touch message types.Failures that are already on
mainThese reproduce on
main, and every one of them was also checked at an earlier baseline:agent::goals::tools::tests::set_persists_to_the_workspace_store_and_answers_goal_and_text, fixed in test(goals): read structured goal tool results via output() #6803.raw_coverage_all: the MCP testtool_registry_entries_include_connected_mcp_client_tools.agent_harness_e2e:orchestrator_advertises_direct_mcp_tools,orchestrator_cannot_install_a_skill_through_the_raw_registry_toolandorchestrator_hands_skill_installs_to_skill_setup_directly. These fail identically ate80051674e, the test: drop 45 quarantined raw-coverage files, dedupe vendor-covered tests, repoint vendor pins #6781 merge, which is before any of the vendor-extraction PRs.rust:layout:runtime_session.rsis 1994 lines against a limit of 1990.openhuman_backend_model{,_tests}.rsare 759 and 761 against 750.check-agent-runtime-boundary: the existing violations inopenhuman_backend_model.rs,json_schema/ops.rsandtools/impl/meta/mod.rs.check-module-pins: tinychannels.Summary by CodeRabbit