Skip to content

fix(mcp): name other-workspace projects in POSIX refusals and ls / - #1780

Merged
phernandez merged 3 commits into
mainfrom
fix/1778-posix-workspace-discovery
Oct 18, 2026
Merged

phernandez merged 3 commits into
mainfrom
fix/1778-posix-workspace-discovery

Conversation

@phernandez

Copy link
Copy Markdown
Member

Fixes #1778.

What changes

On a hosted session that can reach several workspaces, the POSIX tools only showed the session's own workspace. A path whose first segment named a project in another workspace was refused with the local mounts only, so an agent could not find the spelling that works.

  • Refusal names the project's workspace. When the refused first segment names a project in another accessible workspace, the error names the workspace and both spellings that reach it:
    no project 'agent-release-test' — active projects: … . project 'agent-release-test' is in workspace 'zesty-tapir-stone' — use 'zesty-tapir-stone/agent-release-test/<path>' or project_id='…'
    The path still refuses. An unqualified first segment never routes to another workspace (feat(mcp): route project-qualified paths in the POSIX tools #1421).
  • Refusal points to other workspaces when nothing matches. For a segment like a workspace name (My Workspace/...), the error says how other workspaces' projects are addressed and points to list_memory_projects.
  • ls / mentions the other workspaces. The root listing keeps only the session's projects as rows, and adds workspaces (accessible slugs) and a note. The slugs are not rows because a bare slug is not a routable path, and every row must be one.
  • Man pages. ls(1), cat(1) and find(1) document the workspace-qualified form and project_id.

Only cloud-routed sessions consult workspaces. Local refusals and root listings make no new control-plane calls, including a local session that has cloud credentials saved.

Tests

  • test_cloud_unqualified_first_segment_never_reaches_another_workspace now expects the hint. It still pins that the path refuses; the hint offers only the qualified spelling and project_id.
  • New tests check that both hinted spellings route to the named project, that a non-matching segment gets the generic hint, that a single-workspace account adds nothing, and that ls / adds the slugs only when several workspaces are reachable.
  • Ran just fast-check and just fast-test (1,061 passed), plus the routing, POSIX, project-context and CLI POSIX suites (562 passed).

🤖 Generated with Claude Code

https://claude.ai/code/session_01KjsDUcHANBa17M84sKxFG3

…1778)

A hosted session that can reach several workspaces only listed its own
workspace's projects. A path whose first segment named a project in
another workspace was refused with the local mounts only, so an agent
retrying from the message could never find the spelling that works.

- The refusal now names the workspace holding a same-named project and
  both spellings that reach it ('<workspace-slug>/<project>/<path>' or
  project_id). It still refuses: an unqualified first segment never
  routes to another workspace (#1421).
- When nothing matches, the refusal says how other workspaces' projects
  are addressed and points to list_memory_projects.
- `ls /` adds the accessible workspace slugs and a note. They are not
  rows, since a bare slug is not a routable path.
- Only cloud-routed sessions consult workspaces, so local refusals and
  root listings make no new control-plane calls.
- ls(1), cat(1) and find(1) document the workspace-qualified form.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjsDUcHANBa17M84sKxFG3
Signed-off-by: phernandez <paul@basicmachines.co>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 18, 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 ✅ Completed 2026-10-18T17:27:20.358737Z 4b2dc7e New commits
ℹ️ 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.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: fbad63975f

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/mcp/project_context.py Outdated
Comment thread src/basic_memory/mcp/project_context.py Outdated
… discovery failure

Review follow-ups for #1780.

- The refusal hint matched only the first path segment, so with
  'Research' beside 'Research/2026' it pointed 'research/2026/foo' at
  the shorter project. It now uses split_project_permalink_prefix, the
  splitter routing uses, and names the remainder in the spelling.
- A control-plane failure while listing workspaces turned a working
  `ls /` into an error. The slugs only annotate the root, so it logs
  and lists the mounts without them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjsDUcHANBa17M84sKxFG3
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6595f5649b

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/mcp/project_context.py Outdated
Comment thread src/basic_memory/mcp/project_context.py
…ed hints

- catch ToolError from workspace discovery in the other-workspace hint, so
  the refusal still lists this session's mounts
- offer only project_id when a mount would claim the qualified spelling

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjsDUcHANBa17M84sKxFG3
Signed-off-by: phernandez <paul@basicmachines.co>

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b2dc7e9f8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/basic_memory/mcp/project_context.py
Comment thread src/basic_memory/mcp/project_context.py
@phernandez
phernandez merged commit cf4b719 into main Oct 18, 2026
43 checks passed
phernandez added a commit that referenced this pull request Oct 18, 2026
… discovery failure

Review follow-ups for #1780.

- The refusal hint matched only the first path segment, so with
  'Research' beside 'Research/2026' it pointed 'research/2026/foo' at
  the shorter project. It now uses split_project_permalink_prefix, the
  splitter routing uses, and names the remainder in the spelling.
- A control-plane failure while listing workspaces turned a working
  `ls /` into an error. The slugs only annotate the root, so it logs
  and lists the mounts without them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KjsDUcHANBa17M84sKxFG3
Signed-off-by: phernandez <paul@basicmachines.co>
@phernandez
phernandez deleted the fix/1778-posix-workspace-discovery branch October 18, 2026 17:48
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.

POSIX tools: projects in other workspaces can't be found from ls / or the refusal message

1 participant