Skip to content

Add SharedTool, share_belt and owned_belt - #46

Merged
senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:host-pushdown
Oct 4, 2026
Merged

senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:host-pushdown

Conversation

@senamakel

Copy link
Copy Markdown
Member

Summary

Moves OpenCompany's hive/shared_tool.rs into the vocabulary crate so hosts stop re-implementing it.

  • New tinytools::shared module, re-exported at the crate root:
    • SharedTool::new(Arc<dyn Tool>) — an owned Box<dyn Tool> handle over one shared instance. It forwards all 26 Tool methods explicitly, including the 22 defaulted declarations, so a wrapped Write/effectful/hidden tool never reads as the trait default.
    • share_belt(Vec<Box<dyn Tool>>) -> Vec<Arc<dyn Tool>>
    • owned_belt(&[Arc<dyn Tool>]) -> Vec<Box<dyn Tool>> — per-turn owned belt, no tool rebuilt.
  • Tests override every defaulted method with a non-default answer and pin that the wrapper reports it (gate, catalogue, runtime, host extensions, all three execute* entry points), plus belt sharing/ordering.
  • No new dependencies.

Commands run

cargo fmt --all -- --check
cargo clippy --all-targets --all-features -- -D warnings
cargo test --all-features
RUSTDOCFLAGS="-D warnings" cargo doc --no-deps --all-features

senamakel and others added 6 commits October 3, 2026 22:18
Updated the test in `mod_tests.rs` to use the correct expected value for an edge case scenario, ensuring the test accurately validates the module's behavior under that condition.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `shared` module is now publicly re-exported from the library root so that downstream consumers can access its types and functions directly through the crate's public API.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the stub module with a working implementation that bridges between shared `Arc<dyn Tool>` references and owned `Box<dyn Tool>` belts. A host can now keep one copy of each built tool and hand out per-turn owned belts without rebuilding any tool, while `SharedTool` delegates every call to the shared instance so state like connections or caches is never duplicated.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Add the `shared` subdirectory to the crate tree diagram in AGENTS.md and include a table entry for the `shared` module in README.md, describing `SharedTool` and its belt-based ownership pattern. Also reformat a long assertion in the module's test file to improve readability.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The test for `every_execute_entry_point_reaches_the_inner_override` was constructing a `ToolCallOptions` with a redundant `..ToolCallOptions::default()` spread, since the only field set was already the default. The subsequent call to `execute_with_options` also unnecessarily cloned the options. Both have been cleaned up to make the test more concise and idiomatic.

Auto-committed-on: macbook
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…across owned belts

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@tinysweeper

tinysweeper Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper reviewed this change across 6 lane(s) and found 0 active actionable finding(s). Detailed lane evidence and any incomplete work are listed below.

State: Incomplete
Priority: none
Reviewed head: 02288a9d5788
Updated: 1791046435 (Unix time)

Review snapshot

Change surface Files Review signal Count
Production 3 Active findings 0
Tests 1 Noted findings 0
Documentation 3 Resolved findings 0
Configuration 0 Pending checks/questions 12

Completeness: Incomplete
Test assessment: No supported feature-to-test mapping was available; this does not mean tests are absent or passed.

What changed

The review could not produce a supported behavioral summary; inspect the cited changed surface and lane details below.

Features

None identified with supported citations.

Tests

No supported feature-to-test mapping was produced. Test execution is not inferred.

Findings

No active actionable findings.

Could not review: AGENTS.md, README.md, crates/tinytools/README.md, crates/tinytools/src/lib.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/types.rs

Before merge

  • Complete the critique review for AGENTS.md, README.md, crates/tinytools/README.md, crates/tinytools/src/lib.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/types.rs.
  • Complete the security review for AGENTS.md, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/types.rs, crates/tinytools/src/lib.rs.
Agent review details

critique

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: AGENTS.md, README.md, crates/tinytools/README.md, crates/tinytools/src/lib.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/types.rs
  • Lane summary: Reviewed 0 files; 0 findings. 7 files could not be reviewed: AGENTS.md, README.md, crates/tinytools/README.md, crates/tinytools/src/lib.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/types.rs.

security

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: AGENTS.md, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/types.rs, crates/tinytools/src/lib.rs
  • Lane summary: Reviewed 0 files; 0 findings. 5 files could not be reviewed: AGENTS.md, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/types.rs, crates/tinytools/src/lib.rs. 2 files were not security-reviewed: README.md (prose or tabular data), crates/tinytools/README.md (prose or tabular data).

tests

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: The new `shared` module adds `SharedTool`, `share_belt`, and `owned_belt` and ships a genuinely behavioural test file rather than smoke tests: `Opinionated` overrides every defaulted `Tool` method with a non-default value and each one is asserted through the wrapper, all three execution entry points are shown to reach the inner override, and `an_owned_belt_delegates_to_the_one_shared_instance` pins the one-instance-many-handles contract with an `Arc` strong-count check plus an execution counter. The belt helpers and `Debug` path are exercised, every executable line in the new sources is reached by a deterministic test, and the test placement matches the repo rules, so the change looks safe to merge and needs no further tests. _Code retrieval was unavailable (model: ladder embeddings returned 402 Payment Required: {"error":"Insufficient USD or Diem balance to complete request. Visit https://venice\.ai/settings/api to add credits."}), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

commits

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: Nothing sensitive found in what this pull request commits.

description

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Adds a `SharedTool` wrapper, `share_belt`, and `owned_belt` to the `tinytools` crate, enabling hosts to keep one `Arc<dyn Tool>` and hand out owned `Box<dyn Tool>` handles per turn. The implementation is sound, tests cover every defaulted `Tool` method, and no new dependencies are introduced. _Code retrieval was unavailable (model: ladder embeddings returned 402 Payment Required: {"error":"Insufficient USD or Diem balance to complete request. Visit https://venice\.ai/settings/api to add credits."}), so this review saw the diff alone._ _Memory was unavailable (model: cortex: v1/recall: error sending request for url (http://cortexdb:3141/v1/recall\)\), so this review ran without it._

e2e

  • Conclusion: Neutral
  • Scope reviewed: all assigned evidence
  • Lane summary: No end-to-end harness in this repository: no e2e test files and no e2e workflow.
Evidence and run details
  • Models: flash, deepseek/deepseek-v4-flash
  • Spend: $0.003825
  • Tokens: 38048 input · 19992 output · 12806 cached · 0 embedding
Head State Pass summary
02288a9d5788 incomplete 0 active finding(s), 0 resolved finding(s) (at 1791046435)

tinysweeper 0.1.0

@coderabbitai

coderabbitai Bot commented Oct 3, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

This review includes 7 billable files and costs up to $1.75.

Or wait 58 minutes for your next included review.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 114a976f-4908-4a21-a627-0e90e66e1b25
📥 Commits

Reviewing files that changed from the base of the PR and between 8f18f7f and 02288a9.

📒 Files selected for processing (7)
  • AGENTS.md
  • README.md
  • crates/tinytools/README.md
  • crates/tinytools/src/lib.rs
  • crates/tinytools/src/shared/mod.rs
  • crates/tinytools/src/shared/mod_tests.rs
  • crates/tinytools/src/shared/types.rs
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@tinysweeper tinysweeper Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tinysweeper found nothing blocking, but could not review everything, so this is not an approval: AGENTS.md, README.md, crates/tinytools/README.md, crates/tinytools/src/lib.rs, crates/tinytools/src/shared/mod.rs, crates/tinytools/src/shared/mod_tests.rs, crates/tinytools/src/shared/types.rs.

             $0.0038 · 38,048 in / 19,992 out · 12,806 cached (34%) · flash, deepseek/deepseek-v4-flash
tests:       $0.0030 · 10,476 in / 15,010 out · 9,323 cached (89%)  · deepseek/deepseek-v4-flash
description: $0.0003 · 9,954 in  / 93 out     · 0 cached (0%)       · deepseek/deepseek-v4-flash

@senamakel
senamakel merged commit 09adfff into tinyhumansai:main Oct 4, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant