Skip to content

fix: clippy cleanup + wire max_concurrent#35

Merged
kienbui1995 merged 1 commit intomainfrom
fix/quality-patch
Apr 12, 2026
Merged

fix: clippy cleanup + wire max_concurrent#35
kienbui1995 merged 1 commit intomainfrom
fix/quality-patch

Conversation

@kienbui1995
Copy link
Copy Markdown
Owner

@kienbui1995 kienbui1995 commented Apr 12, 2026

  • 42→13 clippy warnings (29 auto-fixed)
  • max_concurrent from config now actually applied to SubagentSpawner
  • 183 tests pass

Summary by CodeRabbit

Release Notes

  • New Features

    • Added runtime configuration to control maximum concurrent agents in managed agent scenarios.
  • Bug Fixes

    • Fixed auto-test failure message to correctly display standard error output.
    • Corrected budget, turn, and token limit error messages for consistency.
  • Refactor

    • Streamlined session deletion and command argument parsing.
    • Improved error handling for mutex operations and JSON parsing.
  • Documentation

    • Enhanced code documentation for clarity across multiple components.

- 29 clippy warnings auto-fixed (split_once, format!, unused mut, etc)
- max_concurrent from managed_agents config now wired to runtime
- set_max_concurrent_agents() exposed on ConversationRuntime
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 12, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 61be528b-9bc7-4cef-ac7c-0a6a8edb62ad

📥 Commits

Reviewing files that changed from the base of the PR and between f16b9c7 and 63083f6.

📒 Files selected for processing (13)
  • mc/crates/mc-cli/src/main.rs
  • mc/crates/mc-config/src/loader.rs
  • mc/crates/mc-config/src/project.rs
  • mc/crates/mc-core/src/branch.rs
  • mc/crates/mc-core/src/compact.rs
  • mc/crates/mc-core/src/cron.rs
  • mc/crates/mc-core/src/parallel_tools.rs
  • mc/crates/mc-core/src/runtime.rs
  • mc/crates/mc-core/src/subagent.rs
  • mc/crates/mc-tools/src/file_ops.rs
  • mc/crates/mc-tools/src/registry.rs
  • mc/crates/mc-tui/src/app.rs
  • mc/crates/mc-tui/src/commands.rs

📝 Walkthrough

Walkthrough

This PR introduces refinements across multiple crates, including adding a new set_max_concurrent_agents() method to ConversationRuntime for managed-agent configuration, applying #[must_use] attributes to functions whose return values should not be ignored, simplifying control flow patterns with Option combinators, improving error handling for mutex operations, and updating documentation formatting with inline code delimiters throughout the codebase.

Changes

Cohort / File(s) Summary
Managed Agents Configuration
mc/crates/mc-cli/src/main.rs, mc/crates/mc-core/src/runtime.rs
Added set_max_concurrent_agents() public method to ConversationRuntime and integrated its invocation in CLI when config.managed_agents.max_concurrent is configured.
Return Value Enforcement
mc/crates/mc-config/src/loader.rs, mc/crates/mc-config/src/project.rs, mc/crates/mc-tui/src/commands.rs
Added #[must_use] attributes to config_changed(), load_hierarchical_instructions(), resolve_includes(), and random_tip() to prevent accidental return value ignoring.
Control Flow Simplification
mc/crates/mc-core/src/branch.rs, mc/crates/mc-core/src/compact.rs, mc/crates/mc-core/src/subagent.rs
Refactored Option patterns: replaced map().unwrap_or() with map_or(), replaced map_or(true, ...) with is_none_or(), and improved function reference usage.
Mutex Error Handling
mc/crates/mc-core/src/subagent.rs, mc/crates/mc-tools/src/registry.rs
Standardized poison-error recovery across multiple locations by using direct method references instead of closure forms for into_inner().
CLI Argument Parsing & Formatting
mc/crates/mc-cli/src/main.rs, mc/crates/mc-tui/src/commands.rs, mc/crates/mc-tools/src/file_ops.rs
Improved argument extraction using strip_prefix() and split_once() Option methods; adjusted error message formatting and static string usage.
JSON Value Parsing
mc/crates/mc-core/src/runtime.rs, mc/crates/mc-tools/src/file_ops.rs
Replaced closure-based method chaining with direct method references for as_bool() and as_u64() extraction from JSON values.
Documentation Formatting
mc/crates/mc-core/src/cron.rs, mc/crates/mc-core/src/parallel_tools.rs, mc/crates/mc-tui/src/app.rs, mc/crates/mc-tools/src/registry.rs
Consistently wrapped code identifiers in backticks within doc comments (e.g., schedule_secs, review_writes, turn_number).
Error Message Handling & Logic
mc/crates/mc-cli/src/main.rs, mc/crates/mc-core/src/runtime.rs, mc/crates/mc-tools/src/registry.rs
Updated error message construction with inline formatting (max_usd, max_t, max_tok, {path}); fixed stderr appending condition inversion in auto-test failure messages.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~15 minutes

Possibly related PRs

  • PR #34: Both PRs directly address managed-agents functionality—this PR integrates the set_max_concurrent_agents() call from the CLI side when configuration is present, complementing the underlying infrastructure changes in that PR.

Poem

🐰 With backticks now wrapping every name,
And map_or flows that feel less tame,
Agents run concurrent and true,
While errors handle poison with newfound hue.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/quality-patch

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

@kienbui1995 kienbui1995 merged commit 7f5aa3b into main Apr 12, 2026
4 of 5 checks passed
@kienbui1995 kienbui1995 deleted the fix/quality-patch branch April 12, 2026 04:19
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.

1 participant