Skip to content

fix: announce which session bare min and min attach entered - #1016

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/announce-resolved-session-6e9f3696e6cad103
Jul 29, 2026
Merged

fix: announce which session bare min and min attach entered#1016
norrietaylor merged 1 commit into
mainfrom
inbox-patch/announce-resolved-session-6e9f3696e6cad103

Conversation

@gominimal-aw-bot

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

Copy link
Copy Markdown
Contributor

Fixes #1014
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKk0kog

What was broken

A bare min (and min attach with no session argument) auto-resolves a session for the current directory and hands off to its shell with no user-visible output. The resolved session was written only to tracing::info! in crates/minimal/src/lib.rs, invisible at the default log level, so the operator had no way to confirm they landed in the session they expected rather than a stale one built from the same directory. On the no-sessions path, cmd_activate --attach printed only a bare UUID to stdout with no framing.

The change

Single file, crates/minimal/src/lib.rs:

  • Added session_announce_label(id, name) — prefers the session name and appends the leading UUID block as a short id (name (abcdef01)); falls back to the short id alone when the session is unnamed.
  • Added should_announce_session(global) — the suppression gate: announce only when stderr is a terminal and --no-input is not set.
  • resolve_smart_attach: on the unambiguous SmartResolve::Attach arm, print Attaching to session <label> to stderr before returning. This one site covers both bare min (cmd_default) and min attach with no session argument. The SmartResolve::Pick arm is deliberately left untouched — a picker selection is its own confirmation.
  • cmd_activate: on the activate-then-attach path (args.attach), print Created session <label> to stderr, after the id is emitted to stdout.

The bare-id println! to stdout is left exactly as-is, so the scripting/CI contract that parses the session id from stdout stays intact; the new lines go only to stderr and only for interactive TTY sessions.

Diagnosis checked against the code: the confirmation is gated on global.no_input (a real, widely-used global arg) and stderr's TTY state, both reachable on the attach path. The change lives in the shared resolve_smart_attach helper whose two callers — cmd_default and cmd_attach — are exactly the reported reproduction paths.

The scoped Distillery precedent pass (project: minimal) surfaced no prior entry addressing session-attach identity feedback, so there is nothing load-bearing to cite.

Verification

All commands run from the workspace root with --locked (CI parity); each exited 0.

  • cargo fmt --all --check --manifest-path target/Cargo.toml — clean, no drift.
  • cargo clippy --workspace --locked --manifest-path target/Cargo.toml -- -D warningsFinished, no warnings.
  • cargo build --workspace --locked --manifest-path target/Cargo.tomlFinished, all four binaries built.
  • cargo test --workspace --locked --manifest-path target/Cargo.toml — all green; minimal crate unit tests 125 passed; 0 failed, including the new session_announce_label_prefers_name_with_short_id.

Generated by inbox-patch ·

Note

Announce which session min and min attach entered on stderr

  • When creating a session with --attach, the CLI prints a one-line confirmation to stderr (e.g. Created session name (short-id)) before attaching.
  • When auto-resolving an attach target via resolve_smart_attach, the CLI prints Attaching to session name (short-id) to stderr before connecting.
  • Announcements are suppressed when --no-input is set or stderr is not a terminal, using the new should_announce_session helper in lib.rs.

Macroscope summarized 977e481.

A bare `min` (and `min attach` with no session arg) auto-resolves a
session for the current directory and drops the operator into its
shell with no output — the resolved session is written only to
`tracing::info!`, invisible at the default log level. On the
no-sessions path the activate step prints just a bare UUID to stdout
with no framing.

Print a single stderr line before handing off to the shell:

- `Attaching to session <name> (<short-id>)` on the unambiguous
  auto-resolve path (added in `resolve_smart_attach`, so both bare
  `min` and `min attach` are covered; the picker path is left
  untouched since a selection is its own confirmation).
- `Created session <name> (<short-id>)` on the activate-then-attach
  path.

The label prefers the session name and appends the leading UUID block
as a short id so two same-named sessions from the same directory stay
distinguishable; an unnamed session falls back to the short id alone.
Both lines are suppressed under `--no-input` and when stderr is not a
terminal, so the bare-id stdout scripting contract stays intact for
CI and scripts.
@coderabbitai

coderabbitai Bot commented Jul 29, 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: 35 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: 11da1092-e2ba-4a77-85a0-1592383798f9

📥 Commits

Reviewing files that changed from the base of the PR and between 5aba97a and 977e481.

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

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

@norrietaylor
norrietaylor merged commit 1be9ee3 into main Jul 29, 2026
29 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/announce-resolved-session-6e9f3696e6cad103 branch July 29, 2026 04:52
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.

Bare min attaches silently — should say which session you are entering

1 participant