Skip to content

feat(inference): complete provider and runtime ownership migration - #8198

Merged
senamakel merged 1049 commits into
tinyhumansai:mainfrom
senamakel:epic/8092-inference-out
Oct 22, 2026
Merged

senamakel merged 1049 commits into
tinyhumansai:mainfrom
senamakel:epic/8092-inference-out

Conversation

@senamakel

@senamakel senamakel commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Moves inference and provider machinery into the TinyInference, TinyAgents, and TinyJuice owners while retaining OpenHuman's product policy and host adapters. The final union removes the remaining host copies, adopts the released TinyJuice 0.11.2 host tools, and configures the TinyBus worker stack used by scheduled agent runs.

All required component changes are already merged upstream: TinyAgents #523, TinyInference #123, TinyJuice #114, and TinyBus #100. TinyJuice v0.11.2 is published with the release checksum and platform module assets. The OpenHuman gitlinks point to those canonical commits.

Closes #8092

Fork sub-issues included

All listed fork sub-issues are closed on the fork.

Rolled-up fork PRs

Validation

  • RUST_TEST_THREADS=1 pnpm debug rust inference --verbose -- --no-default-features --no-fail-fast
  • cargo test -p openhuman-embed --no-default-features --features "$(scripts/ci/product-features.sh --core)" --all-targets -- --test-threads=1 (286 unit tests and all integration/example targets passed)
  • cargo test -p openhuman inference::tokenjuice:: -- --test-threads=1 (37 passed)
  • cargo check -p openhuman
  • cargo clippy -p openhuman --all-targets -- -D warnings
  • cargo fmt --all -- --check
  • pnpm rust:layout
  • node scripts/ci/check-saas-ambient.mjs .
  • node scripts/ci/check-agent-runtime-boundary.mjs .
  • TinyAgents, TinyInference, TinyJuice, and TinyBus implementation PRs have merged. TinyAgents release ancestry reconciliation is tracked in tinyagents#528.

The local validation listed above passed on the prepared head. This draft points at tinyagents#528’s head and includes the refreshed lockfiles; after #528 merges and that commit is available from canonical TinyAgents, mark this PR ready to trigger fresh hosted CI. The checks shown from the previous PR head are stale. Merge only after every required check passes and changed-line coverage is at least 80%.

senamakel and others added 30 commits October 21, 2026 18:29
Update the error-copy fixture tests to call the shared tinyagents_hooks
halt-summary and failure-kind helpers instead of the local middleware
wrappers, so the fixtures exercise the same code path the runtime uses.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The `TerminalInferenceFailureKind` alias was no longer referenced, so the import now brings in only the `stop` module.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformat the halt summary calls in the repeated failure middleware and update a doc comment to point at the current module path. No behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Register a new copy module and re-export its OpenHumanCopyProvider so the host can expose copy functionality to tinyagents.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The OpenHumanCopyProvider now lives in the tinyagents host module instead of
the repeated_failure middleware, so callers in stop_summary and the failure
policy reference the shared host location. The halt summaries now carry their
classified stop cause directly, letting the policy reuse the class string
rather than re-deriving it from the failure kind.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Replace the budget truncation assertion with provider_config cases that
check a multi-byte string exactly at the 600-character limit is kept
intact and one character over is truncated. This exercises the
character-based boundary rather than a byte-oriented one.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reordered use statements and reflowed a match arm in the repeated failure middleware to satisfy rustfmt, with no behaviour change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a missing blank line in the failure_copy module documentation so the
bullet list and the following summary paragraph render as separate blocks.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…der is registered

The managed embedding factory now accepts an optional config and returns an
UnavailableEmbeddingModel carrying the backend-unavailable prefix when no
hosted provider is registered, so callers surface a clear reason instead of a
bare failure. The settings, factory, and credential resolver helpers were also
widened to pub(super) so sibling modules can reuse them.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…erence

The unavailable managed embedder placeholder and the host-side effective
embedder slug resolution are now provided by tinyinference, so the local
copies were removed and callers switched to the shared helpers. The
factory now builds its managed factory through a single helper instead of
duplicating the registration lookup.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…rence

Custom endpoint verification in the settings and test-connection RPCs now
routes through TinyInference's shared verify helpers instead of the local
probe, served-model lookup, and rejection classification. The dimension
auto-detection and rejection outcomes are preserved, but the duplicated
policy code is gone.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The probe classification and model-resolution tests were dropped from the
embedding host RPC test module, along with the now-unused import of
final_probe_dims. The conformant-endpoint regression test keeps its coverage
by asserting directly on the returned vector length instead of routing the
result through classify_embed_probe.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Dropped the test-gated imports for the embedding probe and served-model helpers since they are no longer referenced in this module.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Dropped redundant imports of UnavailableEmbeddingModel and redact_secrets that were no longer referenced, and simplified an embedding provider argument to pass the string slice directly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Refresh the embedding host and egress READMEs to match the current
managed-provider wiring, replacing references to the removed cloud adapter
with the factory closure and TinyInference's unavailable placeholder. Also
reword a config loader comment to describe the managed embedding factory
rather than the keyless cloud embedder.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…r resolution

Add tests asserting that a failed custom embedding verification surfaces the
suggested model while leaving the persisted provider and dimensions untouched,
and that settings reports the effective provider for each native resolution
path. The connection test now returns the vector dimensions directly instead
of the full vectors, since only the dimension count was used.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the embedding host test comment to describe the assertion it actually makes, and drop the removed cloud_adapter module from the credentials README's list of consumers.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformatted the embedding host module with rustfmt, wrapping long
function signatures and assertions and reordering imports. The README
table now merges the two factory.rs rows into one.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The provider tag for a custom endpoint is now built once into an owned
string and passed by reference, replacing the inline conditional that
formatted and unwrapped the endpoint in a single expression. This removes
the redundant unwrap_or_default call and makes the selection logic easier
to follow.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The connection test now uses the detailed verification API so that
provider construction failures are returned directly instead of being
flattened into a generic embedding error. This keeps the original
build error message intact for callers.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…ction

Add a test asserting that an unknown embedding provider passed to
test_connection surfaces as an RPC error rather than a panic, guarding the
config-aware factory path against regressions.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The connection test previously returned early when the embedding client
failed to build, bypassing the shared result handling. It now maps the
build error into the same result path as invocation errors so callers
receive a consistent failure payload.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The build error arm now returns directly instead of falling through to the
shared result handling, so construction failures no longer get collapsed into
the same payload as invocation errors.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…tests

The two settings tests now build the expected signature string literally
instead of calling format_embedding_signature, removing the dependency on
the helper under test.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…load

Adds a test asserting that a provider whose embedding endpoint returns an
error surfaces the failure in the connection test outcome rather than as an
RPC error, and tidies the import ordering in the embed RPC module.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinyagents submodule to the latest commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
refactor(embedding): adopt native TinyInference verification
…service

Status snapshots now come from the service with the configured provider
applied, and readiness is handled by ensure_ready instead of an inline
state check. Raw audio transcription passes bytes straight to the service
rather than round-tripping through a temporary file.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
senamakel and others added 18 commits October 22, 2026 13:28
Register the tinystoragedrivers-types crate as a workspace dependency and
advance the vendored tinystoragedrivers submodule to a revision that
provides it.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Adds a case asserting that the standalone storage types contract is accepted when it comes from a pinned git revision, so the metadata check does not flag a legitimate git-sourced dependency as a violation.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The storage-owner check treated every tinystoragedrivers* package as a
storage backend owner, but tinystoragedrivers-types is a data-only
contract crate that may legitimately resolve to a pinned git dependency
when a vendored driver checkout predates it. The owner predicate now
excludes that crate, the root workspace drops its path override, and the
vendored submodule is bumped to the matching commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Update the vendored tinybus submodule to the latest upstream commit.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Tighten the temporary HOME directories used by the agent harness and
SaaS mode tests to mode 0700 on Unix so they match the private
permissions the code under test expects.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The bearer verification test now sets its temporary directory to mode 0700 on
unix so the keyring fixture cannot be read by other users during the run.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Drop the TokenjuiceRetrieveTool compatibility shim and the
LEGACY_RETRIEVE_TOOL_NAME constant, since execution and declaration of the
retrieve tool are now owned by TinyJuice's host crate.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The tokenjuice retrieve tool is now constructed from the host crate with a
callback that delegates to the core retrieve function, so the registered tool
matches the host's expected interface.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The recovery tool name constant now comes from tinyjuice_bus instead of a
local re-export, and the visibility test pins the tinyjuice-host retrieve
tool directly so the model-facing name and schema contract stays covered
across the ownership move. The README was updated to describe the host
callback construction and the alias set without the removed constant.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Reformat the RetrieveToolOutputTool construction in the tokenjuice
registry and its test to satisfy rustfmt line wrapping. No behaviour
changes.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Move the host-specific query bridge and tool construction into the
tokenjuice module so the shared REPL tools can be built from a local
QuerySource implementation. The nested repl_tools path is kept as a
re-export to preserve the existing integration prelude.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The host-specific REPL tool adapter was consolidated into the tokenjuice
module, removing the now-redundant repl_tools.rs whose contents had been
folded into mod.rs. A test-only helper and test module were added to keep
the existing coverage working against the merged implementation.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Clarify that OpenHuman depends on the tinyjuice-bus contracts and tinyjuice-host tool adapters, and that this directory also owns dispatch context. The previous wording described the integration in terms of vocabulary and declarations, which no longer matches how the module is consumed.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The prelude integrations module referenced repl_tools_for_recorded through a
repl_tools submodule that no longer exists, so the call now points at the
function's actual location in the tokenjuice module.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
The README now points at the `mod.rs::repl_tools_for*` functions instead of the removed `repl_tools` module, and the accompanying re-export shim in `mod.rs` was dropped since the adapter functions are already reachable directly.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
…e line

Reformatted the rebuilt.extend call in the turn prelude so the
repl_tools_for_recorded invocation sits on a single line. No behaviour
change.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
ModuleSource now implements tinyjuice_host::repl_tools::QuerySource directly, converting the tool run context into a dispatch context inside its query method. The local QuerySource trait and QueryBridge adapter are removed since they only duplicated the host trait, and the test source is updated to the same signature.

Auto-committed-on: cuttlefish
Co-authored-by: Medulla <medulla@tinyhumans.ai>
refactor(inference): finish TinyJuice host adoption
@senamakel
senamakel marked this pull request as ready for review October 22, 2026 14:57
@tinysweeper

tinysweeper Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

⚠️ Review of c54649a98029 could not complete.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-22T16:12:47.214683Z
We couldn’t complete this review. Comment @codex review to try again.
80fe229 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@senamakel
senamakel marked this pull request as draft October 22, 2026 15:22
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel marked this pull request as ready for review October 22, 2026 16:06
senamakel and others added 3 commits October 22, 2026 16:17
# Conflicts:
#	crates/openhuman-core/src/config/schema/ephemeral_route.rs
#	crates/openhuman-core/src/inference/host_runtime/schemas.rs
#	crates/openhuman-core/src/inference/provider/factory/cloud_slug.rs
#	crates/openhuman-core/src/inference/provider/factory/cloud_spec.rs
#	crates/openhuman-core/src/inference/provider/factory/cloud_spec_tests.rs
#	crates/openhuman-core/src/inference/provider/factory/discovery.rs
#	crates/openhuman-core/src/inference/reasoning.rs
Co-authored-by: Medulla <medulla@tinyhumans.ai>
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 84d6cda into tinyhumansai:main Oct 22, 2026
18 of 21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Epic: move inference/ out of the host into tinyinference, tinyagents and tinyjuice

1 participant