Skip to content

Make hosted workspace storage keys case-insensitive on Windows - #78

Open
Telli wants to merge 7 commits into
claude/fervent-gates-uqka3bfrom
claude/fervent-gates-uqka3b-windows-workspace-key
Open

Telli wants to merge 7 commits into
claude/fervent-gates-uqka3bfrom
claude/fervent-gates-uqka3b-windows-workspace-key

Conversation

@Telli

@Telli Telli commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Stacked on #75. Merge that first; this PR's base then retargets to main.

Summary

When a host storage root is configured (embedded and hosted mode), RuntimeStoragePathResolver names each workspace's storage directory after a hash of the exact path text. On Windows, C:\Repo and c:\repo are the same folder but hashed to different storage roots. Sessions, memory and usage data therefore seemed to vanish whenever the working directory's casing changed, for example a drive letter typed in lower case or a different terminal.

  • Case folding: path case is folded before hashing when paths are case-insensitive. This is the default on Windows only, and a new optional constructor parameter overrides it. Linux and macOS behaviour is unchanged.
  • Legacy fallback: if no root exists yet under the folded key, but one exists under the old exact-case key, the resolver keeps using the legacy root. Existing hosted sessions stay visible without a migration step.
  • Non-hosted (in-workspace .sharpclaw) storage is unaffected.

Validation

  • dotnet build SharpClawCode.sln --configuration Release --warnaserror
  • dotnet test SharpClawCode.sln --configuration Release (unit 352, parity 20, integration 136; all passing)
  • Relevant package, CLI, MCP, plugin, and cross-platform checks were run. Only Linux was run, with case folding forced on in the tests; CI covers Windows.

New tests:

  • Differently-cased paths resolve to the same hosted root.
  • An existing legacy exact-case root keeps being used.

Risk and compatibility

  • Durable JSON/session formats remain compatible or include a migration. The legacy-root fallback is the migration. One limit: it finds the old root only when the path is given with the same casing that created it. A root created under some other casing stays under its old key, as it does today.
  • Dangerous file, shell, and network operations still pass through permissions.
  • No credentials, local state, or generated secrets are included.

Generated by Claude Code

With a host storage root configured, the workspace directory key hashed
the exact path text, so C:\Repo and c:\repo got different storage roots
and sessions appeared to vanish when the working directory's casing
changed.

- Fold path case before hashing when paths are case-insensitive
  (default: Windows; overridable via the resolver constructor).
- If the folded-key root does not exist yet but a root under the old
  exact-case key does, keep using the legacy root so existing sessions
  stay visible.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011cFNZGvspeLaq3753UM5NR
Copilot AI balanced review requested due to automatic review settings November 26, 2026 10:37
@coderabbitai

coderabbitai Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: fea93434-7c0e-4333-8b3f-4eb36552dc98

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Telli commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

Entire Gates is failing on one gate only: Approvals ("No reviewers have approved this trail"). The Findings and Up-to-date gates pass, and the GitHub Actions CI is green. A human reviewer has to approve, so no code change can fix this gate.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

3 participants