Skip to content

chore(rust): prune unused dependencies and repair TinyFlows import - #5540

Merged
senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:chore/rust-dependency-cleanup
Aug 13, 2026
Merged

chore(rust): prune unused dependencies and repair TinyFlows import#5540
senamakel merged 6 commits into
tinyhumansai:mainfrom
senamakel:chore/rust-dependency-cleanup

Conversation

@senamakel

@senamakel senamakel commented Aug 13, 2026

Copy link
Copy Markdown
Member

Summary

  • Remove unused direct dependencies from the core, desktop shell, and experimental mobile manifests.
  • Refresh all three lockfiles, dropping dependency subtrees reachable only through those declarations.
  • Initialize the new TinyFlows WorkflowGraph.agents field when importing n8n workflows.
  • Record TinyFlows' newly required reqwest 0.13 package in the root and desktop lockfiles.
  • Reconcile the flows kernel-floor package count for that second reqwest version, without increasing unique crate names or native builds.
  • Correct the stale desktop Sentry comment that claimed the shell still used env_logger.

Problem

A cargo machete and release cargo bloat audit found unused direct dependencies in the three Rust manifests. While rebasing the cleanup onto current main, the newly advanced TinyFlows schema also made the core fail to compile because the n8n importer did not initialize its required agent registry and the lockfile did not contain TinyFlows' reqwest 0.13 requirement.

Solution

Remove only source-confirmed unused declarations. Dependencies still required transitively remain resolved normally: Rustls still selects its ring provider, while regex and TinyJuice remain available to the embedded core. Map n8n workflows to an empty reusable-agent registry because n8n agent nodes carry their configuration inline. Larger or compatibility-sensitive bloat work is deferred to #5539.

The kernel-floor limit moves from 307 to 308 packages because #5537 changed TinyFlows from reqwest 0.12 to 0.13 while the rest of the kernel still uses 0.12. This is one additional version of an existing crate: unique names remain 284 and native builds remain 2. Unifying the reqwest major versions is tracked in #5539.

Submission Checklist

If a section does not apply to this change, mark the item as N/A with a one-line reason. Do not delete items.

  • Existing n8n importer tests cover the mapping and validation paths; all 18 pass.
  • The compatibility line is exercised by the focused importer suite; CI enforces diff coverage.
  • N/A: no feature rows were added, removed, or renamed.
  • Affected feature ID: flows.
  • No new external network dependency is introduced; the lockfile records TinyFlows' existing requirement.
  • N/A: no release-cut behavior or manual smoke surface changed.
  • N/A: Reduce Rust binary bloat from duplicate dependency versions and monomorphization #5539 tracks broader follow-up work and must remain open.

Impact

No intended user-visible, security, persistence, or wire-format change. n8n imports now satisfy the updated TinyFlows graph schema with an empty reusable-agent registry. The dependency graph no longer retains the desktop/mobile env_logger subtree, and the redundant declarations are removed.

Related


AI Authored PR Metadata (required for Codex/Linear PRs)

Keep this section for AI-authored PRs. For human-only PRs, mark each field N/A.

Linear Issue

  • Key: N/A
  • URL: N/A

Commit & Branch

  • Branch: chore/rust-dependency-cleanup
  • Commit SHA: 2afb6b890

Validation Run

  • N/A: no frontend files changed; frontend format check not required.
  • N/A: no TypeScript files changed.
  • Focused tests: n8n importer suite (18 passed); dynamic-agent structural validation (1 passed); CLI model override integration suite (3 passed).
  • Full integration compile: cargo test -p openhuman --locked --features "$(scripts/ci/product-features.sh),bin-tools" --tests --no-run.
  • Rust fmt/check: cargo check --locked --manifest-path Cargo.toml --bin openhuman-core.
  • Tauri fmt/check: cargo check --locked --manifest-path app/src-tauri/Cargo.toml --bin OpenHuman.
  • Kernel floor: bash scripts/check-kernel-floor.sh --verbose (308 packages / 284 names / 2 native) and python3 scripts/dep-sim.py --cut-nothing --expect-names 284.
  • Dependency audit: cargo-machete --with-metadata --skip-target-dir Cargo.toml app/src-tauri/Cargo.toml app/src-tauri-mobile/Cargo.toml; remaining reports are build-script or target-specific false positives and are tracked in Reduce Rust binary bloat from duplicate dependency versions and monomorphization #5539.
  • Patch hygiene: git diff --check origin/main...HEAD.

Validation Blocked

  • command: cargo check --manifest-path app/src-tauri-mobile/Cargo.toml --all-targets
  • error: the mobile crate intentionally emits compile_error! on desktop targets; this checkout has no iOS or Android Rust target installed.
  • impact: mobile removals were source-verified and analyzed with cargo-machete, but a target-native mobile compile was not run locally.

Behavior Changes

  • Intended behavior change: n8n imports initialize the required TinyFlows reusable-agent registry as empty.
  • User-visible effect: none; n8n agent configuration remains inline as before.

Parity Contract

  • Legacy behavior preserved: Rustls ring-provider selection and embedded-core regex/TinyJuice availability remain unchanged.
  • Guard/fallback/dispatch parity checks: both shipping Rust Cargo worlds pass locked checks.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none found for this branch.
  • Canonical PR: this PR.
  • Resolution (closed/superseded/updated): N/A.

Summary by CodeRabbit

  • Bug Fixes

    • Improved n8n workflow imports by keeping inline agent configurations from creating unnecessary reusable agent entries.
    • Added clearer validation for dynamic agent references, which now fail immediately with an actionable error.
  • Maintenance

    • Updated package and build tracking to reflect the latest flows profile.
    • Removed unused dependencies and simplified configuration across desktop and mobile builds.

Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel requested a review from a team August 13, 2026 20:03
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: bdc73c7f-6687-4673-9e01-b42cdf33da0e

📥 Commits

Reviewing files that changed from the base of the PR and between b472384 and 9d7bf1d.

📒 Files selected for processing (1)
  • tests/agent_retrieval_e2e.rs

📝 Walkthrough

Walkthrough

The pull request removes unused dependency declarations, initializes imported n8n workflow graphs with empty agent collections, rejects dynamic agent_ref values during structural validation, updates test configuration setup, and raises the flows package limit from 307 to 308.

Changes

Dependency and Flow Validation Cleanup

Layer / File(s) Summary
Remove unused manifest dependencies
Cargo.toml, app/src-tauri-mobile/Cargo.toml, app/src-tauri/Cargo.toml
The manifests remove unused direct dependencies. The Sentry comment no longer references log or env_logger.
Initialize imported agent collections
src/openhuman/flows/n8n_import.rs
Imported workflow graphs set agents to an empty vector. The code documents that n8n agent configuration remains inline.
Reject dynamic agent references
src/openhuman/flows/ops_tests.rs, tests/agent_retrieval_e2e.rs
The regression test verifies that expression-derived agent_ref values fail structural validation before inference-readiness checks. Test configuration now uses Config::default() before setting workspace_dir.
Update flows package limits
scripts/kernel-floor.limits
The history records 308 flows packages. The active flows package limit increases from 307 to 308.

Estimated code review effort: 2 (Simple) | ~10 minutes

Mergeability Score: ⚪ Minimal · up to 9d7bf

This PR repairs n8n workflow imports and removes unused Rust dependency declarations without changing user-visible behavior or introducing new security, network, persistence, or deployment boundaries. No actionable merge-blocking risk remains after normal checks and review.

Possibly related PRs

Suggested labels: rust-core

Suggested reviewers: sanil-23

Poem

A rabbit trims the crates with care,
And checks each flow reference there.
Empty agents wait in line,
Three-oh-eight makes limits fine.
Clean manifests fill the air.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the two main changes: removing unused Rust dependencies and repairing TinyFlows n8n import handling.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026
…-cleanup

# Conflicts:
#	Cargo.lock
#	app/src-tauri/Cargo.lock
@coderabbitai

coderabbitai Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@senamakel senamakel changed the title chore(rust): remove unused direct dependencies chore(rust): prune unused dependencies and repair TinyFlows import Aug 13, 2026
@coderabbitai coderabbitai Bot added the rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure. label Aug 13, 2026
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026

@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. Approving.

             $0.0279 · 25,991 in / 9,293 out · 22,255 cached (86%) · z-ai/glm-5.2
critique:    $0.0111 · 8,626 in  / 3,881 out · 7,455 cached (86%)  · z-ai/glm-5.2
security:    $0.0049 · 8,542 in  / 1,262 out · 7,387 cached (86%)  · z-ai/glm-5.2
tests:       $0.0070 · 3,778 in  / 2,594 out · 3,187 cached (84%)  · z-ai/glm-5.2
description: $0.0049 · 5,045 in  / 1,556 out · 4,226 cached (84%)  · z-ai/glm-5.2

@tinysweeper

tinysweeper Bot commented Aug 13, 2026

Copy link
Copy Markdown

How this change flows

1 changed behaviour across 8 relationships. 6 surrounding behaviours are shown (60 graph nodes walked). 39 further behaviours left out to keep the diagram readable.

flowchart LR
  n0["test_config<br/>changed"]:::changed
  n1["apply_overrides"]:::impacted
  n2["Value"]:::impacted
  n3["...nges_and_removes_untouched_overlay_fields"]:::impacted
  n4["...aves_hydrates_source_ref_for_cited_chunks"]:::impacted
  n5["expect"]:::impacted
  n6["CliInferenceOverrides"]:::impacted
  n0 -->|calls| n5
  n1 -->|uses| n6
  n3 -->|calls| n1
  n3 -->|tests| n1
  n3 -->|uses| n6
  n4 -->|calls| n0
  n4 -->|uses| n2
  n4 -->|calls| n5
  classDef changed fill:#0d4429,stroke:#238636,color:#e6edf3
  classDef impacted fill:#161b22,stroke:#6e7681,color:#c9d1d9
  classDef flagged fill:#5a1e02,stroke:#d93f0b,color:#ffffff
  classDef blocking fill:#67060c,stroke:#f85149,color:#ffffff
Loading

Green: changed behaviour. Grey: surrounding behaviour. Arrows name the call, use, implementation, or test relationship. Orange: has findings. Red: has a finding that blocks the merge.

tinysweeper 0.1.0

@tinysweeper tinysweeper Bot added the priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. label Aug 13, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
coderabbitai[bot]
coderabbitai Bot previously approved these changes Aug 13, 2026
Co-authored-by: Medulla <medulla@tinyhumans.ai>
@senamakel
senamakel merged commit 5f59fca into tinyhumansai:main Aug 13, 2026
19 of 21 checks passed

@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. Approving.

             $0.0577 · 80,651 in / 53,025 out · 46,336 cached (57%) · deepseek/deepseek-v4-pro-0813
critique:    $0.0176 · 15,717 in / 14,903 out · 5,120 cached (33%)  · deepseek/deepseek-v4-pro-0813
security:    $0.0122 · 15,612 in / 8,740 out  · 5,120 cached (33%)  · deepseek/deepseek-v4-pro-0813
tests:       $0.0121 · 5,894 in  / 11,013 out · 0 cached (0%)       · deepseek/deepseek-v4-pro-0813
description: $0.0116 · 7,208 in  / 9,715 out  · 0 cached (0%)       · deepseek/deepseek-v4-pro-0813

Comment thread src/openhuman/config/schema/types.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p2 Soon. Real but survivable — a rough edge, a gap, a thing that will bite later. rust-core Core Rust runtime in src/: CLI, core_server, shared infrastructure.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant