Files
hermes-webui/tests
nesquena-hermes ff0d25fd0e fix(workspace): strip surrounding quotes from Add Space path input
macOS Finder's 'Copy as Pathname' (Cmd+Option+C) wraps paths in single
quotes by default — '/Users/x/Documents/foo' — and users routinely paste
those quoted strings into the Add Space input expecting them to work.
Other shells and OS file managers do similar things with double quotes.

Today the path is taken via .strip() only, so the literal quote
characters become part of the resolved Path and the validator rejects
the result as 'not a directory'. cygnus reported this on Discord
(2026-05-01) — she had to manually un-quote her paths to register a
new Space.

Fix:
  - New api.workspace._strip_surrounding_quotes() helper. Removes only
    the outermost paired single or double quotes; preserves unpaired or
    mismatched quotes (a path may legitimately contain a literal quote).
  - validate_workspace_to_add() calls it before resolution so every
    code path that registers a workspace benefits, not just the HTTP
    route.
  - _handle_workspace_add() also calls it at the route entry so the
    blocked-system-path check and the duplicate-detection check both
    see the cleaned form.

14 regression tests pin the behavior matrix:
  - Unwrapped path unchanged
  - Single quotes stripped
  - Double quotes stripped
  - Whitespace outside quotes handled (trim-then-strip)
  - Only outermost pair removed (internal quotes preserved)
  - Unpaired / mismatched quotes preserved
  - Empty string + just-a-pair edge cases
  - Validate_workspace_to_add accepts quoted form for existing dir

4610 tests pass (+14 from this PR), 0 regressions, ~2:27 full suite.

Reported by Cygnus on Discord, May 1 2026.
2026-05-06 17:38:11 +00:00
..
2026-04-29 19:54:07 -07:00
2026-05-05 01:51:05 +00:00
2026-05-05 01:51:05 +00:00
2026-04-29 17:42:32 -07:00
2026-04-29 17:42:32 -07:00
2026-04-29 21:34:27 -07:00
2026-04-29 21:06:30 -07:00
2026-04-29 17:42:32 -07:00