Skip to content

fix(obsidian): percent-encode vault note paths - #570

Open
kevin9327 wants to merge 1 commit into
HKUDS:mainfrom
kevin9327:fix/obsidian-encode-note-paths
Open

kevin9327 wants to merge 1 commit into
HKUDS:mainfrom
kevin9327:fix/obsidian-encode-note-paths

Conversation

@kevin9327

Copy link
Copy Markdown

Description

Vault operations in the obsidian harness built the request URL by raw string interpolation of the note path. A name like notes/C#cheatsheet.md was sent as /vault/notes/C (the rest became a URL fragment), and What?.md lost everything after ?. In the worst case, create_note/update_note/append_note silently overwrote a different, existing note.

core/vault.py now percent-encodes the path with urllib.parse.quote(path, safe="/") for list/read/create/update/delete (and append, which goes through read/update). Folder separators are kept. Plain paths are unchanged, so existing tests still pass.

Fixes #565

Type of Change

  • Bug Fix — fixes incorrect behavior

Testing

  • Added test_note_paths_with_reserved_characters_are_percent_encoded (#, ?, %, &, space, leading /, and folder listing).
  • pytest cli_anything/obsidian/tests/test_core.py: the new test fails without the fix (1 failed, 52 passed) and passes with it (53 passed).

AI assistance

An AI coding agent (Grok Bot) helped write this change. I reproduced the bug, reviewed the diff, and ran the tests.

Note names containing '#', '?', '%' or spaces were interpolated raw into
the request URL, so the HTTP client cut them at the fragment/query
delimiter and create/update could overwrite a different note.

Fixes HKUDS#565
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-17T03:23:41.037725Z a8811f1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the existing-cli-fix Fixes or improves an existing CLI harness label Oct 17, 2026

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

existing-cli-fix Fixes or improves an existing CLI harness

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: obsidian: note paths are not percent-encoded — names with '#' or '?' hit the wrong note; create/update can silently overwrite a different note

1 participant