Skip to content

fix: name a session's origin when auto-attaching from another directory - #1127

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/inbox-patch-attach-created-from-2dc642c305cddf38
Jul 31, 2026
Merged

fix: name a session's origin when auto-attaching from another directory#1127
norrietaylor merged 1 commit into
mainfrom
inbox-patch/inbox-patch-attach-created-from-2dc642c305cddf38

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_kwDOSUhdos8AAAABK6MraA

When min session attach finds no session for the current directory but exactly one session exists, it auto-attaches to that session. The announcement named the session but not its origin, so the operator got no signal they had landed in another project's box.

This appends — created from <path> to the announcement on that no-cwd-match/single-session branch only, read from the entry's already-available project_path. Cwd-matched attaches and picker selections are unchanged; a record without project_path (older daemon) renders exactly as before.

Verification

cargo fmt --all --check — clean, no drift
cargo clippy --workspace --locked -- -D warnings — clean, 0 warnings
cargo build --workspace --locked — Finished dev profile, ok
cargo test --workspace --locked — ok, 0 failed (adds 3 attach unit tests)

Generated by inbox-patch ·

Note

Add origin path suffix to auto-attach announcements when session is from a different directory

When auto-attaching to a session whose project_path differs from the current working directory, the announcement now reads Attaching to session <name> — created from <path> instead of just Attaching to session <name>.

The suffix is computed by the new created_from_suffix helper in attach.rs and appended in resolve_smart_attach in lib.rs. When the paths match or no project_path is set, the suffix is empty and behavior is unchanged.

Macroscope summarized dd66044.

Summary by CodeRabbit

  • New Features

    • Session attachment announcements now indicate the project path where a session was created when it differs from the current location.
  • Bug Fixes

    • Improved session context by omitting the creation-path detail when it matches the current location or is unavailable.

When `min session attach` finds no session for the current directory but
exactly one session exists, it attaches to that session automatically. The
announcement named the session but not where it came from, so the operator
had no signal they had landed in another project's box.

Append ` — created from <path>` to the announcement on that branch only,
reading the origin from the entry's already-available `project_path`. A
cwd-matched attach is its own confirmation and is left unchanged; if the
record has no `project_path` (older daemon) the line renders as before.
@norrietaylor
norrietaylor marked this pull request as ready for review July 31, 2026 07:39
@norrietaylor
norrietaylor requested a review from a team as a code owner July 31, 2026 07:39
@norrietaylor
norrietaylor enabled auto-merge (squash) July 31, 2026 07:39
@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The attach announcement now indicates the session’s creation path when it differs from the current working directory. Matching and missing paths produce no suffix. Tests cover all three cases.

Changes

Session attach announcement

Layer / File(s) Summary
Creation-source suffix and attach integration
crates/minimal/src/attach.rs, crates/minimal/src/lib.rs
created_from_suffix formats differing project paths. Tests cover differing, matching, and missing paths. Automatic attach announcements now include the suffix.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related issues

  • gominimal/inbox#449 — Requests the creation-source suffix implemented in the attach logic and announcement call site.

Possibly related PRs

  • gominimal/minimal#875 — Introduced related smart-attach behavior in the same attach and library code.

Suggested reviewers: norrietaylor, 0chroma, twitchyliquid64

Poem

A rabbit hops through paths unseen,
And marks where each session has been.
If home is near, no words appear;
If home is far, the source is clear.
Attach with a twitch of the ear.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly describes the change to identify a session's origin during automatic attachment from another directory.
Description check ✅ Passed The description explains the behavior change, affected cases, backward compatibility, and verification results, although it does not use the template headings.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch inbox-patch/inbox-patch-attach-created-from-2dc642c305cddf38

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

@norrietaylor
norrietaylor merged commit e4035e7 into main Jul 31, 2026
30 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/inbox-patch-attach-created-from-2dc642c305cddf38 branch July 31, 2026 07:47
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