Skip to content

fix(core): drop DispatchCtx leftovers that fail clippy -D warnings - #7912

Merged
M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/clippy-dispatchctx-leftovers
Oct 16, 2026
Merged

M3gA-Mind merged 2 commits into
tinyhumansai:mainfrom
M3gA-Mind:fix/clippy-dispatchctx-leftovers

Conversation

@M3gA-Mind

@M3gA-Mind M3gA-Mind commented Oct 16, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Removes the last DispatchCtx-migration leftovers that fail the clippy-product, embed-clippy and tinyhumans-clippy lanes (-D warnings) on main:
    • 8 unused use crate::config::rpc as config_rpc; imports;
    • 7 needless_borrows: &ctx where ctx is already a &DispatchCtx;
    • 1 redundant_async_block in openhuman-embed/tests/flow_approvals.rs.
  • Mechanical only: no behavior change.

Problem

The CI Fast (EX63) run on #7876 (run 38862114600, tested against main e480f86) failed all three clippy lanes on 121 diagnostics in openhuman-core: 77 unused import and 44 needless_borrow. The embed and tinyhumans lanes fail on the same openhuman-core lib errors.

#7842 (9a25e9d) already removed most of them. On main at 9a25e9d, 15 remain:

  • config_rpc imported but unused in voice/live/schemas.rs, voice/schemas/handlers/{provider_server,transcribe_tts}.rs, web3/{bridge,dapp,swap}/schemas.rs and web3/wallet/{execution,ops}.rs;
  • &ctx on a ctx: &DispatchCtx in integrations/task_sources/route.rs (dispatch_triage, 2 sites) and web3/wallet/tools.rs (WalletModuleTool::run, 5 sites).

Solution

  • Delete the 8 unused imports, plus the unused one in web3/wallet/test_support.rs (#[cfg(all(test, feature = "web3"))]), which the test builds warn on.
  • In flow_approvals.rs, collapse async move { async move { … }.await } into the inner block.
  • Pass ctx instead of &ctx at the 7 sites; every callee (run_triage, apply_decision, wallet::{status, chain_status, tx_status, tx_receipt, lookup_tx}) takes &DispatchCtx.
  • Not touched:
    • web3/wallet/tools.rs:72 keeps &ctx, because that ctx is an owned value;
    • the test-only tinybox shell::{scan, classify, env_guard} deprecation warnings in security/policy/command_checks.rs (warnings in test builds, not lint errors);
    • voice/dictation_listener.rs:109 (ctx unused): this fires only on macOS, where the ctx use is behind #[cfg(not(target_os = "macos"))]. CI clippy runs on Linux, so it isn't a lane failure;
    • the test-gated pub use … as config_rpc re-export in mcp/server/tools/mod.rs (a re-export, not flagged).

Submission Checklist

  • (N/A) Tests added or updated: lint-only change, no behavior to test.
  • (N/A) Diff coverage ≥ 80%: no new lines; 7 changed call arguments on already-covered paths.
  • (N/A) Coverage matrix updated: no feature rows added or removed.
  • (N/A) All affected feature IDs listed: no matrix rows change.
  • No new external network dependencies introduced
  • (N/A) Manual smoke checklist: no release-cut surface changes.
  • (N/A) Linked issue closed: no issue; main clippy lanes red.

Impact

  • CI: unblocks the three clippy lanes for every PR based on main.
  • Runtime: none.

Related

  • Closes: N/A (no issue)
  • Follow-up PR(s)/TODOs: rustfmt on main is being fixed in a separate PR.

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

Linear Issue

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

Commit & Branch

  • Branch: fix/clippy-dispatchctx-leftovers
  • Commit SHA: see the PR head

Validation Run

  • (N/A) pnpm --filter openhuman-app format:check: no frontend files changed.
  • (N/A) pnpm typecheck: no frontend files changed.
  • Focused tests: none run locally (team rule); CI runs them.
  • Rust fmt/check (if changed): rustfmt --check on the changed files; lane clippy commands run once each on macOS: openhuman-tinyhumans --all-targets passes (0 errors); -p openhuman (core product features) has 0 errors except the macOS-only dictation_listener one above; openhuman-embed --all-targets reported only the flow_approvals.rs redundant_async_block, fixed here. That target stopped the run, so this PR's CI is the confirmation for the remaining embed targets.
  • (N/A) Tauri fmt/check: no Tauri source changed.

Validation Blocked

  • command: N/A
  • error: N/A
  • impact: N/A

Behavior Changes

  • Intended behavior change: none.
  • User-visible effect: none.

Parity Contract

  • Legacy behavior preserved: yes; same callees, same arguments (one fewer reference level, auto-derefed before).
  • Guard/fallback/dispatch parity checks: N/A.

Duplicate / Superseded PR Handling

  • Duplicate PR(s): none (no open clippy / unused-import PR)
  • Canonical PR: this
  • Resolution (closed/superseded/updated): N/A

Summary by CodeRabbit

  • Chores
    • Internal maintenance updates were made across task handling, voice, and wallet functionality. These changes do not alter available features or behavior.
    • Approval-flow test handling was simplified, with no changes to the approval context or arguments.
    • No new features, user-facing fixes, or changes to public functionality are included in this release.

Remove 8 unused config_rpc imports, pass ctx instead of &ctx where it is
already a &DispatchCtx (task_sources route, wallet tools), and collapse a
redundant async block in the embed flow_approvals test.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 16, 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 ✅ Completed 2026-10-16T08:11:43.806005Z 31cbe82 PR opened
ℹ️ 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.

@coderabbitai

coderabbitai Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3115480d-4bc2-4607-9be0-69fc2ad89f81
📥 Commits

Reviewing files that changed from the base of the PR and between 9a25e9d and ac1bd50.

📒 Files selected for processing: 12
  • crates/openhuman-core/src/integrations/task_sources/route.rs
  • crates/openhuman-core/src/voice/live/schemas.rs
  • crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
  • crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs
  • crates/openhuman-core/src/web3/bridge/schemas.rs
  • crates/openhuman-core/src/web3/dapp/schemas.rs
  • crates/openhuman-core/src/web3/swap/schemas.rs
  • crates/openhuman-core/src/web3/wallet/execution.rs
  • crates/openhuman-core/src/web3/wallet/ops.rs
  • crates/openhuman-core/src/web3/wallet/test_support.rs
  • crates/openhuman-core/src/web3/wallet/tools.rs
  • crates/openhuman-embed/tests/flow_approvals.rs
💤 Files with no reviewable changes: 9
  • crates/openhuman-core/src/web3/wallet/ops.rs
  • crates/openhuman-core/src/voice/schemas/handlers/transcribe_tts.rs
  • crates/openhuman-core/src/voice/schemas/handlers/provider_server.rs
  • crates/openhuman-core/src/web3/bridge/schemas.rs
  • crates/openhuman-core/src/web3/wallet/execution.rs
  • crates/openhuman-core/src/web3/swap/schemas.rs
  • crates/openhuman-core/src/web3/wallet/test_support.rs
  • crates/openhuman-core/src/voice/live/schemas.rs
  • crates/openhuman-core/src/web3/dapp/schemas.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.

📝 Walkthrough

This change updates context passing and approval-await structure at existing call sites. It also removes unused RPC imports from voice and Web3 modules. No public declarations changed.

Changes: Core and embed cleanup

Layer / File(s) Summary
Pass existing values directly
crates/openhuman-core/src/integrations/task_sources/route.rs, crates/openhuman-core/src/web3/wallet/tools.rs, crates/openhuman-embed/tests/flow_approvals.rs
Task and wallet operations receive ctx directly. The approval interception is awaited within the async block passed to CoreContext::scope.
Remove unused RPC imports
crates/openhuman-core/src/voice/..., crates/openhuman-core/src/web3/...
Unused config_rpc imports are removed. Handler and controller behavior is unchanged.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Refactor

Suggested reviewers: senamakel

Merge Risk: ⚪ Minimal · up to ac1bd

This appears to be a mechanical cleanup with no established user-facing behavior change. No merge-blocking issue is identified; normal CI should confirm the remaining embed clippy targets.

Pre-merge checks: Passed 5
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files.
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 pull request's main change: removing DispatchCtx migration leftovers and related clippy warnings in core code.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks the context pass,
Then hops through imports trimmed from grass.
It awaits the flow without delay,
And nudges extra borrows out of the way.
The code sits neat beneath the moon,
While whiskers hum a tidy tune.

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

@M3gA-Mind
M3gA-Mind merged commit cec2814 into tinyhumansai:main Oct 16, 2026
17 of 22 checks passed
@tinysweeper

tinysweeper Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Tiny Sweeper review

Tiny Sweeper completed its review; deterministic results follow.

State: Incomplete
Priority: none
Reviewed head: ac1bd500dde5
Updated: 2026-10-16T08:31:28Z

Review snapshot

Change surface Files Review signal Count
Production 10 Active findings 0
Tests 2 Noted findings 0
Documentation 0 Resolved findings 0
Configuration 0 Pending checks/questions 2

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

Features

  • Modified — Needless-borrow cleanup in task-sources dispatch: Two needless-borrow clippy violations inside the dispatch path are fixed by passing `ctx` directly to `run_triage` and `apply_decision`; dispatch behavior is unchanged. (crates/openhuman-core/src/integrations/task_sources/route.rs#async fn dispatch_triage()

Tests

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

  • Unreviewed: tinysweeper/tests

Findings

No active actionable findings.

Could not review: crates/openhuman-embed/tests/flow_approvals.rs, tinysweeper/tests

Before merge

  • Complete the critique review for crates/openhuman-embed/tests/flow_approvals.rs.
  • Complete the tests review for tinysweeper/tests.

How this fits together

flowchart LR
  n0["dispatch_triage<br/>changed"]:::changed
  n1["Result"]:::impacted
  n2["load_config"]:::impacted
  n3["setup_wallet_in"]:::impacted
  n4["run"]:::impacted
  n5["setup"]:::impacted
  n6["lookup_tx"]:::impacted
  n0 -->|uses| n1
  n2 -->|uses| n1
  n3 -->|uses| n1
  n3 -->|calls| n2
  n3 -->|tests| n2
  n3 -->|calls| n5
  n3 -->|tests| n5
  n4 -->|uses| n1
  n4 -->|calls| n6
  n5 -->|uses| n1
  n5 -->|calls| n2
  n6 -->|uses| n1
  n6 -->|calls| n2
  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
Agent review details

critique

  • Conclusion: Success
  • Scope reviewed: incomplete; unanswered: crates/openhuman-embed/tests/flow_approvals.rs
  • Lane summary: Reviewed 2 files; 0 findings. 1 file could not be reviewed: crates/openhuman-embed/tests/flow_approvals.rs. _The code index is behind this pull request (indexed at `b8bf1de46ad4`), so retrieved context may be out of date._

security

  • Conclusion: Success
  • Scope reviewed: all assigned evidence
  • Lane summary: Reviewed 3 files; 0 findings. _The code index is behind this pull request (indexed at `b8bf1de46ad4`), so retrieved context may be out of date._

tests

  • Conclusion: Neutral
  • Scope reviewed: incomplete; unanswered: tinysweeper/tests
  • Lane summary: No reviewer produced a usable response.

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
  • Positive: The description lane independently verified each claim in the pull-request write-up against the diff: 9 removed `config_rpc` imports (8 lib + 1 test_support), 7 `&ctx` to `ctx` fixes whose callees take `&DispatchCtx`, and the collapsed redundant nested `async move` with identical arguments in the flow-approvals test.
  • Positive: The one legitimate borrow was deliberately preserved: the call site on tools.rs line 72 that passes `&ctx` for an owned `ctx` was confirmed present and untouched, matching the stated exception in the description.
  • Lane summary: The description accurately matches the mechanical lint-only diff: 9 `use crate::config::rpc as config_rpc;` imports removed (8 lib + 1 test_support), 7 `&ctx`→`ctx` needless-borrow fixes (2 in route.rs, 5 in wallet tools.rs, whose callee `wallet::status` the lookups confirm takes `&DispatchCtx`), and the redundant nested `async move` in flow_approvals.rs collapsed with identical arguments. The stated exception (keeping `&ctx` at the owned-`ctx` call site on tools.rs line 72) is confirmed present and untouched. No behavior change, no rule violations; the change looks sound and the write-up matches it. _The code index is behind this pull request (indexed at `b8bf1de46ad4`), so retrieved context may be out of date._
Evidence and run details
  • Models: ladder/vectors-oai3, glm-5.3-flash
  • Spend: $0.002073
  • Tokens: 146870 input · 4619 output · 0 cached · 289 embedding
Head State Pass summary
ac1bd500dde5 incomplete 0 active finding(s), 0 resolved finding(s) (at 2026-10-16T08:31:28Z)

tinysweeper 0.1.2

@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: crates/openhuman-embed/tests/flow_approvals.rs, tinysweeper/tests.

             $0.0021 · 146,870 in / 4,619 out · 0 cached (0%) · ladder/vectors-oai3, glm-5.3-flash · 289 embedded
critique:    $0.0006 · 63,791 in  / 1,419 out · 0 cached (0%) · glm-5.3-flash
security:    $0.0005 · 45,171 in  / 630 out   · 0 cached (0%) · glm-5.3-flash
tests:       $0.0001 · 14,546 in  / 16 out    · 0 cached (0%) · glm-5.3-flash
description: $0.0003 · 19,584 in  / 1,065 out · 0 cached (0%) · glm-5.3-flash

@tinysweeper tinysweeper Bot added the priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect. label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: p3 Whenever. Cosmetic, a nicety, or a cleanup with no user visible effect.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant