Skip to content

fix(mcp): honor project constraint in JSON project list - #1937

Merged
phernandez merged 2 commits into
mainfrom
fix/1895-constrained-project-json
Oct 29, 2026
Merged

phernandez merged 2 commits into
mainfrom
fix/1895-constrained-project-json

Conversation

@phernandez

Copy link
Copy Markdown
Member

Why

With BASIC_MEMORY_MCP_PROJECT set, list_memory_projects text output shows only the constrained project, but JSON output returned every merged project and only labeled the constraint. Found by the CodeRabbit deep scan (K12). Fixes #1895.

What changed

  • _format_project_list_json filters projects to the constraint, matched by permalink.
  • Regression test creates a second project, sets the constraint, and checks JSON lists only the constrained one. It fails without the fix.

Verification

  • just fast-test tests/mcp/test_tool_project_management.py: 46 passed
  • just fast-check: clean

First of three stacked PRs from the scan triage.

🤖 Generated with Claude Code

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

list_memory_projects returned every merged project in JSON output while
the text output showed only the constrained project. Filter the JSON
project list to the BASIC_MEMORY_MCP_PROJECT constraint.

Fixes #1895

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8
Signed-off-by: phernandez <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 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-29T02:13:16.891684Z 4fd253d 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.

@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: 4fd253d963

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

merged = [
project
for project in merged
if generate_permalink(project["name"]) == constrained_permalink

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Match qualified constraints before filtering project rows

When BASIC_MEMORY_MCP_PROJECT uses the supported workspace-qualified form such as team/main, cloud routing resolves it correctly, but merged rows store the bare name (main) and the qualified spelling separately in qualified_name. This predicate therefore removes the constrained project—and every other row—so list_memory_projects(output_format="json") returns an empty list; downstream flows such as search_all_projects and the getting-started prompt then behave as though the routed project does not exist. Match the constraint against the row's qualified name (and other supported identifiers) as well as its bare name.

Useful? React with 👍 / 👎.

BASIC_MEMORY_MCP_PROJECT accepts a workspace-qualified name or an
external_id, but the JSON filter compared only bare names, so those
constraints emptied the project list. Match every spelling routing
accepts.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8
Signed-off-by: phernandez <[email protected]>
@phernandez
phernandez merged commit 2f17ed3 into main Oct 29, 2026
51 checks passed
@phernandez
phernandez deleted the fix/1895-constrained-project-json branch October 29, 2026 02:42
phernandez added a commit that referenced this pull request Oct 29, 2026
## Why

`bm cloud api-key save bmc_...` required the key on the command line,
which leaves it in shell history and visible to other local users
through `ps`. Found by the CodeRabbit deep scan (K23). Fixes #1902.

## What changed

- The key argument is optional. When omitted, the command reads it from
a prompt that does not echo input.
- The positional form still works, so existing scripts are unaffected.
- Docs (`docs/cloud-cli.md`, `AGENTS.md`) show the prompt form.

## Verification

- New `tests/cli/test_cloud_api_key_save.py`: the two prompt tests fail
without the fix; the positional test passes before and after.
- `just fast-check`: clean

Stacked on #1937.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01CMYVL1x91B8kJxy7nn2GU8

Signed-off-by: phernandez <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

Honor project constraints in JSON project-list tool output

1 participant