Skip to content

fix(mcp,testreport): stop steering transport unlock failures at --force - #618

Open
plusky wants to merge 1 commit into
openSUSE:mainfrom
plusky:fix/544-unlock-force-message
Open

fix(mcp,testreport): stop steering transport unlock failures at --force#618
plusky wants to merge 1 commit into
openSUSE:mainfrom
plusky:fix/544-unlock-force-message

Conversation

@plusky

@plusky plusky commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #544. Transport/SFTP unlock failures (LockOutcome::Failed) were advised to retry with unlock --force, which only bypasses the ownership check and does nothing here — remedy is now list_locks + retry once reachable. Remaining --force offers state the whole-group scope of every loaded template. Contended arm names the lock owner, branching own (you) vs foreign vs unknown (owner data already rode on Contended since #531, no new I/O). Adversarial review: GO, no blockers. Full workspace gate green.

…ce (openSUSE#544)

The Failed bucket is a transport/SFTP error, not contention: --force only
bypasses the ownership check, so both Failed arms now point at list_locks
and a plain unlock retry. The abort-path contended arm names the
LockOutcome::Contended owner already in hand, branches own-vs-other on the
cancel-time session_user, and states --force's whole-group-of-every-template
scope; docs/src/mcp.md mirrors both.
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.59091% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.89%. Comparing base (35aa038) to head (beaf30d).

Files with missing lines Patch % Lines
crates/mtui-mcp/src/session.rs 96.29% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #618      +/-   ##
==========================================
- Coverage   96.89%   96.89%   -0.01%     
==========================================
  Files         209      209              
  Lines       60697    60772      +75     
==========================================
+ Hits        58810    58882      +72     
- Misses       1887     1890       +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@mimi1vx mimi1vx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Critical (must fix)

  • crates/mtui-mcp/src/session.rs:421 (contended_reason) duplicates mtui_core::commands::support::contended_lock_reason (crates/mtui-core/src/commands/support.rs:54) — same own/foreign/unknown branching, same hedge wording, same --force framing, kept in sync by hand across two crates. LockOwner already lives in mtui-hosts, so there's a natural shared home: hoist one contended_lock_reason-equivalent there (or a small trait/free fn both crates call) and have both mtui-core and mtui-mcp call it instead of maintaining parallel copies. Must be deduplicated before merge — two independent copies of ownership-messaging logic will drift the next time either one gets a wording tweak.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unlock --force steers on the abort and unlock-failure paths: wrong remedy for a transport error, and whole-group in scope

2 participants