Repository navigation
Conversation
When append/prepend auto-creates a missing note from a project-qualified identifier (permalink or memory:// URL), drop the active project slug before deriving the on-disk path so files are not nested under an extra project-named directory. Fixes basicmachines-co#1775 Signed-off-by: ningyixi <ningyixi@users.noreply.github.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2424b84e14
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| create_identifier = _strip_active_project_prefix( | ||
| identifier.strip(), | ||
| active_project.permalink, | ||
| include_project=ConfigManager().config.permalinks_include_project, | ||
| ) |
There was a problem hiding this comment.
Normalize project prefixes before disk recovery
When permalinks_include_project is true and notes/foo.md exists on disk but is not indexed yet, an append via test-project/notes/foo reaches _resolve_after_disk_recovery with the still-prefixed entity_identifier, so index-file probes only test-project/notes/foo(.md/.markdown) and misses the real file. These lines then strip the prefix and POST a create at notes/foo.md; local creation rejects the unexpected existing file (while deferred/cloud creation can accept content that cannot materialize), so the documented recovery path does not append the note. Derive and share the project-relative identifier before attempting disk recovery.
AGENTS.md reference: AGENTS.md:L157-L161
Useful? React with 👍 / 👎.
Summary
edit_noteappend/prepend auto-create treated project-qualified identifiers (e.g.demo/scratch/noteormemory://demo/scratch/note) as on-disk paths, so a missing note was created under an extra<project>/directory._strip_active_project_prefixand use it before_parse_identifier_to_title_and_directoryon the autocreate path. Plain paths are only stripped whenpermalinks_include_projectis enabled, so a real folder named like the project remains reachable asdemo/demo/....Fixes #1775
Test plan
pytest tests/mcp/test_tool_edit_note.py -k "strip_active_project_prefix or strips_project_prefix"(9 passed)ruff format/ruff checkon touched files