8000 fix(sessions): resolve session names case-insensitively by gominimal-aw-bot[bot] · Pull Request #2032 · gominimal/minimal · GitHub
[go: up one dir, main page]

Skip to content

fix(sessions): resolve session names case-insensitively - #2032

Merged
norrietaylor merged 3 commits into
mainfrom
inbox-patch/case-insensitive-session-name-resolution-55a8bc83e6f96b6c
Oct 7, 2026
Merged

norrietaylor merged 3 commits into
mainfrom
inbox-patch/case-insensitive-session-name-resolution-55a8bc83e6f96b6c

Conversation

@gominimal-aw-bot
@gominimal-aw-bot gominimal-aw-bot Bot commented Oct 6, 2026 •
Copy link
Copy Markdown
Contributor

Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVeYN3A

Session names are unique under ASCII case folding, but name lookup was exact. A name refused at activate time (e.g. case-r after Case-R) could not be resolved by destroy/exec/attach/policy in the casing it was refused in.

  • DiskLoader::find_by_name now falls back to the case-folded index lookup after an exact miss.
  • The CLI's match_id_prefix now compares names case-insensitively, matching how names are made unique.

Verification

  • cargo fmt --all --check --manifest-path Cargo.toml
  • cargo clippy --workspace --all-targets --locked --manifest-path Cargo.toml -- -D warnings
  • cargo test --locked --manifest-path Cargo.toml -p sessions (575 passed)
  • cargo test --locked --manifest-path Cargo.toml -p minimal --lib (355 passed; 1 pre-existing failure legacy_network_spellings_parse_with_hint requires nextest, which is not installed here)

Summary by CodeRabbit

  • Bug Fixes
    • Session lookups now match names without regard to ASCII letter case when the match is unique.
    • Exact-case matches take precedence. If multiple names match after case folding, lookup returns no result rather than choosing one.
    • ID-prefix lookup remains available when no matching name is found.

Session names are unique under ASCII case folding, but name lookup
was exact. A name refused at activate time (e.g. case-r after
Case-R) could not be resolved by destroy/exec/attach/policy in the
casing it was refused in.

Make DiskLoader::find_by_name fall back to the case-folded index
lookup, and make the CLI's match_id_prefix compare names
case-insensitively, matching how names are made unique.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@gominimal-aw-bot
gominimal-aw-bot Bot requested a review from a team as a code owner October 6, 2026 23:13
@gominimal-aw-bot gominimal-aw-bot Bot added the agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. label Oct 6, 2026
@coderabbitai
coderabbitai Bot commented Oct 6, 2026 •
Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Essentials
  • Run ID: 82a21d82-5a97-410a-88e8-acb96879053a
📥 Commits

Reviewing files that changed from the base of the PR and between 7574ba5 and de461f1.

📒 Files selected for processing (4)
  • crates/minimal/src/cmd/mod.rs
  • crates/minimal/src/tests.rs
  • crates/minimald/src/store.rs
  • crates/sessions/src/store.rs

Included review availability: This review used your included allowance. Your plan provides up to 5 included reviews per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

Session name lookup now supports unique ASCII case-insensitive matches. Exact-name matches take precedence, and ambiguous folded-name matches return no result. Command lookup retains ID-prefix matching when no folded name matches.

Changes

Session name lookup

Layer / File(s) Summary
Indexed name lookup
crates/sessions/src/store.rs
The index returns a match only when one name matches under ASCII case folding. DiskLoader::find_by_name checks exact names first, then uses the unique folded match. Tests cover exact-name precedence, ambiguous matches, and case collisions.
Command name resolution
crates/minimal/src/cmd/mod.rs, crates/minimal/src/tests.rs, crates/minimald/src/store.rs
match_id_prefix checks folded names after exact names and before ID prefixes. Tests cover unique and ambiguous folded matches, exact-name precedence, ID-prefix fallback, and uppercase lookup.

Priority: ⬇️ Low

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

Change: Bug fix

Suggested reviewers: norrietaylor

Merge Risk: ⚪ Minimal · up to de461

Session names can be found regardless of ASCII letter case without selecting a session when the match is ambiguous. The change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 87.50% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 4 files.
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 summarizes the main change: resolving session names case-insensitively. It is concise and follows the repository’s Conventional Commit format.
Description check ✅ Passed The description explains the problem and the main changes, and it lists verification commands and results. It omits the template’s Checklist section, but the summary and testing information are presen…
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit checks each session name,
And folds the case but keeps the game.
One match hops forward, clear and bright,
Two matches pause; no guess is right.
Exact names lead, prefixes wait.
The burrow keeps lookup straight.

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

@gominimal-aw-bot
Copy link
Copy Markdown
Contributor Author

[inbox-patch:clobber]

This PR would revert recently merged work

Simulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):

Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected.

If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block.

@gominimal-aw-bot gominimal-aw-bot Bot added clobber-suspected agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch labels Oct 6, 2026
…ed one

Case-only duplicate names written before names were made unique under
case folding can still coexist. The folded fallback now resolves only
when exactly one name folds to the input, and the CLI tries an exact
name before a folded one, so a lookup never picks a different session.
@norrietaylor norrietaylor changed the title fix: fix(sessions): resolve session names case-insensitively fix(sessions): resolve session names case-insensitively Oct 6, 2026
Only hex-shaped names reach match_id_prefix on a name miss, so the CLI
tests now use them and pin that an ambiguous fold does not fall through
to an id prefix. minimald's store test resolves a name in another casing.
@norrietaylor
Copy link
Copy Markdown
Member

/review

@norrietaylor
Copy link
Copy Markdown
Member

@coderabbitai review

@minimal-foundry
minimal-foundry Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor

Approved: no findings at de461f1ebc75.

Nothing to do.

Clobber: none: git log -- crates/sessions/src/store.rs and crates/minimal/src/cmd/mod.rs show only the PR's own two commits (69de8c12, 96a4490f) on top of unrelated prior work; nothing reverts a recent fix.

@coderabbitai
coderabbitai Bot commented Oct 7, 2026 •
Copy link
Copy Markdown
Contributor
⚠️ Action not completed

Already reviewed the last commit. Use @coderabbitai full review to rerun a review of the entire changeset.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@minimal-foundry minimal-foundry Bot left a comment
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minimal-review — approved

Verdict APPROVE — No findings.

@minimal-foundry minimal-foundry Bot added the review:approved minimal-review approved the current head label Oct 7, 2026
@norrietaylor norrietaylor left a comment
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CodeRabbit and minimal-review approved this head; 0 unresolved threads.

@norrietaylor
norrietaylor added this pull request to the merge queue Oct 7, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 7, 2026
@norrietaylor
norrietaylor added this pull request to the merge queue Oct 7, 2026
Merged via the queue into main with commit bb990dd Oct 7, 2026
35 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/case-insensitive-session-name-resolution-55a8bc83e6f96b6c branch October 7, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent:fix Agentic fix PR eligible for review iteration; min-aw's worker-iterate gates on it. agent:resolve Consent gate: pr-conflict-resolver may rewrite this branch clobber-suspected review:approved minimal-review approved the current head

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0