fix(cargo): stop recursive explicit mbx wrappers #977
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 499 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.372
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #977"
general
weight: 0.35
jbellis
A temporary
cargowrapper ranexec mbx cargo "$@"ahead of real Cargo on PATH. Each metadata probe re-entered mbx through its explicit-command path, bypassing the Cargo shim's recursion guard. One container exhausted its 8,192-PID limit with a single chain of mbx processes.Explicit Cargo commands now share the shim's 12-level nesting limit. Once recursion is detected, a shared counter limits retries across the invocation tree to 128, including sibling probes and command listings. Wrapper fallback, alias expansion and metadata recovery remain available within those bounds. Successful probes cannot reset the counter. After a loop has been detected, the budget remains active until the outer command exits; restart a long-running watcher after fixing its wrapper.
The guard uses private, random temporary paths and cleanup by the outer invocation. Nested commands require the counter initialized by their outer command and stop if it is missing, truncated or unwritable. Top-level direct Cargo queries remain usable without writable temporary storage. Nested sandboxes must retain access to the inherited guard state. No new settings or flags are required.
Each metadata probe retains its own loop diagnosis. An unrelated failed probe keeps its Cargo error, and a successful sibling cannot erase another probe's failure. If alias recovery also fails after a detected loop, the error reports both causes; ordinary alias failures continue to report the expanded project's actionable error.
mbx explain --lastreplays recorded results without entering the Cargo guard. Programs launched bymbx run, including nested launches, receive their original application environment; a detached application can start a new build after its parent exits, while live Cargo re-entry keeps the active recursion limit.For normal use, keep the supported Cargo shim or invoke
mbx fmt --all -- --checkwith real Cargo reachable.mbx cargo fmtis not valid explicit syntax; wrappers usingexec mbx "$@"can also recurse if selected as Cargo.Validation:
ee819a4) on this host.AI-assisted — Tool: Codex; model: openai/GPT-6; version: 0.170.0.
<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
Bug Fixes
Recursive Cargo wrappers now stop after bounded retries and provide clearer loop diagnostics.
Cargo commands recover more reliably from wrapper failures, including when resolving Cargo directly.
Temporary loop-tracking state is cleaned up after commands complete.
Cargo selections with non-standard characters are preserved across wrapper invocations.
Nested applications no longer inherit Cargo shim tracking state.
* “Explain last” runs without preparing an explicit Cargo selection.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->