Skip to content

fix: Add "+ Create a new session" row to the multi-match attach picker - #1142

Merged
norrietaylor merged 2 commits into
mainfrom
inbox-patch/attach-picker-create-row-8526e7f97dd7fc2d
Jul 31, 2026
Merged

fix: Add "+ Create a new session" row to the multi-match attach picker#1142
norrietaylor merged 2 commits into
mainfrom
inbox-patch/attach-picker-create-row-8526e7f97dd7fc2d

Conversation

@gominimal-aw-bot

@gominimal-aw-bot gominimal-aw-bot Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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 path min session activate --attach . runs. The non-TTY candidate listing is unchanged and receives no create affordance.

Verification

  • cargo fmt --all --check — clean
  • cargo clippy --workspace --locked -- -D warnings — clean, 0 warnings
  • cargo build --workspace --locked — ok
  • cargo test --workspace --locked — ok; minimal lib 158 passed / 0 failed (incl. 3 new attach-picker tests)

Generated by inbox-patch ·

Note

Add "+ Create a new session" option to the multi-match attach picker

  • Adds a PickerRow::CreateNew variant to the attach picker so users can choose to create a new session directly from the multi-match selection prompt.
  • Introduces a Picked enum in attach.rs to distinguish between selecting an existing session and selecting the create-new action.
  • Updates resolve_smart_attach in lib.rs to map the new Picked::CreateNew outcome to SmartAttach::CreateForCwd, which triggers activate_new_for_attach.
  • activate_new_for_attach calls cmd_activate with default parameters and attach=true, using Box::pin to handle async recursion between cmd_activate and cmd_attach.

Macroscope summarized 19de195.

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>
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 53 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: f61e342d-70d7-4d93-bcd4-ee2470572d23

📥 Commits

Reviewing files that changed from the base of the PR and between d67c46d and 19de195.

📒 Files selected for processing (2)
  • crates/minimal/src/attach.rs
  • crates/minimal/src/lib.rs

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

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
@norrietaylor

Copy link
Copy Markdown
Member

Caught a clobber — pushed a fix to this branch

This PR as opened would have reverted #1140, which merged to main as d67c46de0 about twenty minutes before this branch was pushed.

What happened. The agent run for this fix started at 15:53Z, working from a tree where cmd_update did not yet have the min init hint. #1140 merged at ~16:47Z. The branch was then cut from a main that already carried #1140, and the agent's stale copy of cmd_update was applied over the fixed one. The diff showed:

-    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 d67c46de0, i.e. #1140's own merge commit, so the revert is invisible unless you diff the specific hunk against the base. That is the substance of gominimal/inbox#460: the clobber guards are prose instructions to the agent, not a mechanical check.

Fix. Restored cmd_update to its state on main, byte for byte. Verified with git diff origin/main -- crates/minimal/src/lib.rs, which now shows no divergence in that function. Nothing else on this branch is touched.

The attach-picker work itself is good and unrelated to this — three unit tests, and the Box::pin comment on the recursion cycle is load-bearing.

@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 17:26
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 17:26
@norrietaylor
norrietaylor merged commit 72946a6 into main Jul 31, 2026
30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/attach-picker-create-row-8526e7f97dd7fc2d branch July 31, 2026 17:28
norrietaylor added a commit that referenced this pull request Jul 31, 2026
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.
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