[Bug]: write normalizes whitespace-bearing segments silently while extraction keeps interior spaces — silent fork
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
Research direction
Start by reading openviking/utils/path_safety.py, especially _normalize_storage_segments and normalize_storage_target_uri, then compare _portable_uri_segment in openviking/session/memory/utils/uri.py with sanitize_segment in openviking_cli/utils/uri.py. Reproduce the naming asymmetry with the provided Python snippet and trace the write path in openviking/storage/content_write.py; add or update focused tests for normalization and write/edit behavior. Done means whitespace-bearing targets either fail or warn clearly, or write and extraction use the same normalization, with no silent split into two entries.
Written by the indexing model from the issue text.
Description
Issue Origin
Observed or reproduced in a real environment
Bug Description
Write/edit silently maps a requested URI to a different stored URI when a path segment contains whitespace (space → _), returning success with no warning. The extraction-side naming function treats interior spaces as portable and keeps them, so space-bearing files keep being created; read-then-edit on such a file forks into two entries.
Steps to Reproduce
Naming asymmetry (minimal reproduction, no data written):
from openviking.utils.path_safety import normalize_storage_target_uri
from openviking.session.memory.utils.uri import _portable_uri_segment
print(normalize_storage_target_uri("viking://user/test_user/memories/a b.md"))
# viking://user/test_user/memories/a_b.md
print(_portable_uri_segment("a b.md"))
# a b.md
Observed fork case (initial state: the space-bearing file was produced by memory extraction, which permits interior spaces):
- A space-bearing file already exists (content X).
- Read-then-edit via that same space-bearing URI: edit reads the old file and writes to the same URI; the write is normalized to the underscore-named file (content X plus the edit), returning success with no warning.
- Result: the old space-bearing file and the new underscore-named file coexist.
Expected Behavior
Either of the following:
- Write/edit loudly refuses or warns when the target is normalized to a different name than requested (preferred, given the Windows-portability intent behind #4308/#4517); or
- Extraction and write normalize symmetrically so the same logical name never forks.
Actual Behavior
Write/edit returns success on a different target than requested, with no error or warning; two entries coexist.
Minimal Reproducible Example
The naming-asymmetry snippet above is the minimal reproduction.
Error Logs
None — the call succeeds; that is the problem.
OpenViking Version
0.5.1.1
Python Version
3.13.13
Operating System
macOS (Build 26A428)
Additional Context
Source references (pinned to commit 172d4d9e2e1f568634601be6a3e763e9fc64a56d):
- https://github.com/volcengine/OpenViking/blob/172d4d9e2e1f568634601be6a3e763e9fc64a56d/openviking/utils/path_safety.py#L45 (
_normalize_storage_segments: only whitespace-bearing segments are passed throughsanitize_segment, the rest unchanged) - https://github.com/volcengine/OpenViking/blob/172d4d9e2e1f568634601be6a3e763e9fc64a56d/openviking/storage/content_write.py#L140 (write path goes through
normalize_storage_target_uri) - https://github.com/volcengine/OpenViking/blob/172d4d9e2e1f568634601be6a3e763e9fc64a56d/openviking_cli/utils/uri.py#L252 (
sanitize_segmentdefinition) - https://github.com/volcengine/OpenViking/blob/172d4d9e2e1f568634601be6a3e763e9fc64a56d/openviking/session/memory/utils/uri.py#L38 (
_is_portable_uri_segment: interior spaces are portable)
Background, not disputed: #4308 (Windows trailing-space file I/O failure) is the reason for the portability guard; this report asks for loud-or-symmetric behavior, not for allowing spaces.
— Pi
- Dominant language
- Python
- Stars
- 40.2k
- Forks
- 3.2k
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 403
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from volcengine/OpenViking
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
volcengine/OpenViking#6489 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
volcengine/OpenViking#6471 · 3 comments ·
Maintainers usually reply within 1 day
-
[Bug]: Python SDK duplicates URI scheme after leading whitespacePossibly taken @ktz03 claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
volcengine/OpenViking#6445 ·
Maintainers usually reply within 1 day
-
[Feature]: Document Valkey support for the Redis-backed featuresPossibly taken @dannyward630 claimed this 1 day ago. Openenhancement kernel
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
volcengine/OpenViking#6425 ·
Maintainers usually reply within 1 day
-
[Bug]: memory_policy.working_memory.enabled is silently ignored on 0.5.0 — Working Memory stays offPossibly taken @dannyward630 claimed this 5 days ago. Openbug kernel
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
volcengine/OpenViking#6207 · 1 comment ·
Maintainers usually reply within 1 day
All issues in volcengine/OpenViking
Similar issues
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
fossasia/visdom-dev#77 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws-cloudformation/cfn-lint#4890 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
AstrBotDevs/AstrBot#10720 ·
Maintainers usually reply within 1 day
-
fix(xiaomi): curated picker list still offers six ids that return 400 (plan-limited vs retired)Opencause/upstream comp/cli P2 provider/other tool/file type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
NousResearch/hermes-agent#143900 ·
Maintainers usually reply within 1 day