Repository navigation
refactor(core): delete core/src/backend; hosted backend lives in openhuman-tinyhumans behind generic registries - #7963
Conversation
The host_internals module was no longer referenced anywhere in the crate, so it has been deleted to keep the embed crate free of dead code. Auto-committed-on: dragonfly
…erence modules Introduce a new openhuman-tinyhumans crate that provides channel, client, inference, integration, memory, and voice modules along with a registration entry point. This lays the groundwork for wiring tinyhumans capabilities into the broader openhuman system. Auto-committed-on: dragonfly
Extends the process-statics inventory with the id-keyed HookSlot tables the embedding host registers at startup, plus the cfg(test) per-thread override used to isolate slot registrations between tests. Each entry notes that these tables hold code rather than tenant data and cites the test that verifies it. Auto-committed-on: dragonfly
Introduce a slot registry in the runtime context so that context contributors can be registered and resolved by name. This lets callers compose context from independent sources without hard-coding their ordering. Auto-committed-on: dragonfly
The test registered the openhuman embedding factory but then built the provider under the openhuman name, so it no longer exercised the intended path. It now requests the cloud provider, matching the factory that was registered. Auto-committed-on: dragonfly
Reformat long signatures, call chains, and assertions to satisfy rustfmt, and move the test-only normalize_loaded_config re-export next to the other test-gated imports. No behaviour changes. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
Add a host internals module to the embed crate and register the openhuman-tinyhumans dependency it needs. This provides the internal host plumbing required by the embedding layer. Auto-committed-on: dragonfly
Adds endpoint resolution for the tinyhumans client along with dedicated error types, so callers can resolve service endpoints and handle failures with structured errors instead of ad hoc strings. Auto-committed-on: dragonfly
Introduce a backend client module and a classification helper for the tinyhumans client crate. These provide the transport and request categorisation needed by upcoming tinyhumans features. Auto-committed-on: dragonfly
Moved the backend client, classification, channel, and integrations HTTP logic into separate modules under the client directory. This keeps each concern isolated and makes the client surface easier to navigate without changing any behaviour. Auto-committed-on: dragonfly
Introduce an enricher that augments tinyhumans client responses with additional context before they are returned to callers. This lays the groundwork for richer client output without changing existing behaviour. Auto-committed-on: dragonfly
The backend client now detects when the underlying channel closes and surfaces a clear error instead of hanging or panicking. Tests were added to cover the disconnect path. Auto-committed-on: dragonfly
Record the new tinyinference-providers and urlencoding dependencies in Cargo.lock for the openhuman-tinyhumans crate. Auto-committed-on: dragonfly
The enricher tests were moved out of the client module into their own file so the test suite is easier to navigate and the client source stays focused on runtime behaviour. No test logic changed. Auto-committed-on: dragonfly
Reformatted import lists, chained method calls, and assertion arguments to match rustfmt output. No behaviour changes. Auto-committed-on: dragonfly
The client module was changed from crate-private to public so downstream crates can access it directly. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
The shared backend transport captures its attribution headers once, so a product-identity change during install left it holding stale headers. Add a reset_shared_transport helper and call it alongside the existing slot reset, and register all areas into the core's generic registries during prepare. Auto-committed-on: dragonfly
Introduce a resolved endpoints configuration schema so endpoint resolution results can be represented and validated in a structured form. Auto-committed-on: dragonfly
Introduce a model configuration operations layer and a search module, and wire them into the computer config and doctor config checks. Also add tinymemes jev support. Auto-committed-on: dragonfly
…/langfuse/environment.rs,crates Auto-committed-on: dragonfly
Introduce a new tinyhumans crate that registers host internals for the embedding runtime. The crate wires up registration logic and depends on openhuman-embed to expose host internals to tinyhumans consumers. Auto-committed-on: dragonfly
Move the HTTP server implementation into its own module to keep the RPC server code organized as it grows. No behaviour change. Auto-committed-on: dragonfly
Auto-committed-on: dragonfly
…bmodules Break the integrations client and file storage code into focused submodules for budget gating, pricing, requests, downloads, and the individual storage tools, and add tests alongside them. This keeps each concern isolated and makes the integration surface easier to extend. Auto-committed-on: dragonfly
…tered callback Progressive delivery now requires a registered channel callback and fails with the backend-unavailable prefix when none is present, instead of falling back to a managed transport that captured its own backend credential. The managed transport and its error mapping were removed since the callback owns transport refusals and retry budgets. Auto-committed-on: dragonfly
Add tests for the channel bus delivery path covering the edge cases that were previously unverified. Auto-committed-on: dragonfly
Adds tests for the cloud transcription and realtime voice modules so their behaviour is exercised directly. The new cases cover the request and response handling paths that previously had no test coverage. Auto-committed-on: dragonfly
Adds test coverage for the channel bus, exercising message routing and delivery behaviour to guard against regressions. Auto-committed-on: dragonfly
CloudSttProvider now reports the model it was built with through the configured_model accessor, so callers can inspect the resolved model after provider construction. A test covers the registered factory path, verifying that an explicit model is preserved and an empty one falls back to the default. Auto-committed-on: dragonfly
The CloudSttProvider no longer exposes configured_model, and the factory test now asserts the provider's name instead of the model it was built with. This removes a trait method that only existed to support that assertion. Auto-committed-on: dragonfly
The test duplicated coverage already provided by the model pass-through test and only asserted the provider name, so it was dropped to keep the suite focused. Auto-committed-on: dragonfly
Slug lookups for the default routing names now return the shared backend-unavailable sentinel instead of a generic missing-provider error, so an unregistered engine-supplied provider reads as an expected configuration state rather than a misconfigured slug. Auto-committed-on: dragonfly
Add a test asserting that the default routing slugs for STT and TTS report a backend-unavailable error when no hosted provider is registered, so these expected states stay filtered from Sentry, while a genuinely unknown slug keeps the misconfiguration wording. Auto-committed-on: dragonfly
Reworded comments and READMEs across the core and tinyhumans crates to describe hosted-backend wiring in terms of the host crate that registers the config enricher and callback slots, rather than an installed backend transport. The old phrasing no longer matched how the core resolves backend URLs and channel delivery, so the docs now point at `Config.resolved_endpoints` and the registered handlers. Auto-committed-on: dragonfly
Update the credentials README and api_key module docs to refer to BackendClient instead of BackendOAuthClient, matching the current type name. Also rewrap a comment line in observability_availability for formatting. Auto-committed-on: dragonfly
The media files roots were recorded after the registered tool sources were constructed, so a source that reads them while building could observe stale values. The block now runs ahead of every source, and its comment notes the ordering requirement. Auto-committed-on: dragonfly
Add a test asserting that a media source reading the security policy's files roots during assembly finds them already recorded, guarding the ordering between root registration and source construction. Auto-committed-on: dragonfly
Update the source registration test to pass the anchor through the ToolSourcePlacement::After variant, matching the current signature of register_tool_source_at. Auto-committed-on: dragonfly
The OTLP client now uses the shared runtime proxy client with timeouts again instead of a bare client, and the hook slot's first() reads entries() so ordering matches the documented contract. The media files roots registration was moved back ahead of the tool sources so sources that read them during construction see them, and the missing-provider check no longer defers to the engine. Auto-committed-on: dragonfly
Tests that register into or unregister from the core's process-global hook registries could race each other, since the core's cfg(test) thread-local registries are inactive when it is a dependency. A shared registry test lock is added and held by the affected sync and async tests. Auto-committed-on: dragonfly
…ookups The OTLP tracing client now goes through the shared runtime proxy client with timeouts instead of a bare reqwest client, so telemetry respects configured proxy settings. HookSlot::first now reads context-first entries to match its documented ordering, the media files roots registration moved ahead of tool sources so builders see it, and the missing TTS provider check now actually defers to the engine instead of being dead code. Auto-committed-on: dragonfly
The direct-mode proxy test now takes the shared env lock and clears the direct-base overrides for its duration, restoring them on drop. Those overrides steer the route destination, so another test's loopback mock could otherwise leak in and change whether a proxy applies. Auto-committed-on: dragonfly
Wrap the EnvVarGuard::set call for the reply_speech test seam across multiple lines to satisfy rustfmt line length limits. No behaviour change. Auto-committed-on: dragonfly
Reformat long expressions, closures, and import lists to satisfy rustfmt line-width rules. No behaviour changes. Auto-committed-on: dragonfly
Marked the embedding model's routed_to helper as test-only and removed the unused with_default_model builder from the managed backend, since neither is needed in production builds. Auto-committed-on: dragonfly
The single-arm match in create_stt_provider was replaced with the equivalent straight-line code, removing the redundant match without changing behaviour. Auto-committed-on: dragonfly
…voice paths Adds unit tests across the tinyhumans client enricher, managed embedding inference, runtime, and the live and realtime voice modules to lock in existing behaviour and catch regressions in these paths. Auto-committed-on: dragonfly
The transport field on Wiring is only read by tests, so it is now compiled only under cfg(test) instead of being marked dead code. The local binding in wiring is annotated to allow an unused variable in non-test builds, keeping production builds warning-free. Auto-committed-on: dragonfly
The missing-provider error now always reports the shared unavailable sentinel instead of deferring to the engine for non-empty slugs, so the reporter filters it correctly rather than surfacing a misconfigured slug. Auto-committed-on: dragonfly
The missing_provider_error helper had its condition hardcoded to false, so providers that defer to the engine were reported as unregistered instead of carrying the shared unavailable sentinel. The check now tests whether the slug is non-empty and defers to the engine. Auto-committed-on: dragonfly
The doc comment on the voice factory entry point now states that unregistered hosted slugs answer the BACKEND_UNAVAILABLE sentinel rather than erroring by name, and the test asserting the old error-by-name behaviour was removed to match. Auto-committed-on: dragonfly
Tiny Sweeper review
|
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Important Review skippedToo many files! This PR contains 388 files, which is 88 over the limit of 300. To get a review, reduce the PR to 300 files or fewer by splitting it into smaller PRs or changing its base branch. Usage-priced reviews support at most 300 files. ⚙️ Run configuration
⛔ Files ignored due to path filters: 2
📒 Files selected for processing: 388
You can disable this status message by setting the
Comment |
# Conflicts: # crates/openhuman-core/src/agent/tinyagents/host/run_context.rs # crates/openhuman-core/src/inference/provider/openhuman_backend_model.rs # docs/gitbooks/en/developing/embed/api-index.json # docs/gitbooks/en/developing/embed/builder-setters.md # llms-full.txt # package.json # scripts/ci/saas-ambient-baseline.json # scripts/ci/storage-bypass-baseline.json
Summary
crates/openhuman-core/src/backend/, about 3k lines. The core now has no hosted-backend transport, client, route strings,tinyhumans.aihostnames or hosted-shaped ports.crates/openhuman-tinyhumans:transport/port.rs) and the authenticated client (client/)inference/)voice/)integrations/)channels/)memory/)tools::sources, with placement anchorsvoice::factory::registryandvoice::live::registryinference::registrychannels::callback_slotmemory::engine_registryagent::artifacts::publisher_slotmodules::wallet_backendconfig::register_enricher), which fillsConfig.resolved_endpointsCoreBuilder::backend_transport,CoreContext::backend_transportand the embedbackend_transport/install_backend_transportAPI. Hosts get everything throughopenhuman_tinyhumans::install/register_hooks.scripts/ci/check-core-hosted-free.mjs, wired intopnpm rust:layout, with a self-test. It fails ifcrate::backend,tinyhumans.aior a hosted route literal reappears in core.Problem
The SDK already left the core in #6352–#6362 and #6705, but
core/src/backend/still gave about 45 core files a general "call the hosted backend" port. Those files usedBackendClient::authed_json,base_url,inference_base_url,attribution_headersandproduct_identity. On top of that, core carried hosted route strings and hosted policy, such as the managed-host API-key allowlist and envelope and 401 classification. That keeps the core TinyHumans-shaped rather than generic and pluggable.Solution
register::register_all, whichinstall()and the host boot (openhuman_rpc::host::{cli,desktop,tui}) call before any config is read.core::slots::HookSlots. Lookups check the ambientCoreContextextensions first, then the process table. Context entries shadow process entries. Under SaaS a lookup consults only the task's own scope, so the operator's defaults never leak into a tenant.Config.resolved_endpoints(#[serde(skip)]), filled by the TinyHumans enricher on every config load. Load-time migrations useconfig::enrichers::managed_hosts_for.SESSION_EXPIRED:,API_KEY_REJECTED:andBACKEND_UNAVAILABLE:sentinelsafter_searchandafter_delegate) and live-voice provider orderEgressDescriptor::control_plane)thread_id, reasoning wire, and usage/billing re-projectionBACKEND_UNAVAILABLE:.openhuman-tinyhumans. The core keeps tests for the empty-registry path and the generic behaviour.upstream/main(merge commit, no squash). Upstream's new hosted artifact publisher was ported totinyhumans/src/integrations/file_storage/behind the new genericpublisher_slot.Submission Checklist
HookSlot::first, the voice sentinel and catalogue order.pnpm test:coverage/pnpm test:rustlocally for this diff.docs/TEST-COVERAGE-MATRIX.md, for the paths that moved).## Related. N/A: this is a structural move with no feature-row change.Impact
openhuman_rpc::host, which registers the TinyHumans hooks first.RuntimeBuilder::backend_transport,install_backend_transport,installed_backend_transport, the embed transport re-exports andBuilderSummary::has_backend_transportare removed. Library hosts that want the hosted backend useopenhuman_tinyhumans::installorRuntimeBuilder. The docs and generated builder setters are updated.cloud,openhuman,backend) answerBACKEND_UNAVAILABLE:.*.tinyhumans.ai,*.openhuman.ai,openhuman), slightly wider than the old api/staging-api exact match.Related
memory::lifecycle::prefetch::tests::slow_engine_results_survive_the_manual_pre_turn_cutoffis timing-sensitive and flaked once in a full run. The file is unchanged from upstream.openhuman-embedattached_tools_survive_clones_and_session_resumealso fails on the merge-base.AI Authored PR Metadata (required for Codex/Linear PRs)
Linear Issue
Commit & Branch
backend-to-tinyhumans30c2fe009fValidation Run
pnpm --filter openhuman-app format:check: N/A, no frontend changespnpm typecheck: N/A, no frontend changesRUST_MIN_STACK=16777216 cargo test -p openhuman --lib: 9477 passed on the second run. The first run had one failure, the timing flake noted above.cargo test -p openhuman --lib --features voice voice::: 227 passed.cargo test -p openhuman-tinyhumans --all-features: 614 passed, three times in a row.cargo test -p openhuman-rpc: passed.scripts/test-rust-with-mock.sh --test json_rpc_e2e: 108 passed.media_generation_e2e: passed.cargo fmt --all --checkandpnpm rust:clippycargo check --workspace --all-targets,cargo check -p openhuman --no-default-features, and the app manifest checkpnpm rust:layout,check-feature-forwarding,check-process-statics,check-saas-ambient,check-core-hosted-freeandpnpm docs:checkcargo check --manifest-path crates/openhuman-app/Cargo.tomlValidation Blocked
command:N/Aerror:N/Aimpact:N/ABehavior Changes
Parity Contract
check-core-hosted-freehost::tests::boot_session_store_keeps_a_legacy_managed_config_managedDuplicate / Superseded PR Handling