feat: kernelize openhuman — cut the workflow dependency floor 418→280 and invert the composio back-edge - #5314
Merged
Merged
Conversation
…uman::json_schema
The agent runner now borrows the shared config directly when no node-level model override is present, only cloning when an override actually needs to be applied. This eliminates an unnecessary full config clone on the common path. Tests were updated to cover timeout clamping and scaling behavior, and the harness ceiling test now exercises the production semaphore directly.
Add unit tests covering JSON schema operations and the code, HTTP, and prompt capability helpers. These tests verify harness generation, credential resolution, and structured JSON extraction behavior, ensuring the utilities work correctly and fail safely on malformed input.
Concurrent callers requesting the same toolkit catalog now coordinate through a per-key in-flight lock, so only one network fetch happens and the others reuse its result after re-checking the cache. This prevents stampede requests to the Composio backend when the cache is cold or expired. Also fixes minor test string escaping inconsistencies in the tinyflows caps modules.
Reformatted several long lines and multi-line expressions to conform to the project's rustfmt style, improving readability without changing any behavior.
Extract the per-toolkit in-flight lock acquisition into a dedicated helper function and add a unit test verifying that locks are shared per toolkit but distinct across toolkits. This simplifies the fetch path and makes the locking behavior explicit and testable.
The capability adapters now import and use the actual OpenHuman implementations instead of relying on re-exports through the module tree. This includes connecting HTTP, LLM, code, and prompt adapters to their respective providers, credential stores, and security policies, while also making the ops module publicly accessible for external use.
The functions `is_curated_flow_tool`, `resolve_composio_account`, `reject_unsuccessful_composio_response`, `reject_failed_native_tool_result`, and `native_tool_payload` are now `pub(crate)` so they can be reused by other modules within the crate. The memory adapter reference is also updated to use a fully qualified path for consistency.
The change removes several imports that were no longer used in the caps operations module, cleaning up dead code and reducing unnecessary dependencies. This is a routine cleanup with no behavioural impact.
Switched the capabilities import to a wildcard form to simplify the module's dependency surface and reduce maintenance overhead when new capability types are added.
Reformatted import statements in the LLM, ops, and prompt capability modules to match the project's rustfmt configuration, adjusting line wrapping and import ordering without any behavioral changes.
Battery state-of-charge values that are not finite (such as NaN or infinity) could previously skew the average charge calculation. The probe now skips such readings, ensuring the reported charge remains a valid clamped percentage.
Extract the finite-check and accumulation of battery charge readings into a dedicated helper function so the sampling loop stays readable and the behaviour can be unit-tested. Add a test confirming that non-finite readings are ignored while valid ones are accumulated.
Clean up unused imports in test modules across config, agent harness, flows, and tinyflows caps to keep the codebase tidy and avoid compiler warnings.
…dules Reformatted the battery charge sample call to a single line and merged the test-only import of ProbedOutputSample into the main catalog import block, reducing redundancy without changing behavior.
The mcp_server::resources tests now run in their own cargo test invocation with the mcp feature enabled, while the main test run excludes them and corrects the tools::ops_tests path to tools::ops::tests. This ensures resource tests are properly gated behind the mcp feature rather than being skipped or failing in the tokenjuice-treesitter-only profile.
The flow discovery, workflow builder, flow memory, skill setup, and skill executor prompt resources are now conditionally compiled with the `flows` and `skills` feature flags respectively. This prevents these agents from being exposed in the resource catalog when their corresponding features are disabled, keeping the catalog consistent with the available functionality.
The `Arc` import is now conditionally compiled only when both the crash-reporting and http-server features are enabled, matching its usage in the test code and preventing unused import warnings in other configurations.
Restrict imports that are used solely by the test module to test builds, reducing the production dependency surface and avoiding unused-import warnings in non-test compilation.
Reordered the import statements in the capabilities operations module so that the non-test import of HttpCredentialsStore appears before the test-only imports, improving code organization and readability.
There was a problem hiding this comment.
senamakel has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6fde15e05e
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The kernel floor check now tracks the total package count in addition to unique crate names and native builds, with the limits file updated to include this new metric. This catches duplicate crate versions that inflate the dependency graph without increasing the unique name count, and the ratchet logic now enforces that improvements to the package count are also locked in.
There was a problem hiding this comment.
senamakel has reached the 50-credit limit for trial accounts. To continue receiving code reviews, upgrade your plan.
12 tasks
Closed
7 tasks
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
tinyflows/caps.rsinto 11 focused modules and inverts thecomposio→tinyflowsback-edge, so the always-compiled Composio domain no longer reaches into a feature-gated adapter seam.scripts/kernel-floor.sh,check-kernel-floor.sh,dep-sim.py,assert-shed.sh) so the floor cannot silently regress.prediction-markets(Polymarket) and moves the EVM stack intoweb3; gatestinychannels' email/lark providers via the companion PR.AGENTS.mdclaims that were blocking this work, and addslicense = "GPL-3.0-only"(the crate had none).flows-off builds, where it previously degraded to a silent no-op.Problem
openhumanis intended to be embeddable, but--no-default-features --features flowsstill resolved 418 crates. Six features shed zero dependencies (media,meet,skills,mcp,medulla,channels), Composio had no feature at all despite 36k LOC, and seven heavy dependencies were unconditional — includingarboard/enigo(an X11 clipboard and synthetic-input stack) in a build that only wants workflow execution.Two
AGENTS.mdparagraphs marked "do NOT re-litigate" asserted thatweb3could not dropethers-*and thatchannelssheds zero crates. Both were true as written, and between them they were concealing 95 of the 138 crates this PR removes.Separately,
composio/{contract_gate,action_tool}.rsimported fromtinyflows::caps— an always-on domain depending on a gated seam, which made the seam ungatable at all.Solution
Measurement first.
dep-sim.pyprojects a cohort's effect from the real graph. Per-dependency arithmetic is wrong: individual cuts here sum to −44 where the cohort is −53, because cutting siblings makes shared crates exclusive. Two defects in this tooling were found and fixed while using it — it modelled removing a crate globally rather than severing this crate's edge (inflating one cohort from a real −4 to a claimed −17), and the ratchet's slack was loose enough that five of eight sheds could have regressed unnoticed.Gate ownership, not gate size. The two big wins came from re-homing crates rather than gating harder:
web3(−67): Polymarket consumed the wallet's EVM stack from outside the wallet domains, soweb3could never reach it. A newprediction-marketsfeature that impliesweb3makes the cohort droppable.channels(−28):tinychannelsgenuinely cannot be gated out —DomainEventembeds its envelope, config andsecurity::pairingre-export its types. But the heavy crates belong to two of its providers. Gating those upstream sheds 28 with zero stubbing, avoiding stubs forconstant_time_eq/hash_tokenand a persisted session-key derivation.Back-edge inversion. 627 lines (the live catalog, probe, and their caches) moved from the seam into
composio/catalog.rs, plus a new vendor-neutralopenhuman::json_schemaowned by neither side — without it the inversion is impossible, since both sides need the schema walkers.grep -rn "tinyflows" src/openhuman/composio/is now zero.Submission Checklist
polymarket_controller_presence_follows_its_gate), 5ToolBackendseam tests including one that fails if a backend is registered after the catch-allN/A: not measured locally.diff-coverwas not run manually; the change is overwhelmingly manifest/#[cfg]/module-move with no new logic. This is independently and authoritatively enforced by theRust Core Coverage/Rust Tauri Coverage/ coverage-gate jobs inci-lite.yml, which run against this exact head.N/A: no feature rows added or removed(compile-time gating of existing behaviour); theCoverage Matrix SyncCI lane independently verifies this and passes.## RelatedN/A: no release-cut surface changed; every gate is default-ON and forwarded to the shell, so the packaged app is byte-equivalent in surfaceN/A: no tracking issueImpact
Desktop app: no functional change. Every new gate is default-ON and forwarded to
app/src-tauri/Cargo.toml;check-feature-forwarding.mjspasses with all 14 forwarded.bin-toolsis default-OFF and affects onlysrc/bin/targets.Slim/kernel builds lose, by design: file logging and the
log→tracingbridge (file-logging), the battery/AC probe sorequire_ac_poweris unenforced (scheduler-gate), the Polymarket tools (prediction-markets), and the email/Lark channel providers (channels). Each is documented at its definition, because several degrade silently rather than erroring.One behaviour improvement: the Composio contract gate previously carried
#[cfg(feature = "flows")]only because the catalog lived behindflows. With the catalog incomposio, all 8 gates came out and the gate now functions inflows-off builds.Security-sensitive ordering preserved: the tier gate still runs before the curation check in the new
ComposioToolBackend, so a read-only tier cannot distinguish "not curated" from "curated but denied" and thereby probe the user's configured scope. Documented at the site.Validation
--features flows)--features tokenjuice-treesitter)No failure in either gated profile touches code this PR restructured — zero matching
tinyflows|composio|json_schema|caps, against 884 passing tests in those areas. The 13 are pre-existing: 12 live in files this PR never edits, and the 4 intools/ops.rsfail assertingwhatsapp_data_list_chats/list_workflows(thechannels/skillsgates, which predate this work). None mention polymarket. They are the classAGENTS.mdalready names — tests that hard-assert a gated family — surfacing now because the smoke lane runscargo checkonly and this appears to be the first full gates-off run.Two environment notes:
RUST_MIN_STACK=67108864is required for a local full--librun (SIGABRT at ~4,300 tests without it), andinference/voiceare unbuildable here (whisper-rs-sysvs cmake 4.2), so those gates have compile verification in both states but no local test coverage.Related
channels/voicereferencetinychannels/{email,lark}, so this PR is unbuildable against current upstream tinychannels.--libsuite, not the scoped filter; the stack overflow that forced the filter is already handled byRUST_MIN_STACKLIVE_CATALOG_CACHEnever invalidates for the process lifetime (pre-existing; now visible incomposio::catalog)cron+chrono-tz(−5),argon2(−4),tokenjuice(−3),os-keyring(−2)AI Authored PR Metadata
Linear Issue
Commit & Branch
kernelize-openhumanValidation Run
pnpm --filter openhuman-app format:check—N/A: no frontend files changed(confirmed: noapp/src/**or.ts(x)paths in this PR's changed-files list)pnpm typecheck—N/A: no TypeScript changed(same confirmation)--test-threads=1(table above)cargo fmt --checkclean;cargo checkclean in gates-off and gates-on for every new gateN/A: only the forwarded feature list changed in app/src-tauri/Cargo.toml(the onlyapp/src-tauri/path touched isCargo.toml; confirmed against the PR's changed-files list)Validation Blocked
command:cargo check/test --features inference,voiceerror:whisper-rs-sysbuild fails under cmake 4.2 (vendored whisper.cpp uses removed policies)impact:thevoicegate's enabled branch has compile verification via other profiles but no local test run; pre-existing and unrelated to this changeBehavior Changes
flows-off builds.Parity Contract
capssplit is a pure move with glob re-exports keeping every call path (caps::Xfromflows/,super::super::Xfromcaps::tools::*); the tier-before-curation security ordering moved as one unit.check-feature-forwarding.mjsgreen (14 forwarded);check-kernel-floor.shgreen at 280/6; RPC controllers use conditionalpushso a gated method is absent (unknown-method) rather than registered-and-failing.Duplicate / Superseded PR Handling
Summary by CodeRabbit