Skip to content

fix: reject empty, whitespace, and control-character session names - #1041

Merged
norrietaylor merged 1 commit into
mainfrom
inbox-patch/validate-session-name-3ea678f062c71f19
Jul 29, 2026
Merged

fix: reject empty, whitespace, and control-character session names#1041
norrietaylor merged 1 commit into
mainfrom
inbox-patch/validate-session-name-3ea678f062c71f19

Conversation

@gominimal-aw-bot

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

Copy link
Copy Markdown
Contributor

Fixes #1037
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgj5w

Session rename and activate --name accepted empty, whitespace-only, and control-character names. A tab or newline then corrupted complete-session-str's one-value<TAB>description-per-line contract (a tab splits the value; a newline forges a phantom completion candidate) and the min ls table's column alignment. The fix validates names in the sessions store, beside the existing name-collision check, at the two real writers of a name: create (the activate --name path) and save. The daemon's rename flows through save, not the store's rename helper, so gating save is what actually covers rename. Names must be non-empty, free of leading/trailing whitespace, and free of control characters. No load-bearing Distillery precedent found (scoped to project minimal).

Verification

cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --locked -- -D warnings — Finished, 0 warnings
cargo build --workspace --locked — Finished dev in 4m 34s
cargo test --workspace --locked — all pass, incl. 4 new store::tests (create/rename reject control chars; validator unit tests)

Generated by inbox-patch ·

Note

Reject empty, whitespace, and control-character session names in DiskLoader

Adds a validate_session_name helper in store.rs that rejects names that are empty, all-whitespace, have leading/trailing whitespace, or contain control characters.

  • DiskLoader::create calls validate_session_name before the existing collision check, returning InvalidInput for invalid names.
  • DiskLoader::save validates the new name before the uniqueness check when a rename is attempted, leaving the original name intact on failure.
  • Behavioral Change: previously accepted names with control characters or surrounding whitespace now return InvalidInput.

Macroscope summarized 67512ab.

Session rename and activate --name accepted empty, whitespace-only, and
control-character names. A tab or newline in a name then corrupted two
downstream surfaces: complete-session-str's "one value<TAB>description
per line" contract (a tab splits the value, a newline forges a phantom
completion candidate) and the min ls table's column alignment.

Validate names in the sessions store, beside the existing name-collision
check, at the two real writers of a name: create (the activate --name
path) and save (the production rename path — the daemon's rename flows
through save, not the store's rename helper). Names must be non-empty,
free of leading/trailing whitespace, and free of control characters.

Fixes #1037
@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: 12 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: beb6f140-2502-4d45-bc5a-feac77828b6f

📥 Commits

Reviewing files that changed from the base of the PR and between c1d466c and 67512ab.

📒 Files selected for processing (1)
  • crates/sessions/src/store.rs

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

@norrietaylor
norrietaylor merged commit 73aad4c into main Jul 29, 2026
29 checks passed
@norrietaylor
norrietaylor deleted the inbox-patch/validate-session-name-3ea678f062c71f19 branch July 29, 2026 18:54
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.

Session names accept empty, whitespace, tab and newline — and tab/newline then corrupt complete-session-str's output contract and the min ls table

1 participant