Skip to content

Name the plugin resource in cmux-tui plugin validation errors - #15769

Open
lawrencecchen wants to merge 3 commits into
mainfrom
fix-tui-plugin-validation-field
Open

lawrencecchen wants to merge 3 commits into
mainfrom
fix-tui-plugin-validation-field

Conversation

@lawrencecchen

@lawrencecchen lawrencecchen commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

local_plugin_jsonl_never_connects_to_the_session_socket has failed on main since #13299 (2026-09-23), which generalized the plugin manager to agent plugins and changed the validation.invalid field for the selected plugin from sidebar_plugin to plugin. The resource spec names the operations sidebar_plugin.*, the test pins sidebar_plugin, and a generic plugin does not tell an SDK caller which plugin kind failed.

The field is now the kind's resource noun from one PluginKind::resource_field(): sidebar_plugin for cmux sidebar plugin, agent_plugin for cmux agent plugin. All five call sites (resolve, update source checks) use it.

Red. Commit 1 adds an agent plugin use Bad assertion. Hosted focused run https://github.com/manaflow-ai/cmux/actions/runs/36649264948 (attempt 2) fails on Linux and macOS with left: String("plugin") right: "sidebar_plugin".

Green. Same --filter at 56185937a84: https://github.com/manaflow-ai/cmux/actions/runs/36651694025 passes on Linux and macOS, with lint (rustfmt, clippy) and MSRV 1.91 green. The first fix commit failed only rustfmt; the style commit applies rustfmt's layout.

Found while gating #15512, whose full cmux-tui gate hit this test. A second, unrelated red test on main (topology_close_commit_failure_leaves_every_projection_live_and_fences_replay in cmux-tui-core) is not addressed here.

Changelog

Fixed: cmux sidebar plugin and cmux agent plugin validation errors name the plugin resource (sidebar_plugin or agent_plugin) again.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.


Summary by cubic

Fixes plugin validation errors so they name the plugin resource instead of the generic plugin.

  • Since feat(tui): adopt Herdr-style agent plugins and journal projections #13299 generalized the plugin manager to agent plugins, the validation.invalid field was plugin for all kinds, which broke the resource spec contract and left SDK callers unable to tell which plugin kind failed.
  • The field is now the kind's resource noun via PluginKind::resource_field(): sidebar_plugin for cmux sidebar plugin, agent_plugin for cmux agent plugin, used at all five validation call sites.
  • Adds an agent plugin use Bad test assertion to pin the agent field.

Written for commit 5618593. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • Bug Fixes
    • Validation errors for sidebar and agent plugin commands now identify the relevant plugin type when plugin IDs or names are invalid, origin remotes are missing, or Git sources are invalid.
    • Invalid agent plugin names now return a JSON validation error identifying the field as agent_plugin, making the reported issue clearer.

lawrencecchen and others added 2 commits September 29, 2026 17:13
The sidebar assertion has failed on main since #13299 renamed the field
to the generic "plugin". This adds the agent plugin case.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
#13299 generalized the plugin manager to agent plugins and changed the
validation field for the selected plugin from sidebar_plugin to plugin.
That broke the resource contract the spec and resource_cli_v2 pin, and
left SDK callers unable to tell which plugin kind failed. The field is
now the kind's resource noun: sidebar_plugin or agent_plugin.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: manaflow-ai/cmux/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 55f08f60-f40c-4f40-a0ab-f422f1da3d45

📥 Commits

Reviewing files that changed from the base of the PR and between ba2d178 and 5618593.

📒 Files selected for processing (1)
  • cmux-tui/crates/cmux-tui/src/plugin_manager.rs

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


📝 Walkthrough

Walkthrough

Plugin validation errors now use kind-specific fields for sidebar and agent plugins. The test suite checks the error code and field for an invalid agent-plugin selection.

Changes

Plugin validation

Layer / File(s) Summary
Kind-specific validation errors
cmux-tui/crates/cmux-tui/src/plugin_manager.rs, cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs
PluginKind::resource_field returns sidebar_plugin or agent_plugin. Update and installed-plugin validation errors use the matching field. The test checks that an invalid agent-plugin selection exits with status 1 and returns validation.invalid for agent_plugin.

Priority: ⬇️ Low

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

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 56185

Invalid plugin selections now identify the relevant plugin kind without changing error codes or command exit behavior. No actionable merge-blocking risk remains.

Architecture Summary

Architecture risk: 🟡 Medium · up to 56185

The change affects 1 system.

Changed systems: cmux-tui

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — cmux-tui (service) was modified; 2 changed files map to changed impact.

Before / after behavior

  • observed — Modified behavior in cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs: The plugin test adds an invalid agent-plugin selection case using the local plugin data/config directories and a missing socket, then checks for status 1 and a JSON error with code validation.invalid and field agent_plugin.
  • observed — Modified behavior in cmux-tui/crates/cmux-tui/src/plugin_manager.rs: Added PluginKind::resource_field, which returns sidebar_plugin for sidebar plugins and agent_plugin for agent plugins.
  • observed — Modified behavior in cmux-tui/crates/cmux-tui/src/plugin_manager.rs: update_command now labels missing-origin-remote and invalid-Git-source validation errors with the field corresponding to the plugin kind, replacing the generic "plugin" field.
  • observed — Modified behavior in cmux-tui/crates/cmux-tui/src/plugin_manager.rs: resolve_installed_plugin now uses the plugin-kind-specific field for invalid IDs, invalid names, and not-installed selector errors instead of "plugin".

Reliability and maintainability

  • inferred — Risk-relevant change factors for cmux-tui: blast_radius_1; direct_dependents_1
🚥 Pre-merge checks | ✅ 24 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (24 passed)
Check name Status Explanation
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.
Cmux Cloud Persistent Session And Early Input ✅ Passed PASS. The pull request changes only plugin validation field mapping in plugin_manager.rs and adds local plugin validation assertions in resource_cli_v2.rs. It does not change Cloud terminal creati…
Cmux Swift Actor Isolation ✅ Passed The pull request changes only Rust files: plugin_manager.rs and resource_cli_v2.rs. The authoritative diff contains no Swift files and introduces no Swift actor-isolation changes.
Cmux Swift Blocking Runtime ✅ Passed The pull request changes only two Rust files: plugin_manager.rs and resource_cli_v2.rs. It introduces no production Swift changes and no added synchronization patterns covered by this check.
Cmux Browser Automation Off-Main ✅ Passed The pull request changes only Rust plugin validation code and its resource CLI test. It does not change browser socket automation, browser.* command routing, WebKit/AppKit access, or worker-lane pol…
Cmux Expensive Synchronous Load ✅ Passed PASS: The authoritative diff changes only two Rust files under cmux-tui. It adds no Swift production code and no synchronous agent-history load, main-actor load, or interactive-path load described by …
Cmux Cache Substitution Correctness ✅ Passed PASS: The pull request changes only Rust files: cmux-tui/crates/cmux-tui/src/plugin_manager.rs and cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs. The custom check applies only to production Sw…
Cmux No Hacky Sleeps ✅ Passed PASS. The pull request changes only Rust production code and Rust integration tests in cmux-tui. The custom check applies to TypeScript, JavaScript, shell, and non-Swift build/runtime scripts. No co…
Cmux Algorithmic Complexity ✅ Passed The pull request adds a constant-time PluginKind::resource_field() match and replaces validation field literals. It does not add collection scans, sorting, filtering, joins, or batch rescans. The on…
Cmux Swift Concurrency ✅ Passed PASS: The authoritative diff changes only two Rust files: cmux-tui/crates/cmux-tui/src/plugin_manager.rs and cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs. It adds `PluginKind::resource_field(…
Cmux Swift @Concurrent ✅ Passed PASS: The reviewed diff changes only Rust files (plugin_manager.rs and resource_cli_v2.rs). It adds no Swift code, @concurrent annotations, nonisolated async functions, or Swift call sites. Th…
Cmux Swift Package Boundaries ✅ Passed The pull request changes only Rust files: cmux-tui/src/plugin_manager.rs and cmux-tui/tests/resource_cli_v2.rs. It introduces no production Swift changes, so the Swift package-boundary check does …
Cmux Swiftpm Lockfiles ✅ Passed PASS. The pull request changes only two Rust files: cmux-tui/crates/cmux-tui/src/plugin_manager.rs and cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs. It changes no SwiftPM package, Xcode proje…
Cmux Swift Logging ✅ Passed PASS: The pull request changes only Rust files (plugin_manager.rs and resource_cli_v2.rs). The diff adds plugin validation fields and test assertions. It adds no Swift logging, ad hoc diagnostics,…
Cmux User-Facing Error Privacy ✅ Passed The production diff changes only the validation field from generic plugin to the product resource names sidebar_plugin and agent_plugin. These names are emitted through the user-facing `cmux sid…
Cmux Full Internationalization ✅ Passed PASS. The production change only replaces the JSON validation details.field value with exact resource/protocol tokens, sidebar_plugin and agent_plugin. These values match the resource operation …
Cmux Swiftui State Layout ✅ Passed The pull request changes only two Rust files: plugin_manager.rs and resource_cli_v2.rs. The diff contains no Swift or SwiftUI paths and no SwiftUI state or layout constructs. The SwiftUI state-lay…
Cmux Architecture Rethink ✅ Passed PASS: The pull request changes only Rust files (plugin_manager.rs and resource_cli_v2.rs). It adds kind-specific validation fields and a test assertion. It contains no Swift architecture change an…
Cmux Swift Auxiliary Window Close Shortcuts ✅ Passed The pull request changes only Rust source and Rust test files. It introduces no Swift NSWindow, NSPanel, NSWindowController, SwiftUI Window, or WindowGroup code. The auxiliary-window close-shortcut ru…
Cmux Source Artifacts ✅ Passed The pull request changes only two intentional Rust source/test files: cmux-tui/crates/cmux-tui/src/plugin_manager.rs and cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs. The diff adds validation…
Cmux No Test Or Debug Seam In Production Source ✅ Passed The pull request changes only two Rust files: cmux-tui/crates/cmux-tui/src/plugin_manager.rs and cmux-tui/crates/cmux-tui/tests/resource_cli_v2.rs. The review-scoped diff contains no Swift files, …
Title check ✅ Passed The title clearly and concisely describes the main change: naming the plugin resource in cmux-tui validation errors.
Description check ✅ Passed The description explains the problem, implementation, test coverage, observed failures, unrelated failures, and changelog entry. It omits the template headings for Summary and Testing, the checklist, …
  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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