fix: Add "+ Create a new session" row to the multi-match attach picker - #1142
Conversation
The multi-match attach picker listed only existing sessions, so when several matched the current directory there was no way to start a fresh session from within the picker. Add a trailing "+ Create a new session for <cwd>" row, always rendered last so it never displaces an existing session. Selecting it activates a new session for the cwd (autogen name, default sync) and attaches, the same path that "min session activate --attach ." runs. The non-TTY candidate listing is unchanged and gets no create affordance. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 53 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
Comment |
This branch's base predates #1140, so its copy of `cmd_update` still had the pre-fix body. Because the branch was cut from a main that already carried #1140, applying that stale copy silently reverted the hint — git reports no conflict, since it is a clean content replacement inside a file this branch legitimately edits. Restores `cmd_update` to its state on main, byte for byte. No other behaviour on this branch is touched. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018QCWCa2XxqtLnQPPP7xMwU
Caught a clobber — pushed a fix to this branchThis PR as opened would have reverted #1140, which merged to main as What happened. The agent run for this fix started at 15:53Z, working from a tree where - let mut ctx = match mctx::Context::new(config) {
- Ok(ctx) => ctx,
- // Point a user with no `minimal.toml` at `min init`, ...
- };
+ let mut ctx = mctx::Context::new(config)?;Why nothing caught it. Git reports no conflict — this is a clean content replacement inside a file the branch legitimately edits. The merge-base is Fix. Restored The attach-picker work itself is good and unrelated to this — three unit tests, and the |
Conflicts and reconciliation: - crates/minimal/src/main.rs: stdout_is_data_contract doc + tests — kept both the bare-min contract (this branch) and the task-run contract (#1139); the match arm union auto-merged. - crates/minimal/src/lib.rs (semantic, auto-merged textually): cmd_bare rewritten against #1142's SmartAttach enum — the picker's create row (CreateForCwd) and the first-run NoSessions case both create-and-attach on the bare path, scaffold offer suppressed; min session attach keeps its scaffold-offering activate_new_for_attach unchanged. Dropped this branch's status_label duplicate in favor of the identical helper #1144 added for the ls table.
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABK6q9Fw
The multi-match attach picker (an
inquire::Select) listed only existing sessions, so when several sessions matched the current directory the user had no in-picker way to start a fresh box. This adds a trailing+ Create a new session for <cwd>row, rendered last so it never displaces an existing session; selecting it activates a new session for the cwd (autogen name, default sync) and attaches, the same pathmin session activate --attach .runs. The non-TTY candidate listing is unchanged and receives no create affordance.Verification
cargo fmt --all --check— cleancargo clippy --workspace --locked -- -D warnings— clean, 0 warningscargo build --workspace --locked— okcargo test --workspace --locked— ok; minimal lib 158 passed / 0 failed (incl. 3 new attach-picker tests)Note
Add "+ Create a new session" option to the multi-match attach picker
PickerRow::CreateNewvariant to the attach picker so users can choose to create a new session directly from the multi-match selection prompt.Pickedenum in attach.rs to distinguish between selecting an existing session and selecting the create-new action.resolve_smart_attachin lib.rs to map the newPicked::CreateNewoutcome toSmartAttach::CreateForCwd, which triggersactivate_new_for_attach.activate_new_for_attachcallscmd_activatewith default parameters andattach=true, usingBox::pinto handle async recursion betweencmd_activateandcmd_attach.Macroscope summarized 19de195.